imrpove Buttoncallback.get_message

Co-authored-by: Lonami <totufals@hotmail.com>
This commit is contained in:
apepenkov 2023-11-10 09:20:03 +03:00 committed by GitHub
parent 582d8859ac
commit 2b9fbec86a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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)