2019-04-01 10:33:20 +00:00
|
|
|
import os
|
|
|
|
import asyncio
|
2019-04-11 17:04:49 +00:00
|
|
|
from royalnet.bots import TelegramBot, DiscordBot
|
2019-04-09 09:15:27 +00:00
|
|
|
from royalnet.commands import *
|
2019-04-01 10:33:20 +00:00
|
|
|
from royalnet.commands.debug_create import DebugCreateCommand
|
2019-04-04 15:39:38 +00:00
|
|
|
from royalnet.commands.error_handler import ErrorHandlerCommand
|
2019-04-01 10:33:20 +00:00
|
|
|
from royalnet.network import RoyalnetServer
|
2019-04-11 17:04:49 +00:00
|
|
|
from royalnet.database.tables import Royal, Telegram, Discord
|
2019-04-01 10:33:20 +00:00
|
|
|
|
|
|
|
loop = asyncio.get_event_loop()
|
|
|
|
|
2019-04-03 17:31:20 +00:00
|
|
|
commands = [PingCommand, ShipCommand, SmecdsCommand, ColorCommand, CiaoruoziCommand, DebugCreateCommand, SyncCommand,
|
2019-04-09 15:00:14 +00:00
|
|
|
AuthorCommand, DiarioCommand, RageCommand, DateparserCommand, ReminderCommand, KvactiveCommand, KvCommand,
|
|
|
|
KvrollCommand]
|
2019-04-01 10:33:20 +00:00
|
|
|
|
|
|
|
master = RoyalnetServer("localhost", 1234, "sas")
|
2019-04-04 15:39:38 +00:00
|
|
|
tg_bot = TelegramBot(os.environ["TG_AK"], "localhost:1234", "sas", commands, os.environ["DB_PATH"], Royal, Telegram, "tg_id", error_command=ErrorHandlerCommand)
|
2019-04-11 17:29:33 +00:00
|
|
|
ds_bot = DiscordBot(os.environ["DS_AK"], "localhost:1234", "sas", commands, os.environ["DB_PATH"], Royal, Discord, "discord_id", error_command=ErrorHandlerCommand)
|
2019-04-01 10:33:20 +00:00
|
|
|
loop.create_task(master.run())
|
|
|
|
loop.create_task(tg_bot.run())
|
2019-04-07 21:32:33 +00:00
|
|
|
print("Commands enabled:")
|
|
|
|
print(tg_bot.generate_botfather_command_string())
|
2019-04-01 10:33:20 +00:00
|
|
|
print("Starting loop...")
|
|
|
|
loop.run_forever()
|