don't edit message to remove inline keyboard anymore

Signed-off-by: Konrad <klux2@hs-mittweida.de>
This commit is contained in:
Konrad 2019-09-27 20:15:36 +02:00
parent c7c2f271ec
commit 9e0622e985

View file

@ -74,8 +74,6 @@ class HSMensaW(telepot.aio.helper.ChatHandler):
[InlineKeyboardButton(text="Deutsch + English", callback_data=Language.GERMAN_ENGLISH.value)], [InlineKeyboardButton(text="Deutsch + English", callback_data=Language.GERMAN_ENGLISH.value)],
]) ])
editors = dict()
async def on_chat_message(self, msg: dict) -> None: async def on_chat_message(self, msg: dict) -> None:
global config, essen, status, var, logging_enabled global config, essen, status, var, logging_enabled
@ -131,14 +129,10 @@ class HSMensaW(telepot.aio.helper.ChatHandler):
await send_message(bot_obj=bot, chat_id=chat_id, msg=info_str, parse_mode="markdown") await send_message(bot_obj=bot, chat_id=chat_id, msg=info_str, parse_mode="markdown")
elif text.startswith("/settings"): elif text.startswith("/settings"):
old_editor = self.editors.pop(chat_id, None)
if old_editor is not None:
await old_editor.deleteMessage()
sent = await self.sender.sendMessage("Bitte Sprache(n) auswählen/Please select language(s)", await send_message(bot_obj=bot, chat_id=chat_id,
reply_markup=self.keyboard) msg="Bitte Sprache(n) auswählen/Please select language(s)",
reply_markup=self.keyboard)
self.editors[chat_id] = telepot.aio.helper.Editor(bot, sent)
elif text.startswith("/status") and chat_id in config_ids: elif text.startswith("/status") and chat_id in config_ids:
await send_message(bot_obj=bot, chat_id=chat_id, msg=status, parse_mode="markdown") await send_message(bot_obj=bot, chat_id=chat_id, msg=status, parse_mode="markdown")
@ -172,10 +166,6 @@ class HSMensaW(telepot.aio.helper.ChatHandler):
global config, ids global config, ids
query_id, from_id, query_data = telepot.glance(msg, flavor='callback_query') query_id, from_id, query_data = telepot.glance(msg, flavor='callback_query')
editor = self.editors.pop(from_id, None)
if editor is not None:
await editor.editMessageReplyMarkup(reply_markup=None)
message = "Fehler beim Setzen der Sprache" message = "Fehler beim Setzen der Sprache"
if query_data == Language.GERMAN.value: if query_data == Language.GERMAN.value:
message = "Sprache geändert nach _deutsch_." message = "Sprache geändert nach _deutsch_."