Add alert param to ButtonCallback.answer (#4249)

This commit is contained in:
apepenkov 2023-11-09 22:29:42 +03:00 committed by GitHub
parent ba0371f89e
commit 17996e8a9b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

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