1
Fork 0
mirror of https://github.com/RYGhub/royalnet.git synced 2025-02-17 10:53:57 +00:00
royalnet/royalgames.py

24 lines
1.1 KiB
Python
Raw Normal View History

2019-04-01 12:33:20 +02:00
import os
import asyncio
from royalnet.bots import TelegramBot
2019-04-09 00:08:14 +02:00
from royalnet.commands import PingCommand, ShipCommand, SmecdsCommand, ColorCommand, CiaoruoziCommand, SyncCommand, DiarioCommand, RageCommand
2019-04-01 12:33:20 +02:00
from royalnet.commands.debug_create import DebugCreateCommand
2019-04-03 19:31:20 +02:00
from royalnet.commands.debug_author import DebugAuthorCommand
2019-04-04 17:39:38 +02:00
from royalnet.commands.error_handler import ErrorHandlerCommand
2019-04-01 12:33:20 +02:00
from royalnet.network import RoyalnetServer
2019-04-03 19:31:20 +02:00
from royalnet.database.tables import Royal, Telegram
2019-04-01 12:33:20 +02:00
loop = asyncio.get_event_loop()
2019-04-03 19:31:20 +02:00
commands = [PingCommand, ShipCommand, SmecdsCommand, ColorCommand, CiaoruoziCommand, DebugCreateCommand, SyncCommand,
2019-04-09 00:08:14 +02:00
DebugAuthorCommand, DiarioCommand, RageCommand]
2019-04-01 12:33:20 +02:00
master = RoyalnetServer("localhost", 1234, "sas")
2019-04-04 17:39:38 +02: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-01 12:33:20 +02:00
loop.create_task(master.run())
loop.create_task(tg_bot.run())
2019-04-07 23:32:33 +02:00
print("Commands enabled:")
print(tg_bot.generate_botfather_command_string())
2019-04-01 12:33:20 +02:00
print("Starting loop...")
loop.run_forever()