From 17996e8a9b9ad36ffad50395a1f07596532b0a6a Mon Sep 17 00:00:00 2001 From: apepenkov <39992738+apepenkov@users.noreply.github.com> Date: Thu, 9 Nov 2023 22:29:42 +0300 Subject: [PATCH] Add alert param to ButtonCallback.answer (#4249) --- client/src/telethon/_impl/client/events/queries.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/client/src/telethon/_impl/client/events/queries.py b/client/src/telethon/_impl/client/events/queries.py index 08b5ef7f..34a4d423 100644 --- a/client/src/telethon/_impl/client/events/queries.py +++ b/client/src/telethon/_impl/client/events/queries.py @@ -44,6 +44,7 @@ class ButtonCallback(Event): async def answer( self, text: Optional[str] = None, + alert: bool = False, ) -> None: """ Answer the callback query. @@ -54,10 +55,13 @@ class ButtonCallback(Event): :param text: The text of the message to display to the user, usually as a toast. + + :param alert: + If :data:`True`, the message will be shown as a pop-up alert that must be dismissed by the user. """ await self._client( functions.messages.set_bot_callback_answer( - alert=False, + alert=alert, query_id=self._raw.query_id, message=text, url=None,