MTPyroger/docs/source/api/bound-methods.rst

151 lines
3.5 KiB
ReStructuredText
Raw Normal View History

2019-05-16 19:28:34 +00:00
Bound Methods
=============
Some Pyrogram types define what are called bound methods. Bound methods are functions attached to a class which are
accessed via an instance of that class. They make it even easier to call specific methods by automatically inferring
some of the required arguments.
.. code-block:: python
:emphasize-lines: 8
from pyrogram import Client
app = Client("my_account")
@app.on_message()
def hello(client, message)
message.reply("hi")
app.run()
.. currentmodule:: pyrogram
2019-05-28 14:41:55 +00:00
Index
-----
2019-05-16 19:28:34 +00:00
Message
2019-05-28 14:41:55 +00:00
^^^^^^^
.. hlist::
:columns: 3
- :meth:`~Message.click`
- :meth:`~Message.delete`
- :meth:`~Message.download`
- :meth:`~Message.forward`
- :meth:`~Message.pin`
- :meth:`~Message.edit_text`
2019-05-28 14:41:55 +00:00
- :meth:`~Message.edit_caption`
- :meth:`~Message.edit_media`
- :meth:`~Message.edit_reply_markup`
- :meth:`~Message.reply_text`
2019-05-28 14:41:55 +00:00
- :meth:`~Message.reply_animation`
- :meth:`~Message.reply_audio`
- :meth:`~Message.reply_cached_media`
- :meth:`~Message.reply_chat_action`
- :meth:`~Message.reply_contact`
- :meth:`~Message.reply_document`
- :meth:`~Message.reply_game`
- :meth:`~Message.reply_inline_bot_result`
- :meth:`~Message.reply_location`
- :meth:`~Message.reply_media_group`
- :meth:`~Message.reply_photo`
- :meth:`~Message.reply_poll`
- :meth:`~Message.reply_sticker`
- :meth:`~Message.reply_venue`
- :meth:`~Message.reply_video`
- :meth:`~Message.reply_video_note`
- :meth:`~Message.reply_voice`
Chat
^^^^
.. hlist::
:columns: 2
- :meth:`~Chat.archive`
- :meth:`~Chat.unarchive`
User
^^^^
.. hlist::
:columns: 2
- :meth:`~User.archive`
- :meth:`~User.unarchive`
2019-05-28 14:41:55 +00:00
CallbackQuery
^^^^^^^^^^^^^
.. hlist::
:columns: 4
2019-05-28 14:41:55 +00:00
- :meth:`~CallbackQuery.answer`
- :meth:`~CallbackQuery.edit_text`
- :meth:`~CallbackQuery.edit_caption`
- :meth:`~CallbackQuery.edit_media`
- :meth:`~CallbackQuery.edit_reply_markup`
2019-05-28 14:41:55 +00:00
InlineQuery
^^^^^^^^^^^
.. hlist::
:columns: 2
2019-05-16 19:28:34 +00:00
2019-05-28 14:41:55 +00:00
- :meth:`~InlineQuery.answer`
2019-05-16 19:28:34 +00:00
2019-05-28 14:41:55 +00:00
-----
Details
-------
.. Message
2019-05-16 19:28:34 +00:00
.. automethod:: Message.click()
.. automethod:: Message.delete()
.. automethod:: Message.download()
.. automethod:: Message.forward()
.. automethod:: Message.pin()
.. automethod:: Message.edit_text()
2019-05-16 19:28:34 +00:00
.. automethod:: Message.edit_caption()
.. automethod:: Message.edit_media()
.. automethod:: Message.edit_reply_markup()
.. automethod:: Message.reply_text()
2019-05-16 19:28:34 +00:00
.. automethod:: Message.reply_animation()
.. automethod:: Message.reply_audio()
.. automethod:: Message.reply_cached_media()
.. automethod:: Message.reply_chat_action()
.. automethod:: Message.reply_contact()
.. automethod:: Message.reply_document()
.. automethod:: Message.reply_game()
.. automethod:: Message.reply_inline_bot_result()
.. automethod:: Message.reply_location()
.. automethod:: Message.reply_media_group()
.. automethod:: Message.reply_photo()
.. automethod:: Message.reply_poll()
.. automethod:: Message.reply_sticker()
.. automethod:: Message.reply_venue()
.. automethod:: Message.reply_video()
.. automethod:: Message.reply_video_note()
.. automethod:: Message.reply_voice()
.. Chat
.. automethod:: Chat.archive()
.. automethod:: Chat.unarchive()
.. User
.. automethod:: User.archive()
.. automethod:: User.unarchive()
2019-05-28 14:41:55 +00:00
.. CallbackQuery
2019-05-16 19:28:34 +00:00
.. automethod:: CallbackQuery.answer()
.. automethod:: CallbackQuery.edit_text()
.. automethod:: CallbackQuery.edit_caption()
.. automethod:: CallbackQuery.edit_media()
.. automethod:: CallbackQuery.edit_reply_markup()
2019-05-16 19:28:34 +00:00
2019-05-28 14:41:55 +00:00
.. InlineQuery
.. automethod:: InlineQuery.answer()