From 1b0dd8f624ba48962637b91d1b447d71b54d2e9a Mon Sep 17 00:00:00 2001 From: Alessio Tudisco Date: Sat, 24 Jul 2021 17:15:21 +0200 Subject: [PATCH] Add on close deletion for onkeyboard menu (#177) * chore: Update gitignore to exclude idea folders * feat: Add on close deletion --- .gitignore | 1 + module/callback_handlers.py | 5 +++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index 8c7dff9b..9ce47a77 100644 --- a/.gitignore +++ b/.gitignore @@ -127,4 +127,5 @@ module/*.pyc pydrive pydrive/* .vscode +.idea data/json/subjs.json diff --git a/module/callback_handlers.py b/module/callback_handlers.py index 4bf2f0fd..024189f6 100644 --- a/module/callback_handlers.py +++ b/module/callback_handlers.py @@ -77,11 +77,12 @@ def none_handler(update: Update, context: CallbackContext): def exit_handler(update: Update, context: CallbackContext): """Called when the user wants to close a sub-menu. - Reduces the message to a point and removes any inlinekeyboard + Removes the message from the user's chat Args: update: update event context: context passed by the handler """ query = update.callback_query - context.bot.editMessageText(text='.', chat_id=query.message.chat_id, message_id=query.message.message_id) + context.bot.deleteMessage(chat_id=query.message.chat_id, message_id=query.message.message_id) +