From 2b9fbec86add4c8c043064bc7f677b73a3b675cb Mon Sep 17 00:00:00 2001 From: apepenkov <39992738+apepenkov@users.noreply.github.com> Date: Fri, 10 Nov 2023 09:20:03 +0300 Subject: [PATCH] imrpove Buttoncallback.get_message Co-authored-by: Lonami --- client/src/telethon/_impl/client/events/queries.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/client/src/telethon/_impl/client/events/queries.py b/client/src/telethon/_impl/client/events/queries.py index ec4bcfe0..f6548350 100644 --- a/client/src/telethon/_impl/client/events/queries.py +++ b/client/src/telethon/_impl/client/events/queries.py @@ -72,10 +72,9 @@ class ButtonCallback(Event): async def get_message(self) -> Optional[Message]: """ - Returns the :class:`~telethon.types.Message` where the button click occurred, - or :data:`None` if the message couldn't be fetched - (for instance, if it's too old and no longer accessible to the bot). + Get the :class:`~telethon.types.Message` containing the button that was clicked. + If the message is too old and is no longer accessible, :data:`None` is returned instead. """ peer_id_ = peer_id(self._raw.peer) peer = self._chat_map.get(peer_id_, None)