mirror of
https://github.com/Steffo99/greed.git
synced 2024-11-22 14:04:18 +00:00
More fixes
This commit is contained in:
parent
d3505802a1
commit
25c52855a6
2 changed files with 9 additions and 4 deletions
|
@ -113,6 +113,10 @@ conversation_live_orders_start = "Sei in modalità di <b>Ricezione Ordini</b>!\n
|
||||||
# Conversation: help menu has been opened
|
# Conversation: help menu has been opened
|
||||||
conversation_open_help_menu = "Che tipo di assistenza desideri ricevere?"
|
conversation_open_help_menu = "Che tipo di assistenza desideri ricevere?"
|
||||||
|
|
||||||
|
# Conversation: confirm promotion to admin
|
||||||
|
conversation_confirm_admin_promotion = "Sei sicuro di voler promuovere questo utente a 💼 Gestore?\n" \
|
||||||
|
"E' un'azione irreversibile!"
|
||||||
|
|
||||||
# Conversation: switching to user mode
|
# Conversation: switching to user mode
|
||||||
conversation_switch_to_user_mode = "Stai passando alla modalità 👤 Cliente.\n" \
|
conversation_switch_to_user_mode = "Stai passando alla modalità 👤 Cliente.\n" \
|
||||||
"Se vuoi riassumere il ruolo di 💼 Gestore, riavvia la conversazione con /start."
|
"Se vuoi riassumere il ruolo di 💼 Gestore, riavvia la conversazione con /start."
|
||||||
|
|
|
@ -486,9 +486,9 @@ class ChatWorker(threading.Thread):
|
||||||
value -= cart[product][0].price * cart[product][1]
|
value -= cart[product][0].price * cart[product][1]
|
||||||
# Create {quantity} new OrderItems
|
# Create {quantity} new OrderItems
|
||||||
for i in range(0, cart[product][1]):
|
for i in range(0, cart[product][1]):
|
||||||
orderitem = db.OrderItem(product=cart[product][0],
|
order_item = db.OrderItem(product=cart[product][0],
|
||||||
order_id=order.order_id)
|
order_id=order.order_id)
|
||||||
self.session.add(orderitem)
|
self.session.add(order_item)
|
||||||
# Ensure the user has enough credit to make the purchase
|
# Ensure the user has enough credit to make the purchase
|
||||||
if self.user.credit + value < 0:
|
if self.user.credit + value < 0:
|
||||||
self.bot.send_message(self.chat.id, strings.error_not_enough_credit)
|
self.bot.send_message(self.chat.id, strings.error_not_enough_credit)
|
||||||
|
@ -1141,7 +1141,7 @@ class ChatWorker(threading.Thread):
|
||||||
admin = self.session.query(db.Admin).filter_by(user_id=user.user_id).one_or_none()
|
admin = self.session.query(db.Admin).filter_by(user_id=user.user_id).one_or_none()
|
||||||
if admin is None:
|
if admin is None:
|
||||||
# Create the keyboard to be sent
|
# Create the keyboard to be sent
|
||||||
keyboard = telegram.ReplyKeyboardMarkup([[strings.emoji_yes, strings.emoji_no]])
|
keyboard = telegram.ReplyKeyboardMarkup([[strings.emoji_yes, strings.emoji_no]], one_time_keyboard=True)
|
||||||
# Ask for confirmation
|
# Ask for confirmation
|
||||||
self.bot.send_message(self.chat.id, strings.conversation_confirm_admin_promotion, reply_markup=keyboard)
|
self.bot.send_message(self.chat.id, strings.conversation_confirm_admin_promotion, reply_markup=keyboard)
|
||||||
# Wait for an answer
|
# Wait for an answer
|
||||||
|
@ -1156,6 +1156,7 @@ class ChatWorker(threading.Thread):
|
||||||
create_transactions=False,
|
create_transactions=False,
|
||||||
is_owner=False,
|
is_owner=False,
|
||||||
display_on_help=False)
|
display_on_help=False)
|
||||||
|
self.session.add(admin)
|
||||||
# Send the empty admin message and record the id
|
# Send the empty admin message and record the id
|
||||||
message = self.bot.send_message(self.chat.id, strings.admin_properties.format(name=str(admin.user)))
|
message = self.bot.send_message(self.chat.id, strings.admin_properties.format(name=str(admin.user)))
|
||||||
# Start accepting edits
|
# Start accepting edits
|
||||||
|
|
Loading…
Reference in a new issue