mirror of
https://github.com/LonamiWebs/Telethon.git
synced 2024-11-29 04:43:45 +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 row in self.reply_markup.rows:
|
||||||
for button in row.buttons:
|
for button in row.buttons:
|
||||||
if isinstance(button, types.KeyboardButtonSwitchInline):
|
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
|
bot = self.input_sender
|
||||||
if not bot:
|
if not bot:
|
||||||
raise ValueError('No input sender')
|
raise ValueError('No input sender')
|
||||||
|
|
Loading…
Reference in New Issue
Block a user