From 3874249f2e6c371e76c36329cd3efc578590901e Mon Sep 17 00:00:00 2001 From: FujiApple Date: Mon, 19 Apr 2021 11:13:14 +0800 Subject: [PATCH] fix: Message._needed_markup_bot not returning `bot` for the `KeyboardButtonSwitchInline` case when `button.same_peer` is True which is the case for buttons where `switch_inline_query_current_chat` is specified --- telethon/tl/custom/message.py | 1 + 1 file changed, 1 insertion(+) diff --git a/telethon/tl/custom/message.py b/telethon/tl/custom/message.py index c9f00ba0..0adefe9d 100644 --- a/telethon/tl/custom/message.py +++ b/telethon/tl/custom/message.py @@ -1125,6 +1125,7 @@ class Message(ChatGetter, SenderGetter, TLObject): bot = self.input_sender if not bot: raise ValueError('No input sender') + return bot else: try: return self._client._entity_cache[self.via_bot_id]