mirror of
https://github.com/LonamiWebs/Telethon.git
synced 2025-02-03 21:24:35 +03:00
Better custom.MessageButton.click() docs
This commit is contained in:
parent
aa6d3430ae
commit
f581db294a
|
@ -512,10 +512,8 @@ class Message:
|
|||
|
||||
async def click(self, i=None, j=None, *, text=None, filter=None):
|
||||
"""
|
||||
Clicks the inline keyboard button of the message, if any.
|
||||
|
||||
If the message has a non-inline keyboard, clicking it will
|
||||
send the message, switch to inline, or open its URL.
|
||||
Calls `telethon.tl.custom.messagebutton.MessageButton.click`
|
||||
for the specified button.
|
||||
|
||||
Does nothing if the message has no buttons.
|
||||
|
||||
|
|
|
@ -54,10 +54,20 @@ class MessageButton:
|
|||
|
||||
async def click(self):
|
||||
"""
|
||||
Clicks the inline keyboard button of the message, if any.
|
||||
Emulates the behaviour of clicking this button.
|
||||
|
||||
If the message has a non-inline keyboard, clicking it will
|
||||
send the message, switch to inline, or open its URL.
|
||||
If it's a normal :tl:`KeyboardButton` with text, a message will be
|
||||
sent, and the sent `telethon.tl.custom.message.Message` returned.
|
||||
|
||||
If it's an inline :tl:`KeyboardButtonCallback` with text and data,
|
||||
it will be "clicked" and the :tl:`BotCallbackAnswer` returned.
|
||||
|
||||
If it's an inline :tl:`KeyboardButtonSwitchInline` button, the
|
||||
:tl:`StartBotRequest` will be invoked and the resulting updates
|
||||
returned.
|
||||
|
||||
If it's a :tl:`KeyboardButtonUrl`, the URL of the button will
|
||||
be passed to ``webbrowser.open`` and return ``True`` on success.
|
||||
"""
|
||||
if isinstance(self.button, types.KeyboardButton):
|
||||
return await self._client.send_message(
|
||||
|
|
Loading…
Reference in New Issue
Block a user