Skip to content

Commit

Permalink
Add on close deletion for onkeyboard menu (UNICT-DMI#177)
Browse files Browse the repository at this point in the history
* chore: Update gitignore to exclude idea folders

* feat: Add on close deletion
  • Loading branch information
LightDestory authored Jul 24, 2021
1 parent 0b4d1e4 commit 1b0dd8f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -127,4 +127,5 @@ module/*.pyc
pydrive
pydrive/*
.vscode
.idea
data/json/subjs.json
5 changes: 3 additions & 2 deletions module/callback_handlers.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

0 comments on commit 1b0dd8f

Please sign in to comment.