diff --git a/royalgames.py b/royalgames.py index 862eb27c..40fbc112 100644 --- a/royalgames.py +++ b/royalgames.py @@ -1,11 +1,11 @@ import os import asyncio -from royalnet.bots import TelegramBot +from royalnet.bots import TelegramBot, DiscordBot from royalnet.commands import * from royalnet.commands.debug_create import DebugCreateCommand from royalnet.commands.error_handler import ErrorHandlerCommand from royalnet.network import RoyalnetServer -from royalnet.database.tables import Royal, Telegram +from royalnet.database.tables import Royal, Telegram, Discord loop = asyncio.get_event_loop() @@ -15,6 +15,7 @@ commands = [PingCommand, ShipCommand, SmecdsCommand, ColorCommand, CiaoruoziComm master = RoyalnetServer("localhost", 1234, "sas") tg_bot = TelegramBot(os.environ["TG_AK"], "localhost:1234", "sas", commands, os.environ["DB_PATH"], Royal, Telegram, "tg_id", error_command=ErrorHandlerCommand) +ds_bot = DiscordBot(os.environ["DS_AK"], "localhost:1234", "sas", commands, os.environ["DB_PATH"], Royal, Discord, "discord_ig", error_command=ErrorHandlerCommand) loop.create_task(master.run()) loop.create_task(tg_bot.run()) print("Commands enabled:") diff --git a/royalnet/commands/sync.py b/royalnet/commands/sync.py index 288ce3c1..a12a75be 100644 --- a/royalnet/commands/sync.py +++ b/royalnet/commands/sync.py @@ -1,5 +1,6 @@ import typing from telegram import Update, User +from discord import Message, Member from ..utils import Command, Call, asyncify, UnsupportedError from ..database.tables import Royal, Telegram @@ -35,9 +36,9 @@ class SyncCommand(Command): # Avatar is WIP telegram = call.alchemy.Telegram(royal=royal, tg_id=user.id, - tg_first_name=user.first_name, - tg_last_name=user.last_name, - tg_username=user.username) + first_name=user.first_name, + last_name=user.last_name, + username=user.username) call.session.add(telegram) await call.reply(f"✅ Connessione completata: {str(royal)} ⬌ {str(telegram)}") else: