Skip to content

Commit d6d10c5

Browse files
committed
Answer callback queries properly
Closes jsmnbom#5
1 parent 2b56756 commit d6d10c5

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

bot/menu.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,17 +95,23 @@ def send(self, chat_id, context):
9595
)
9696

9797
def edit(self, update, context):
98-
return update.effective_message.edit_text(
98+
msg = update.effective_message.edit_text(
9999
**self._attrs(update, context)
100100
)
101+
if update.callback_query:
102+
update.callback_query.answer()
103+
return msg
101104

102105
def edit_by_id(self, chat_id, message_id, context):
103106
update = Update(0)
104-
return context.bot.edit_message_text(
107+
msg = context.bot.edit_message_text(
105108
chat_id=chat_id,
106109
message_id=message_id,
107110
**self._attrs(update, context)
108111
)
112+
if update.callback_query:
113+
update.callback_query.answer()
114+
return msg
109115

110116
def matches(self, stack, root=False):
111117
if root:

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy