1
Fork 0
mirror of https://github.com/Steffo99/greed.git synced 2024-11-22 05:54:18 +00:00

Hide custom keyboard during Live Orders mode (closes #39)

Also fixes a bug with the chinese translation
This commit is contained in:
Steffo 2020-09-06 03:53:49 +02:00
parent 228dac5821
commit b4fc5d0efa
6 changed files with 41 additions and 24 deletions

View file

@ -102,13 +102,14 @@ conversation_confirm_cart = "🛒 Your cart contains the following products:\n"
"<i>If you want to proceed, press the Done button below this message.\n" \ "<i>If you want to proceed, press the Done button below this message.\n" \
"To cancel, press the Cancel button.</i>" "To cancel, press the Cancel button.</i>"
# Conversation: the user activated the live orders mode # Live orders mode: start
conversation_live_orders_start = "You are in <b>Live Orders</b> mode\n" \ conversation_live_orders_start = "You are in <b>Live Orders</b> mode\n" \
"All new orders placed by customers will appear in real time in this chat, and you" \ "All new orders placed by customers will appear in real time in this chat, and you" \
" will be able to mark them as ✅ Completed" \ " will be able to mark them as ✅ Completed" \
" or ✴️ Refund the credit to the customer.\n" \ " or ✴️ Refund the credit to the customer."
"\n" \
"<i>Press the Stop button below this message to stop the" \ # Live orders mode: stop receiving messages
conversation_live_orders_stop = "<i>Press the Stop button below this message to stop the" \
" feed.</i>" " feed.</i>"
# Conversation: help menu has been opened # Conversation: help menu has been opened

View file

@ -102,14 +102,15 @@ conversation_confirm_cart = "🛒 Il tuo carrello contiene questi prodotti:\n" \
"<i>Se vuoi procedere, premi il tasto Fatto sotto a questo messaggio.\n" \ "<i>Se vuoi procedere, premi il tasto Fatto sotto a questo messaggio.\n" \
"Per annullare, premi il tasto Annulla.</i>" "Per annullare, premi il tasto Annulla.</i>"
# Conversation: the user activated the live orders mode # Live orders mode: start
conversation_live_orders_start = "Sei in modalità di <b>Ricezione Ordini</b>!\n" \ conversation_live_orders_start = "Sei in modalità di <b>Ricezione Ordini</b>!\n" \
"Tutti i nuovi ordini piazzati dai clienti ti appariranno in tempo reale in questa" \ "Tutti i nuovi ordini piazzati dai clienti ti appariranno in tempo reale in questa" \
" chat, e potrai segnarli come ✅ completati" \ " chat, e potrai segnarli come ✅ completati" \
" oppure ✴️ rimborsare il credito al cliente.\n" \ " oppure ✴️ rimborsare il credito al cliente."
"\n" \
"<i>Premi il tasto Interrompi sotto a questo messaggio per interrompere la" \ # Live orders mode: stop receiving messages
" ricezione.</i>" conversation_live_orders_stop = "<i>Premi il tasto Interrompi sotto a questo messaggio per interrompere la" \
" ricezione.</i>"
# 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?"

View file

@ -99,13 +99,14 @@ conversation_confirm_cart = "🛒 Продукты у Вас в корзине:\
"<i>Нажмите Готово, чтобы продолжить.\n" \ "<i>Нажмите Готово, чтобы продолжить.\n" \
"Если передумали - выберите Отмена.</i>" "Если передумали - выберите Отмена.</i>"
# Conversation: the user activated the live orders mode # Live orders mode: start
conversation_live_orders_start = "Вы в режиме <b>Новые заказы</b>\n" \ conversation_live_orders_start = "Вы в режиме <b>Новые заказы</b>\n" \
"Все новые заказы появятся в этом чате в режиме реального времени," \ "Все новые заказы появятся в этом чате в режиме реального времени," \
" и их можно отметить ✅ Выполнено" \ " и их можно отметить ✅ Выполнено" \
" или ✴️ Возвращено в случае возврата денег.\n" \ " или ✴️ Возвращено в случае возврата денег." \
"\n" \
"<i>Нажмите Стоп в этом чате, чтобы остановить этот режим.</i>" # Live orders mode: stop receiving messages
conversation_live_orders_stop = "<i>Нажмите Стоп в этом чате, чтобы остановить этот режим.</i>"
# Conversation: help menu has been opened # Conversation: help menu has been opened
conversation_open_help_menu = "Чем могу Вам помочь?" conversation_open_help_menu = "Чем могу Вам помочь?"

View file

@ -99,13 +99,14 @@ conversation_confirm_cart = "🛒 У вас в кошику наступні п
"<i>Щоб продовжити натисніть Готово.\n" \ "<i>Щоб продовжити натисніть Готово.\n" \
"Якщо змінили свою думку - обирайте Відміна.</i>" "Якщо змінили свою думку - обирайте Відміна.</i>"
# Conversation: the user activated the live orders mode # Live orders mode: start
conversation_live_orders_start = "Ви в режимі <b>Свіжі Замовлення</b>\n" \ conversation_live_orders_start = "Ви в режимі <b>Свіжі Замовлення</b>\n" \
"Всі нові замовення від покупців зʼявляться в цьому чаті в режимі живого часу," \ "Всі нові замовення від покупців зʼявляться в цьому чаті в режимі живого часу," \
" і ви зможете помічати їх ✅ Виконано" \ " і ви зможете помічати їх ✅ Виконано" \
" або ✴️ Повернути кошти покупцю.\n" \ " або ✴️ Повернути кошти покупцю."
"\n" \
"<i>Натисніть кнопку Стоп в цьому чаті, щоб зупинити цей режим.</i>" # Live orders mode: stop receiving messages
conversation_live_orders_stop = "<i>Натисніть кнопку Стоп в цьому чаті, щоб зупинити цей режим.</i>"
# Conversation: help menu has been opened # Conversation: help menu has been opened
conversation_open_help_menu = "Як можемо Вам допомогти?" conversation_open_help_menu = "Як можемо Вам допомогти?"

View file

@ -101,12 +101,18 @@ conversation_confirm_cart = "🛒 您的购物车包含以下产品:\n" \
"<i>如果要继续,请按此消息下方的“完成”按钮.\n" \ "<i>如果要继续,请按此消息下方的“完成”按钮.\n" \
"如果要取消,请按取消按钮.</i>" "如果要取消,请按取消按钮.</i>"
# Conversation: the user activated the live orders mode # Live orders mode: start
conversation_live_orders_start = "您处于<b>实时订单</b>模式\n" \ # TODO: This string is incomplete!
"客户下的所有新订单将实时显示在此聊天中," \ # conversation_live_orders_start = "您处于<b>实时订单</b>模式\n" \
"您可以将能够将它们标记为 ✅ 已完成." \ # "客户下的所有新订单将实时显示在此聊天中," \
" 或者 ✴️ 您可以退款给客户.\n" \ # "您可以将能够将它们标记为 ✅ 已完成." \
" 反馈</i>" # " 或者 ✴️ 您可以退款给客户.\n" \
# " 反馈</i>"
# Live orders mode: stop receiving messages
# TODO: This string is missing.
# conversation_live_orders_stop = ""
# Conversation: help menu has been opened # Conversation: help menu has been opened
conversation_open_help_menu = "您需要什么样的帮助?" conversation_open_help_menu = "您需要什么样的帮助?"

View file

@ -1021,7 +1021,14 @@ class Worker(threading.Thread):
cancel_keyboard = telegram.InlineKeyboardMarkup([[telegram.InlineKeyboardButton(self.loc.get("menu_cancel"), cancel_keyboard = telegram.InlineKeyboardMarkup([[telegram.InlineKeyboardButton(self.loc.get("menu_cancel"),
callback_data="cmd_cancel")]]) callback_data="cmd_cancel")]])
# Send a small intro message on the Live Orders mode # Send a small intro message on the Live Orders mode
self.bot.send_message(self.chat.id, self.loc.get("conversation_live_orders_start"), reply_markup=stop_keyboard) # Remove the keyboard with the first message... (#39)
self.bot.send_message(self.chat.id,
self.loc.get("conversation_live_orders_start"),
reply_markup=telegram.ReplyKeyboardRemove())
# ...and display a small inline keyboard with the following one
self.bot.send_message(self.chat.id,
self.loc.get("conversation_live_orders_stop"),
reply_markup=stop_keyboard)
# Create the order keyboard # Create the order keyboard
order_keyboard = telegram.InlineKeyboardMarkup([[telegram.InlineKeyboardButton(self.loc.get("menu_complete"), order_keyboard = telegram.InlineKeyboardMarkup([[telegram.InlineKeyboardButton(self.loc.get("menu_complete"),
callback_data="order_complete")], callback_data="order_complete")],