mirror of
https://github.com/Steffo99/greed.git
synced 2024-11-21 21:44:19 +00:00
Update user credit after a user menu choice
This commit is contained in:
parent
f823d5cc7a
commit
752830d190
1 changed files with 2 additions and 1 deletions
|
@ -254,6 +254,8 @@ class ChatWorker(threading.Thread):
|
||||||
selection = self.__wait_for_specific_message([strings.menu_order, strings.menu_order_status,
|
selection = self.__wait_for_specific_message([strings.menu_order, strings.menu_order_status,
|
||||||
strings.menu_add_credit, strings.menu_bot_info,
|
strings.menu_add_credit, strings.menu_bot_info,
|
||||||
strings.menu_help])
|
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 the user has selected the Order option...
|
||||||
if selection == strings.menu_order:
|
if selection == strings.menu_order:
|
||||||
# Open the order menu
|
# Open the order menu
|
||||||
|
@ -966,7 +968,6 @@ class ChatWorker(threading.Thread):
|
||||||
# Create a keyboard with the user help menu
|
# Create a keyboard with the user help menu
|
||||||
keyboard = [[telegram.KeyboardButton(strings.menu_guide)],
|
keyboard = [[telegram.KeyboardButton(strings.menu_guide)],
|
||||||
[telegram.KeyboardButton(strings.menu_contact_shopkeeper)],
|
[telegram.KeyboardButton(strings.menu_contact_shopkeeper)],
|
||||||
[telegram.KeyboardButton(strings.menu_bot_info)],
|
|
||||||
[telegram.KeyboardButton(strings.menu_cancel)]]
|
[telegram.KeyboardButton(strings.menu_cancel)]]
|
||||||
# Send the previously created keyboard to the user (ensuring it can be clicked only 1 time)
|
# Send the previously created keyboard to the user (ensuring it can be clicked only 1 time)
|
||||||
self.bot.send_message(self.chat.id,
|
self.bot.send_message(self.chat.id,
|
||||||
|
|
Loading…
Reference in a new issue