mirror of
https://github.com/LonamiWebs/Telethon.git
synced 2025-06-18 11:06:39 +00:00
Clarify and fix some docstrings
This commit is contained in:
parent
a57e9ba2fb
commit
bbeb8f4ba3
@ -47,7 +47,8 @@ class ButtonMethods(UpdateMethods):
|
|||||||
|
|
||||||
self.add_event_handler(
|
self.add_event_handler(
|
||||||
button.callback,
|
button.callback,
|
||||||
events.CallbackQuery(data=button.data)
|
events.CallbackQuery(data=getattr(
|
||||||
|
button.button, 'data', None))
|
||||||
)
|
)
|
||||||
|
|
||||||
button = button.button
|
button = button.button
|
||||||
|
@ -162,9 +162,9 @@ class DialogMethods(UserMethods):
|
|||||||
*, timeout=None, total_timeout=60, max_messages=100,
|
*, timeout=None, total_timeout=60, max_messages=100,
|
||||||
replies_are_responses=True):
|
replies_are_responses=True):
|
||||||
"""
|
"""
|
||||||
Returns an iterator over the dialogs, yielding 'limit' at most.
|
Creates a `Conversation <telethon.tl.custom.conversation.Conversation>`
|
||||||
Dialogs are the open "chats" or conversations with other people,
|
with the given entity so you can easily send messages and await for
|
||||||
groups you have joined, or channels you are subscribed to.
|
responses or other reactions. Refer to its documentation for more.
|
||||||
|
|
||||||
Args:
|
Args:
|
||||||
entity (`entity`):
|
entity (`entity`):
|
||||||
|
@ -4,6 +4,15 @@ from .messagebutton import MessageButton
|
|||||||
|
|
||||||
class Button:
|
class Button:
|
||||||
"""
|
"""
|
||||||
|
.. note::
|
||||||
|
|
||||||
|
This class is used to **define** reply markups, e.g. when
|
||||||
|
sending a message or replying to events. When you access
|
||||||
|
`Message.buttons <telethon.tl.custom.message.Message.buttons>`
|
||||||
|
they are actually `MessageButton
|
||||||
|
<telethon.tl.custom.messagebutton.MessageButton>`,
|
||||||
|
so you might want to refer to that class instead.
|
||||||
|
|
||||||
Helper class to allow defining ``reply_markup`` when
|
Helper class to allow defining ``reply_markup`` when
|
||||||
sending a message with inline or keyboard buttons.
|
sending a message with inline or keyboard buttons.
|
||||||
|
|
||||||
@ -30,11 +39,6 @@ class Button:
|
|||||||
self.callback = callback
|
self.callback = callback
|
||||||
self.is_inline = self._is_inline(button)
|
self.is_inline = self._is_inline(button)
|
||||||
|
|
||||||
@property
|
|
||||||
def data(self):
|
|
||||||
if isinstance(self.button, types.KeyboardButtonCallback):
|
|
||||||
return self.button.data
|
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def _is_inline(cls, button):
|
def _is_inline(cls, button):
|
||||||
"""
|
"""
|
||||||
|
@ -5,6 +5,13 @@ import webbrowser
|
|||||||
|
|
||||||
class MessageButton:
|
class MessageButton:
|
||||||
"""
|
"""
|
||||||
|
.. note::
|
||||||
|
|
||||||
|
`Message.buttons <telethon.tl.custom.message.Message.buttons>`
|
||||||
|
are instances of this type. If you want to **define** a reply
|
||||||
|
markup for e.g. sending messages, refer to `Button
|
||||||
|
<telethon.tl.custom.button.Button>` instead.
|
||||||
|
|
||||||
Custom class that encapsulates a message button providing
|
Custom class that encapsulates a message button providing
|
||||||
an abstraction to easily access some commonly needed features
|
an abstraction to easily access some commonly needed features
|
||||||
(such as clicking the button itself).
|
(such as clicking the button itself).
|
||||||
|
Loading…
Reference in New Issue
Block a user