From 54d43b27c20e85a27245a31cecaa7a5898f095d5 Mon Sep 17 00:00:00 2001 From: NormalParameter Date: Sun, 13 Mar 2022 09:05:44 +0100 Subject: [PATCH] New bot funcionalities --- telegram_bot/bot.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/telegram_bot/bot.py b/telegram_bot/bot.py index 727b7de..20038e9 100644 --- a/telegram_bot/bot.py +++ b/telegram_bot/bot.py @@ -16,18 +16,20 @@ bot = telebot.TeleBot(os.getenv('BOT_API_KEY')) @bot.message_handler(commands=['start', 'help']) def send_welcome(message): - bot.reply_to(message, "Thank you for using this bot") - + bot.reply_to(message, "/id or /auth for authentication. For further details see aktienbot.flokaiser.com") + +@bot.message_handler(commands=['id', 'auth']) +def send_id(message): + answer = 'Your ID/Authentication Code is: ' + str(message.from_user.id) + '. Enter this code in the settings on aktienbot.flokaiser.com to get updates on your shares.' + bot.reply_to(message, answer) @bot.message_handler(func=lambda message: True) def echo_all(message): - answer = message.text + ' ID: ' + str(message.from_user.id) + answer = 'Do not know this command or text: ' + message.text bot.reply_to(message, answer) - telebot.logger.setLevel(logging.DEBUG) - @bot.inline_handler(lambda query: query.query == 'text') def query_text(inline_query): try: