2019-05-10 14:14:10 +00:00
|
|
|
Available Methods
|
|
|
|
=================
|
2019-05-09 02:28:46 +00:00
|
|
|
|
2019-06-27 21:16:21 +00:00
|
|
|
This page is about Pyrogram methods. All the methods listed here are bound to a :class:`~pyrogram.Client` instance.
|
2019-05-09 02:28:46 +00:00
|
|
|
|
|
|
|
.. code-block:: python
|
2019-05-16 19:28:34 +00:00
|
|
|
:emphasize-lines: 6
|
2019-05-09 02:28:46 +00:00
|
|
|
|
|
|
|
from pyrogram import Client
|
|
|
|
|
2019-05-16 19:28:34 +00:00
|
|
|
app = Client("my_account")
|
2019-05-09 02:28:46 +00:00
|
|
|
|
|
|
|
with app:
|
|
|
|
app.send_message("haskell", "hi")
|
|
|
|
|
2019-05-28 14:41:55 +00:00
|
|
|
.. currentmodule:: pyrogram
|
|
|
|
|
|
|
|
Index
|
|
|
|
-----
|
2019-05-09 02:28:46 +00:00
|
|
|
|
|
|
|
Utilities
|
2019-05-28 14:41:55 +00:00
|
|
|
^^^^^^^^^
|
|
|
|
|
|
|
|
.. hlist::
|
|
|
|
:columns: 4
|
|
|
|
|
|
|
|
- :meth:`~Client.start`
|
|
|
|
- :meth:`~Client.stop`
|
|
|
|
- :meth:`~Client.restart`
|
|
|
|
- :meth:`~Client.idle`
|
|
|
|
- :meth:`~Client.run`
|
|
|
|
- :meth:`~Client.add_handler`
|
|
|
|
- :meth:`~Client.remove_handler`
|
|
|
|
- :meth:`~Client.stop_transmission`
|
2019-06-19 14:11:25 +00:00
|
|
|
- :meth:`~Client.export_session_string`
|
2019-05-09 02:28:46 +00:00
|
|
|
|
|
|
|
Messages
|
2019-05-28 14:41:55 +00:00
|
|
|
^^^^^^^^
|
|
|
|
|
|
|
|
.. hlist::
|
|
|
|
:columns: 3
|
|
|
|
|
|
|
|
- :meth:`~Client.send_message`
|
|
|
|
- :meth:`~Client.forward_messages`
|
|
|
|
- :meth:`~Client.send_photo`
|
|
|
|
- :meth:`~Client.send_audio`
|
|
|
|
- :meth:`~Client.send_document`
|
|
|
|
- :meth:`~Client.send_sticker`
|
2019-06-01 13:25:42 +00:00
|
|
|
- :meth:`~Client.send_animated_sticker`
|
2019-05-28 14:41:55 +00:00
|
|
|
- :meth:`~Client.send_video`
|
|
|
|
- :meth:`~Client.send_animation`
|
|
|
|
- :meth:`~Client.send_voice`
|
|
|
|
- :meth:`~Client.send_video_note`
|
|
|
|
- :meth:`~Client.send_media_group`
|
|
|
|
- :meth:`~Client.send_location`
|
|
|
|
- :meth:`~Client.send_venue`
|
|
|
|
- :meth:`~Client.send_contact`
|
|
|
|
- :meth:`~Client.send_cached_media`
|
|
|
|
- :meth:`~Client.edit_message_text`
|
|
|
|
- :meth:`~Client.edit_message_caption`
|
|
|
|
- :meth:`~Client.edit_message_media`
|
2019-06-14 02:52:05 +00:00
|
|
|
- :meth:`~Client.edit_message_reply_markup`
|
|
|
|
- :meth:`~Client.edit_inline_text`
|
|
|
|
- :meth:`~Client.edit_inline_caption`
|
|
|
|
- :meth:`~Client.edit_inline_media`
|
|
|
|
- :meth:`~Client.edit_inline_reply_markup`
|
|
|
|
- :meth:`~Client.send_chat_action`
|
2019-05-28 14:41:55 +00:00
|
|
|
- :meth:`~Client.delete_messages`
|
|
|
|
- :meth:`~Client.get_messages`
|
|
|
|
- :meth:`~Client.get_history`
|
|
|
|
- :meth:`~Client.get_history_count`
|
2019-06-04 17:16:30 +00:00
|
|
|
- :meth:`~Client.read_history`
|
2019-05-28 14:41:55 +00:00
|
|
|
- :meth:`~Client.iter_history`
|
|
|
|
- :meth:`~Client.send_poll`
|
|
|
|
- :meth:`~Client.vote_poll`
|
|
|
|
- :meth:`~Client.stop_poll`
|
|
|
|
- :meth:`~Client.retract_vote`
|
|
|
|
- :meth:`~Client.download_media`
|
2019-05-09 02:28:46 +00:00
|
|
|
|
|
|
|
Chats
|
2019-05-28 14:41:55 +00:00
|
|
|
^^^^^
|
|
|
|
|
|
|
|
.. hlist::
|
|
|
|
:columns: 3
|
|
|
|
|
|
|
|
- :meth:`~Client.join_chat`
|
|
|
|
- :meth:`~Client.leave_chat`
|
|
|
|
- :meth:`~Client.kick_chat_member`
|
|
|
|
- :meth:`~Client.unban_chat_member`
|
|
|
|
- :meth:`~Client.restrict_chat_member`
|
|
|
|
- :meth:`~Client.promote_chat_member`
|
|
|
|
- :meth:`~Client.export_chat_invite_link`
|
|
|
|
- :meth:`~Client.set_chat_photo`
|
|
|
|
- :meth:`~Client.delete_chat_photo`
|
|
|
|
- :meth:`~Client.set_chat_title`
|
|
|
|
- :meth:`~Client.set_chat_description`
|
|
|
|
- :meth:`~Client.pin_chat_message`
|
|
|
|
- :meth:`~Client.unpin_chat_message`
|
|
|
|
- :meth:`~Client.get_chat`
|
|
|
|
- :meth:`~Client.get_chat_member`
|
|
|
|
- :meth:`~Client.get_chat_members`
|
|
|
|
- :meth:`~Client.get_chat_members_count`
|
|
|
|
- :meth:`~Client.iter_chat_members`
|
|
|
|
- :meth:`~Client.get_dialogs`
|
|
|
|
- :meth:`~Client.iter_dialogs`
|
|
|
|
- :meth:`~Client.get_dialogs_count`
|
|
|
|
- :meth:`~Client.restrict_chat`
|
|
|
|
- :meth:`~Client.update_chat_username`
|
2019-06-08 17:15:19 +00:00
|
|
|
- :meth:`~Client.archive_chats`
|
|
|
|
- :meth:`~Client.unarchive_chats`
|
2019-05-09 02:28:46 +00:00
|
|
|
|
|
|
|
Users
|
2019-05-28 14:41:55 +00:00
|
|
|
^^^^^
|
2019-05-09 02:28:46 +00:00
|
|
|
|
2019-05-28 14:41:55 +00:00
|
|
|
.. hlist::
|
2019-05-29 08:40:48 +00:00
|
|
|
:columns: 3
|
2019-05-09 02:28:46 +00:00
|
|
|
|
2019-05-28 14:41:55 +00:00
|
|
|
- :meth:`~Client.get_me`
|
|
|
|
- :meth:`~Client.get_users`
|
2019-05-30 22:20:09 +00:00
|
|
|
- :meth:`~Client.get_profile_photos`
|
|
|
|
- :meth:`~Client.get_profile_photos_count`
|
|
|
|
- :meth:`~Client.iter_profile_photos`
|
|
|
|
- :meth:`~Client.set_profile_photo`
|
|
|
|
- :meth:`~Client.delete_profile_photos`
|
2019-05-28 14:41:55 +00:00
|
|
|
- :meth:`~Client.update_username`
|
|
|
|
- :meth:`~Client.get_user_dc`
|
2019-06-28 14:29:16 +00:00
|
|
|
- :meth:`~Client.block_user`
|
|
|
|
- :meth:`~Client.unblock_user`
|
2019-05-09 02:28:46 +00:00
|
|
|
|
|
|
|
Contacts
|
2019-05-28 14:41:55 +00:00
|
|
|
^^^^^^^^
|
2019-05-09 02:28:46 +00:00
|
|
|
|
2019-05-28 14:41:55 +00:00
|
|
|
.. hlist::
|
|
|
|
:columns: 3
|
2019-05-09 02:28:46 +00:00
|
|
|
|
2019-05-28 14:41:55 +00:00
|
|
|
- :meth:`~Client.add_contacts`
|
|
|
|
- :meth:`~Client.get_contacts`
|
|
|
|
- :meth:`~Client.get_contacts_count`
|
|
|
|
- :meth:`~Client.delete_contacts`
|
2019-05-09 02:28:46 +00:00
|
|
|
|
|
|
|
Password
|
2019-05-28 14:41:55 +00:00
|
|
|
^^^^^^^^
|
2019-05-09 02:28:46 +00:00
|
|
|
|
2019-05-28 14:41:55 +00:00
|
|
|
.. hlist::
|
|
|
|
:columns: 3
|
2019-05-09 02:28:46 +00:00
|
|
|
|
2019-05-28 14:41:55 +00:00
|
|
|
- :meth:`~Client.enable_cloud_password`
|
|
|
|
- :meth:`~Client.change_cloud_password`
|
|
|
|
- :meth:`~Client.remove_cloud_password`
|
2019-05-09 02:28:46 +00:00
|
|
|
|
|
|
|
Bots
|
2019-05-28 14:41:55 +00:00
|
|
|
^^^^
|
2019-05-09 02:28:46 +00:00
|
|
|
|
2019-05-28 14:41:55 +00:00
|
|
|
.. hlist::
|
|
|
|
:columns: 3
|
2019-05-09 02:28:46 +00:00
|
|
|
|
2019-05-28 14:41:55 +00:00
|
|
|
- :meth:`~Client.get_inline_bot_results`
|
|
|
|
- :meth:`~Client.send_inline_bot_result`
|
|
|
|
- :meth:`~Client.answer_callback_query`
|
|
|
|
- :meth:`~Client.answer_inline_query`
|
|
|
|
- :meth:`~Client.request_callback_answer`
|
|
|
|
- :meth:`~Client.send_game`
|
|
|
|
- :meth:`~Client.set_game_score`
|
|
|
|
- :meth:`~Client.get_game_high_scores`
|
|
|
|
|
2019-06-11 13:59:15 +00:00
|
|
|
Advanced Usage (Raw API)
|
|
|
|
^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
2019-06-12 10:42:39 +00:00
|
|
|
Learn more about these methods at :doc:`Advanced Usage <../topics/advanced-usage>`.
|
|
|
|
|
2019-06-11 13:59:15 +00:00
|
|
|
.. hlist::
|
|
|
|
:columns: 4
|
|
|
|
|
|
|
|
- :meth:`~Client.send`
|
|
|
|
- :meth:`~Client.resolve_peer`
|
|
|
|
- :meth:`~Client.save_file`
|
|
|
|
|
2019-05-28 14:41:55 +00:00
|
|
|
-----
|
|
|
|
|
|
|
|
Details
|
|
|
|
-------
|
2019-05-09 02:28:46 +00:00
|
|
|
|
|
|
|
.. Utilities
|
2019-05-28 14:41:55 +00:00
|
|
|
.. automethod:: Client.start()
|
|
|
|
.. automethod:: Client.stop()
|
|
|
|
.. automethod:: Client.restart()
|
|
|
|
.. automethod:: Client.idle()
|
|
|
|
.. automethod:: Client.run()
|
|
|
|
.. automethod:: Client.add_handler()
|
|
|
|
.. automethod:: Client.remove_handler()
|
|
|
|
.. automethod:: Client.stop_transmission()
|
2019-06-19 14:11:25 +00:00
|
|
|
.. automethod:: Client.export_session_string()
|
2019-05-09 02:28:46 +00:00
|
|
|
|
|
|
|
.. Messages
|
2019-05-28 14:41:55 +00:00
|
|
|
.. automethod:: Client.send_message()
|
|
|
|
.. automethod:: Client.forward_messages()
|
|
|
|
.. automethod:: Client.send_photo()
|
|
|
|
.. automethod:: Client.send_audio()
|
|
|
|
.. automethod:: Client.send_document()
|
|
|
|
.. automethod:: Client.send_sticker()
|
2019-06-01 13:25:42 +00:00
|
|
|
.. automethod:: Client.send_animated_sticker()
|
2019-05-28 14:41:55 +00:00
|
|
|
.. automethod:: Client.send_video()
|
|
|
|
.. automethod:: Client.send_animation()
|
|
|
|
.. automethod:: Client.send_voice()
|
|
|
|
.. automethod:: Client.send_video_note()
|
|
|
|
.. automethod:: Client.send_media_group()
|
|
|
|
.. automethod:: Client.send_location()
|
|
|
|
.. automethod:: Client.send_venue()
|
|
|
|
.. automethod:: Client.send_contact()
|
|
|
|
.. automethod:: Client.send_cached_media()
|
|
|
|
.. automethod:: Client.send_chat_action()
|
|
|
|
.. automethod:: Client.edit_message_text()
|
|
|
|
.. automethod:: Client.edit_message_caption()
|
|
|
|
.. automethod:: Client.edit_message_media()
|
2019-06-14 02:52:05 +00:00
|
|
|
.. automethod:: Client.edit_message_reply_markup()
|
|
|
|
.. automethod:: Client.edit_inline_text()
|
|
|
|
.. automethod:: Client.edit_inline_caption()
|
|
|
|
.. automethod:: Client.edit_inline_media()
|
|
|
|
.. automethod:: Client.edit_inline_reply_markup()
|
2019-05-28 14:41:55 +00:00
|
|
|
.. automethod:: Client.delete_messages()
|
|
|
|
.. automethod:: Client.get_messages()
|
|
|
|
.. automethod:: Client.get_history()
|
|
|
|
.. automethod:: Client.get_history_count()
|
2019-06-04 17:16:30 +00:00
|
|
|
.. automethod:: Client.read_history()
|
2019-05-28 14:41:55 +00:00
|
|
|
.. automethod:: Client.iter_history()
|
|
|
|
.. automethod:: Client.send_poll()
|
|
|
|
.. automethod:: Client.vote_poll()
|
|
|
|
.. automethod:: Client.stop_poll()
|
|
|
|
.. automethod:: Client.retract_vote()
|
|
|
|
.. automethod:: Client.download_media()
|
2019-05-09 02:28:46 +00:00
|
|
|
|
|
|
|
.. Chats
|
2019-05-28 14:41:55 +00:00
|
|
|
.. automethod:: Client.join_chat()
|
|
|
|
.. automethod:: Client.leave_chat()
|
|
|
|
.. automethod:: Client.kick_chat_member()
|
|
|
|
.. automethod:: Client.unban_chat_member()
|
|
|
|
.. automethod:: Client.restrict_chat_member()
|
|
|
|
.. automethod:: Client.promote_chat_member()
|
|
|
|
.. automethod:: Client.export_chat_invite_link()
|
|
|
|
.. automethod:: Client.set_chat_photo()
|
|
|
|
.. automethod:: Client.delete_chat_photo()
|
|
|
|
.. automethod:: Client.set_chat_title()
|
|
|
|
.. automethod:: Client.set_chat_description()
|
|
|
|
.. automethod:: Client.pin_chat_message()
|
|
|
|
.. automethod:: Client.unpin_chat_message()
|
|
|
|
.. automethod:: Client.get_chat()
|
|
|
|
.. automethod:: Client.get_chat_member()
|
|
|
|
.. automethod:: Client.get_chat_members()
|
|
|
|
.. automethod:: Client.get_chat_members_count()
|
|
|
|
.. automethod:: Client.iter_chat_members()
|
|
|
|
.. automethod:: Client.get_dialogs()
|
|
|
|
.. automethod:: Client.iter_dialogs()
|
|
|
|
.. automethod:: Client.get_dialogs_count()
|
|
|
|
.. automethod:: Client.restrict_chat()
|
|
|
|
.. automethod:: Client.update_chat_username()
|
2019-06-08 17:15:19 +00:00
|
|
|
.. automethod:: Client.archive_chats()
|
|
|
|
.. automethod:: Client.unarchive_chats()
|
2019-05-09 02:28:46 +00:00
|
|
|
|
|
|
|
.. Users
|
2019-05-28 14:41:55 +00:00
|
|
|
.. automethod:: Client.get_me()
|
|
|
|
.. automethod:: Client.get_users()
|
2019-05-30 22:20:09 +00:00
|
|
|
.. automethod:: Client.get_profile_photos()
|
|
|
|
.. automethod:: Client.get_profile_photos_count()
|
|
|
|
.. automethod:: Client.iter_profile_photos()
|
|
|
|
.. automethod:: Client.set_profile_photo()
|
|
|
|
.. automethod:: Client.delete_profile_photos()
|
2019-05-28 14:41:55 +00:00
|
|
|
.. automethod:: Client.update_username()
|
|
|
|
.. automethod:: Client.get_user_dc()
|
2019-06-28 14:29:16 +00:00
|
|
|
.. automethod:: Client.block_user()
|
|
|
|
.. automethod:: Client.unblock_user()
|
2019-05-09 02:28:46 +00:00
|
|
|
|
|
|
|
.. Contacts
|
2019-05-28 14:41:55 +00:00
|
|
|
.. automethod:: Client.add_contacts()
|
|
|
|
.. automethod:: Client.get_contacts()
|
|
|
|
.. automethod:: Client.get_contacts_count()
|
|
|
|
.. automethod:: Client.delete_contacts()
|
2019-05-09 02:28:46 +00:00
|
|
|
|
|
|
|
.. Password
|
2019-05-28 14:41:55 +00:00
|
|
|
.. automethod:: Client.enable_cloud_password()
|
|
|
|
.. automethod:: Client.change_cloud_password()
|
|
|
|
.. automethod:: Client.remove_cloud_password()
|
2019-05-09 02:28:46 +00:00
|
|
|
|
|
|
|
.. Bots
|
2019-05-28 14:41:55 +00:00
|
|
|
.. automethod:: Client.get_inline_bot_results()
|
|
|
|
.. automethod:: Client.send_inline_bot_result()
|
|
|
|
.. automethod:: Client.answer_callback_query()
|
|
|
|
.. automethod:: Client.answer_inline_query()
|
|
|
|
.. automethod:: Client.request_callback_answer()
|
|
|
|
.. automethod:: Client.send_game()
|
|
|
|
.. automethod:: Client.set_game_score()
|
|
|
|
.. automethod:: Client.get_game_high_scores()
|
2019-06-11 13:59:15 +00:00
|
|
|
|
|
|
|
.. Advanced Usage
|
|
|
|
.. automethod:: Client.send()
|
|
|
|
.. automethod:: Client.resolve_peer()
|
|
|
|
.. automethod:: Client.save_file()
|