mirror of
https://github.com/LonamiWebs/Telethon.git
synced 2024-11-25 10:53:44 +03:00
Fix .get_buttons failing for some messages sent by the bot
Closes #1619.
This commit is contained in:
parent
e4a6ec40cd
commit
b02a22eaa3
|
@ -1080,7 +1080,8 @@ class Message(ChatGetter, SenderGetter, TLObject, abc.ABC):
|
|||
for row in self.reply_markup.rows:
|
||||
for button in row.buttons:
|
||||
if isinstance(button, types.KeyboardButtonSwitchInline):
|
||||
if button.same_peer:
|
||||
# no via_bot_id means the bot sent the message itself (#1619)
|
||||
if button.same_peer or not self.via_bot_id:
|
||||
bot = self.input_sender
|
||||
if not bot:
|
||||
raise ValueError('No input sender')
|
||||
|
|
Loading…
Reference in New Issue
Block a user