From c05b26d9d753ca4623c85fa4891ef26e4a9c2e38 Mon Sep 17 00:00:00 2001 From: mhbahmani Date: Thu, 5 Oct 2023 19:41:01 +0330 Subject: [PATCH] Minor changes on set username password flow --- src/reserve.py | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/src/reserve.py b/src/reserve.py index 0d85718..7743d9d 100644 --- a/src/reserve.py +++ b/src/reserve.py @@ -159,11 +159,19 @@ def handle_username_input(self, update, context): def handle_password_input(self, update, context): password = update.message.text - update.message.reply_text(messages.username_and_password_saved_message) + message_id = update.message.reply_text(messages.username_and_password_saved_message).message_id if not Dining.check_username_and_password(context.user_data['username'], password): - update.message.reply_text(messages.username_or_password_incorrect_message) + context.bot.edit_message_text( + text=messages.username_or_password_incorrect_message, + chat_id=update.message.chat_id, + message_id=message_id, + ) else: - update.message.reply_text(messages.username_and_password_correct_message) + context.bot.edit_message_text( + text=messages.username_and_password_correct_message, + chat_id=update.message.chat_id, + message_id=message_id, + ) self.db.update_user_info({ "user_id": update.message.chat.id, "username": update.effective_user.username,