mirror of
https://github.com/LonamiWebs/Telethon.git
synced 2024-11-25 19:03:46 +03:00
Fix accessing buttons on messages with reply markup
This commit is contained in:
parent
c1d67f35c9
commit
2cf95ce2b9
|
@ -676,6 +676,10 @@ class Message(ChatGetter, SenderGetter, TLObject, abc.ABC):
|
|||
to know what bot we want to start. Raises ``ValueError`` if the bot
|
||||
cannot be found but is needed. Returns ``None`` if it's not needed.
|
||||
"""
|
||||
if not isinstance(self.reply_markup, (
|
||||
types.ReplyInlineMarkup, types.ReplyKeyboardMarkup)):
|
||||
return None
|
||||
|
||||
for row in self.reply_markup.rows:
|
||||
for button in row.buttons:
|
||||
if isinstance(button, types.KeyboardButtonSwitchInline):
|
||||
|
|
Loading…
Reference in New Issue
Block a user