This page is about Pyrogram methods. All the methods listed here are bound to a Client instance,
except for idle() and compose(), which are special functions that can be found in
the main package directly.
from pyrogram import Client app = Client("my_account") with app: app.send_message(chat_id="me", text="hi")
Utilities#
Messages#
Send text messages. |
|
Forward messages of any kind. |
|
Copy messages of any kind. |
|
Send photos. |
|
Send audio files. |
|
Send generic files. |
|
Send video files. |
|
Send animation files (animation or H.264/MPEG-4 AVC video without sound). |
|
Send audio files. |
|
Send video messages. |
|
Send any media stored on the Telegram servers using a file_id. |
|
Use this method to send paid media. |
|
Use this method to send a group of photos, videos, documents or audios as an album. |
|
Get the media group a message belongs to. |
|
Copy a media group by providing one of the message ids. |
|
Send points on the map. |
|
Send information about a venue. |
|
Send phone contacts. |
|
Send a new poll. |
|
Send a dice with a random value from 1 to 6. |
|
Use this method when you need to tell the user that something is happening on the bot's side. |
|
Adds the paid message reaction to a message. |
|
Use this method to change the chosen reactions on a message. |
|
Download the media from a message. |
|
Stream the media from a message chunk by chunk. |
|
Edit the text of messages. |
|
Edit the text of inline messages. |
|
Edit the caption of media messages. |
|
Edit the caption of inline media messages. |
|
Edit animation, audio, document, photo or video messages, or to add media to text messages. |
|
Edit inline animation, audio, document, photo or video messages, or to add media to text messages. |
|
Edit only the reply markup of messages sent by the bot. |
|
Edit only the reply markup of inline messages sent via the bot (for inline bots). |
|
Edit a media stored on the Telegram servers using a file_id. |
|
Stop a poll which was sent by you. |
|
Delete messages, including service messages, with the following limitations: |
|
Returns sponsored messages to be shown in a chat; for channel chats only. |
|
Get messages from a chat history. |
|
Get the total count of messages in a chat. |
|
Mark a chat's message history as read. |
|
Get one or more messages from a chat by using message identifiers. |
|
Returns information about a newest pinned message in the chat. |
|
Returns information about a message with the callback button that originated a callback query. |
|
Returns information about a non-bundled message that is replied by a given message. |
|
Informs the server that messages are being viewed by the current user. |
|
Get the first discussion message of a channel post or a discussion thread in a group. |
|
Get the message replies of a discussion thread. |
|
Get the total count of replies in a discussion thread. |
|
Search messages globally from all of your chats. |
|
Get the count of messages resulting from a global search. |
|
Search for text and media messages inside a specific chat. |
|
Get the count of messages resulting from a search inside a chat. |
|
Searches for public channel posts containing the given hashtag or cashtag. |
|
Get the count of messages with the provided hashtag or cashtag. |
|
Vote a poll. |
|
Retract your vote in a poll. |
|
Translates a text to the given language. |
|
Extracts text or caption of the given message and translates it to the given language. |
|
Deletes all messages in the chat. |
|
Notify the other user in a chat that screenshot of the chat was taken. |
|
Send a new checklist. |
|
Use this method to edit a checklist. |
|
Add tasks of a checklist in a message as done or not done. |
Chats#
Invite Links#
Chat Forum Topics#
Use this method to get custom emoji stickers, which can be used as a forum topic icon by any user. |
|
Use this method to create a topic in a forum supergroup chat or a private chat with a user. |
|
Use this method to edit name and icon of a topic in a forum supergroup chat or a private chat with a user. |
|
Use this method to close an open topic in a forum supergroup chat. |
|
Use this method to reopen a closed topic in a forum supergroup chat. |
|
Use this method to delete a forum topic along with all its messages in a forum supergroup chat or a private chat with a user. |
|
Use this method to hide a topic in a forum supergroup chat. |
|
Use this method to unhide a topic in a forum supergroup chat. |
|
Get one or more topic from a chat. |
|
Get one or more topic from a chat by using topic identifiers. |
|
Changes the pinned state of a forum topic; requires can_manage_topics right in the supergroup. |
Users#
Contacts#
Password#
Bots#
Stickers#
Stories#
Checks whether the current user can post a story on behalf of a chat. |
|
Get one or more stories from a chat by using stories identifiers. |
|
Get all non expired stories from a chat by using chat identifier. |
|
Get all archived stories from a chat by using chat identifier. |
|
Posts a new story on behalf of a chat. |
|
Changes content, privacy settings and caption of a story. |
|
Edits a story previously posted by the bot on behalf of a managed business account. |
|
Deletes a previously sent story. |
|
Deletes a story previously posted by the bot on behalf of a managed business account. |
|
Activates stealth mode for stories, which hides all views of stories from the current user in the last "stories_stealth_past_period" seconds and for the next "stories_stealth_future_period" seconds; for Telegram Premium users only. |
|
Forward story. |
|
Toggles whether a story is accessible after expiration. |
Payments#
Phone#
Advanced#
Methods used only when dealing with the raw Telegram API. Learn more about how to use the raw API at Advanced Usage.
Invoke raw Telegram functions. |
|
Get the InputPeer of a known peer id. |
|
Upload a file onto Telegram servers, without actually sending the message to anyone. |