|
| 1 | +Bound Methods |
| 2 | +============= |
| 3 | + |
| 4 | +Some Pyrogram types define what are called bound methods. Bound methods are functions attached to a class which are |
| 5 | +accessed via an instance of that class. They make it even easier to call specific methods by automatically inferring |
| 6 | +some of the required arguments. |
| 7 | + |
| 8 | +.. code-block:: python |
| 9 | + :emphasize-lines: 8 |
| 10 | +
|
| 11 | + from pyrogram import Client |
| 12 | +
|
| 13 | + app = Client("my_account") |
| 14 | +
|
| 15 | +
|
| 16 | + @app.on_message() |
| 17 | + def hello(client, message) |
| 18 | + message.reply("hi") |
| 19 | +
|
| 20 | +
|
| 21 | + app.run() |
| 22 | +
|
| 23 | +.. currentmodule:: pyrogram |
| 24 | + |
| 25 | +- Message_ |
| 26 | +- CallbackQuery_ |
| 27 | +- InlineQuery_ |
| 28 | + |
| 29 | +.. _Message: |
| 30 | + |
| 31 | +Message |
| 32 | +------- |
| 33 | + |
| 34 | +- :meth:`Message.click()` |
| 35 | +- :meth:`Message.delete()` |
| 36 | +- :meth:`Message.download()` |
| 37 | +- :meth:`Message.edit()` |
| 38 | +- :meth:`Message.edit_caption()` |
| 39 | +- :meth:`Message.edit_media()` |
| 40 | +- :meth:`Message.edit_reply_markup()` |
| 41 | +- :meth:`Message.forward()` |
| 42 | +- :meth:`Message.pin()` |
| 43 | +- :meth:`Message.reply()` |
| 44 | +- :meth:`Message.reply_animation()` |
| 45 | +- :meth:`Message.reply_audio()` |
| 46 | +- :meth:`Message.reply_cached_media()` |
| 47 | +- :meth:`Message.reply_chat_action()` |
| 48 | +- :meth:`Message.reply_contact()` |
| 49 | +- :meth:`Message.reply_document()` |
| 50 | +- :meth:`Message.reply_game()` |
| 51 | +- :meth:`Message.reply_inline_bot_result()` |
| 52 | +- :meth:`Message.reply_location()` |
| 53 | +- :meth:`Message.reply_media_group()` |
| 54 | +- :meth:`Message.reply_photo()` |
| 55 | +- :meth:`Message.reply_poll()` |
| 56 | +- :meth:`Message.reply_sticker()` |
| 57 | +- :meth:`Message.reply_venue()` |
| 58 | +- :meth:`Message.reply_video()` |
| 59 | +- :meth:`Message.reply_video_note()` |
| 60 | +- :meth:`Message.reply_voice()` |
| 61 | + |
| 62 | +.. automethod:: Message.click() |
| 63 | +.. automethod:: Message.delete() |
| 64 | +.. automethod:: Message.download() |
| 65 | +.. automethod:: Message.edit() |
| 66 | +.. automethod:: Message.edit_caption() |
| 67 | +.. automethod:: Message.edit_media() |
| 68 | +.. automethod:: Message.edit_reply_markup() |
| 69 | +.. automethod:: Message.forward() |
| 70 | +.. automethod:: Message.pin() |
| 71 | +.. automethod:: Message.reply() |
| 72 | +.. automethod:: Message.reply_animation() |
| 73 | +.. automethod:: Message.reply_audio() |
| 74 | +.. automethod:: Message.reply_cached_media() |
| 75 | +.. automethod:: Message.reply_chat_action() |
| 76 | +.. automethod:: Message.reply_contact() |
| 77 | +.. automethod:: Message.reply_document() |
| 78 | +.. automethod:: Message.reply_game() |
| 79 | +.. automethod:: Message.reply_inline_bot_result() |
| 80 | +.. automethod:: Message.reply_location() |
| 81 | +.. automethod:: Message.reply_media_group() |
| 82 | +.. automethod:: Message.reply_photo() |
| 83 | +.. automethod:: Message.reply_poll() |
| 84 | +.. automethod:: Message.reply_sticker() |
| 85 | +.. automethod:: Message.reply_venue() |
| 86 | +.. automethod:: Message.reply_video() |
| 87 | +.. automethod:: Message.reply_video_note() |
| 88 | +.. automethod:: Message.reply_voice() |
| 89 | + |
| 90 | +.. _CallbackQuery: |
| 91 | + |
| 92 | +CallbackQuery |
| 93 | +------------- |
| 94 | + |
| 95 | +.. automethod:: CallbackQuery.answer() |
| 96 | + |
| 97 | +.. _InlineQuery: |
| 98 | + |
| 99 | +InlineQuery |
| 100 | +----------- |
| 101 | + |
| 102 | +.. automethod:: InlineQuery.answer() |
0 commit comments