diff --git a/telegrambot.py b/telegrambot.py index 26fa0d0d..6f6cd9f2 100644 --- a/telegrambot.py +++ b/telegrambot.py @@ -80,6 +80,11 @@ def catch_and_report(func: "function"): return new_func +@catch_and_report +def cmd_ping(bot: Bot, update: Update): + bot.send_message(update.message.chat.id, "🏓 Pong!") + + @catch_and_report def cmd_register(bot: Bot, update: Update): session = db.Session() @@ -568,6 +573,7 @@ def process(arg_discord_connection): logger.info("Creating updater...") u = Updater(config["Telegram"]["bot_token"]) logger.info("Registering handlers...") + u.dispatcher.add_handler(CommandHandler("ping", cmd_ping)) u.dispatcher.add_handler(CommandHandler("register", cmd_register)) u.dispatcher.add_handler(CommandHandler("discord", cmd_discord)) u.dispatcher.add_handler(CommandHandler("cv", cmd_discord))