Clarify and fix some docstrings

This commit is contained in:
Lonami Exo
2018-09-04 11:27:10 +02:00
parent a57e9ba2fb
commit bbeb8f4ba3
4 changed files with 21 additions and 9 deletions

View File

@@ -4,6 +4,15 @@ from .messagebutton import MessageButton
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
sending a message with inline or keyboard buttons.
@@ -30,11 +39,6 @@ class Button:
self.callback = callback
self.is_inline = self._is_inline(button)
@property
def data(self):
if isinstance(self.button, types.KeyboardButtonCallback):
return self.button.data
@classmethod
def _is_inline(cls, button):
"""