2019-04-01 10:33:20 +00:00
|
|
|
import os
|
|
|
|
import asyncio
|
|
|
|
from royalnet.bots import TelegramBot
|
2019-04-01 19:44:22 +00:00
|
|
|
from royalnet.commands import PingCommand, ShipCommand, SmecdsCommand, ColorCommand, CiaoruoziCommand, SyncCommand
|
2019-04-01 10:33:20 +00:00
|
|
|
from royalnet.commands.debug_create import DebugCreateCommand
|
2019-04-03 17:31:20 +00:00
|
|
|
from royalnet.commands.debug_author import DebugAuthorCommand
|
2019-04-01 10:33:20 +00:00
|
|
|
from royalnet.network import RoyalnetServer
|
2019-04-03 17:31:20 +00:00
|
|
|
from royalnet.database.tables import Royal, Telegram
|
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,
|
|
|
|
DebugAuthorCommand]
|
2019-04-01 10:33:20 +00:00
|
|
|
|
|
|
|
master = RoyalnetServer("localhost", 1234, "sas")
|
2019-04-03 17:31:20 +00:00
|
|
|
tg_bot = TelegramBot(os.environ["TG_AK"], "localhost:1234", "sas", commands, os.environ["DB_PATH"], Royal, Telegram, "tg_id")
|
2019-04-01 10:33:20 +00:00
|
|
|
loop.create_task(master.run())
|
|
|
|
loop.create_task(tg_bot.run())
|
|
|
|
print("Starting loop...")
|
|
|
|
loop.run_forever()
|