From a1c7c5a223d22017508998599388c5adf9a90713 Mon Sep 17 00:00:00 2001 From: clarkzjw Date: Mon, 27 Feb 2023 15:48:09 -0800 Subject: bot: add check_user decorator to check user login status --- bot.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'bot.py') diff --git a/bot.py b/bot.py index bcfab8f..364a85f 100644 --- a/bot.py +++ b/bot.py @@ -114,10 +114,10 @@ async def process_oauth_login_callback(update: FediLoginCallbackUpdate, context: user.access_key = encrypt(access_token, ENCRYPT_KEY) user.save() - text = "You have successfully logged in to your Mastodon account!" - await context.bot.delete_message(chat_id=user.telegram_user_id, message_id=context.user_data[PROMPT_FEDI_LOGIN]) - await context.bot.send_message(chat_id=user.telegram_user_id, text=text) - await context.bot.send_message(chat_id=user.telegram_user_id, text=PROMPT_CHOOSE_ACTION, reply_markup=MAIN_MENU) + text = "You have successfully logged in to your Mastodon account!" + await context.bot.delete_message(chat_id=user.telegram_user_id, message_id=context.user_data[PROMPT_FEDI_LOGIN]) + await context.bot.send_message(chat_id=user.telegram_user_id, text=text) + await context.bot.send_message(chat_id=user.telegram_user_id, text=PROMPT_CHOOSE_ACTION, reply_markup=MAIN_MENU) async def main() -> None: -- cgit v1.2.3