From 752830d1908cc3cf7ca42468e482783a0ec1c606 Mon Sep 17 00:00:00 2001 From: Stefano Pigozzi Date: Thu, 19 Apr 2018 10:03:25 +0200 Subject: [PATCH] Update user credit after a user menu choice --- worker.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/worker.py b/worker.py index a1d9ef3..4067dca 100644 --- a/worker.py +++ b/worker.py @@ -254,6 +254,8 @@ class ChatWorker(threading.Thread): selection = self.__wait_for_specific_message([strings.menu_order, strings.menu_order_status, strings.menu_add_credit, strings.menu_bot_info, strings.menu_help]) + # After the user reply, update the user data + self.user = self.session.query(db.User).filter(db.User.user_id == self.chat.id) # If the user has selected the Order option... if selection == strings.menu_order: # Open the order menu @@ -966,7 +968,6 @@ class ChatWorker(threading.Thread): # Create a keyboard with the user help menu keyboard = [[telegram.KeyboardButton(strings.menu_guide)], [telegram.KeyboardButton(strings.menu_contact_shopkeeper)], - [telegram.KeyboardButton(strings.menu_bot_info)], [telegram.KeyboardButton(strings.menu_cancel)]] # Send the previously created keyboard to the user (ensuring it can be clicked only 1 time) self.bot.send_message(self.chat.id,