mirror of
https://github.com/LonamiWebs/Telethon.git
synced 2025-06-18 02:56:39 +00:00
Add alert param to ButtonCallback.answer (#4249)
This commit is contained in:
parent
ba0371f89e
commit
17996e8a9b
@ -44,6 +44,7 @@ class ButtonCallback(Event):
|
|||||||
async def answer(
|
async def answer(
|
||||||
self,
|
self,
|
||||||
text: Optional[str] = None,
|
text: Optional[str] = None,
|
||||||
|
alert: bool = False,
|
||||||
) -> None:
|
) -> None:
|
||||||
"""
|
"""
|
||||||
Answer the callback query.
|
Answer the callback query.
|
||||||
@ -54,10 +55,13 @@ class ButtonCallback(Event):
|
|||||||
|
|
||||||
:param text:
|
:param text:
|
||||||
The text of the message to display to the user, usually as a toast.
|
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(
|
await self._client(
|
||||||
functions.messages.set_bot_callback_answer(
|
functions.messages.set_bot_callback_answer(
|
||||||
alert=False,
|
alert=alert,
|
||||||
query_id=self._raw.query_id,
|
query_id=self._raw.query_id,
|
||||||
message=text,
|
message=text,
|
||||||
url=None,
|
url=None,
|
||||||
|
Loading…
Reference in New Issue
Block a user