Available Methods¶
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("me", "hi")
Listeners¶
Send a message and wait for the answer to it. |
|
Wait for the next update matching the given criteria. |
|
Run a callback once, on the next update matching the given criteria. |
|
Stop the listeners covered by the given criteria. |
|
Wait for the next callback query in a chat. |
|
Wait for the next message in a chat. |
Utilities¶
Register an update handler. |
|
Export the current authorized session as a serialized string. |
|
Measure the round-trip network latency to the connected Telegram data center. |
|
Remove a previously-registered update handler. |
|
Restart the Client. |
|
Start the client, idle the main script and finally stop the client. |
|
Set the parse mode to be used globally by the client. |
|
Start the client. |
|
Stop the Client. |
|
Stop downloading or uploading a file. |
Help¶
Dismiss a suggestion. |
|
Edit internal user info (for TSF members). |
|
Get app-specific configuration. |
|
Check for app updates. |
|
Get CDN configuration. |
|
Get the list of supported countries. |
|
Get info about an unsupported deep link. |
|
Get the default invitation text for inviting new users to Telegram. |
|
Get the nearest data center based on client's IP. |
|
Get Telegram Passport configuration. |
|
Get the set of name/message colors supported by the server. |
|
Get the set of profile colors supported by the server. |
|
Get Telegram Premium promotion information. |
|
Get MTProxy/Public Service Announcement promotional information. |
|
Get recent t.me URLs. |
|
Get Telegram support user. |
|
Get localized name of the Telegram support user. |
|
Check for updates of terms of service. |
|
Get the list of supported timezones. |
|
Get internal user info (can only be used by TSF members). |
|
Hide MTProxy/Public Service Announcement information. |
|
Saves logs of application on the server. |
|
Informs the server about the number of pending bot updates if they haven't been processed for a long time (bots only). |
Language Pack¶
Get new strings in language pack. |
|
Get localization pack strings. |
|
Get information about a language in a localization pack. |
|
Get information about all languages in a localization pack. |
|
Get strings from a language pack. |
Block the main script execution until a signal is received. |
|
Run multiple clients at once. |
Account¶
Accept a Telegram Passport authorization request and send requested values. |
|
Adds an audio file to the beginning of the profile audio files of the current user. |
|
Cancel the code that was sent to verify an email to use as 2FA recovery method. |
|
Change settings related to a session. |
|
Clear list of recently used emoji statuses. |
|
Confirm a bot connection. |
|
Verify an email to use as 2FA recovery method. |
|
Confirm a phone number to cancel account deletion. |
|
Create a theme. |
|
Abort a pending 2FA password reset. |
|
Delete the user's account from the telegram servers. |
|
Clear all peer-specific autosave settings. |
|
Delete a passkey associated to the current account. |
|
Delete stored Telegram Passport documents. |
|
Delete all web browser settings exceptions. |
|
Permanently disconnect a specific chat from all business bots. |
|
Edit a created business chat deep link. |
|
Get days to live of account. |
|
Get all stored Telegram Passport documents. |
|
Returns a Telegram Passport authorization form for sharing data with a service. |
|
Get media autodownload settings. |
|
Get autosave settings. |
|
Get a list of default suggested channel emoji statuses. |
|
Fetch the full list of custom emoji IDs that cannot be used in channel emoji statuses. |
|
Get all available chat themes. |
|
Obtain a list of emoji statuses for owned or hosted collectible gifts. |
|
Whether the user will receive notifications when contacts sign up. |
|
Get sensitive content settings. |
|
Get suggested custom emoji stickers that can be used in an accent color pattern. |
|
Get suggested custom emoji stickers that can be used as group picture. |
|
Get suggested custom emoji stickers that can be used as profile picture. |
|
Get account global privacy settings. |
|
Get info about multiple wallpapers. |
|
Returns list of chats with non-default notification settings. |
|
Gets current notification settings for a given user/group, or all users/all groups. |
|
Get the number of stars received from the specified user via paid messages. |
|
List the passkeys associated to the current account that can be used to log in. |
|
Get private info associated to the password info (recovery email, telegram passport info, etc.). |
|
Get account privacy rules. |
|
Get the current reaction notification settings. |
|
Get recently used emoji statuses. |
|
Fetch the full list of only the IDs of songs currently added to the profile. |
|
Fetch saved notification sounds. |
|
Get saved Telegram Passport documents. |
|
Get theme information. |
|
Get installed themes. |
|
Get temporary payment password. |
|
Obtain all chat themes associated to owned or hosted collectible gifts. |
|
Get info about a certain wallpaper. |
|
Returns a list of available wallpapers. |
|
Get web login widget authorizations. |
|
Get in-app web browser settings. |
|
Initialize passkey registration for the current account. |
|
Install a theme. |
|
Install wallpaper. |
|
Invalidate the specified login codes. |
|
Register device to receive PUSH notifications. |
|
Complete passkey registration for the current account. |
|
Removes an audio file from the profile audio files of the current user. |
|
Reorder usernames associated with the currently logged-in user. |
|
Resend the code to verify an email to use as 2FA recovery method. |
|
Resets all notification settings from users and groups. |
|
Initiate a 2FA password reset: can only be used if the user is already logged-in. |
|
Delete all installed wallpapers, reverting to the default wallpaper set. |
|
Log out an active web telegram login session. |
|
Reset all active web telegram login sessions. |
|
Change media autodownload settings. |
|
Modify autosave settings. |
|
Save or remove a saved notification sound. |
|
Securely save a Telegram Passport document. |
|
Save or unsave a theme. |
|
Install or uninstall wallpaper. |
|
Send confirmation code to cancel account deletion. |
|
Set days to live of account. |
|
Toggle contact sign up notifications. |
|
Set sensitive content settings (for viewing or hiding NSFW content). |
|
Set account global privacy settings. |
|
Changes the period of inactivity after which sessions will automatically be terminated. |
|
Set account privacy rules. |
|
Changes position of an audio file in the profile audio files of the current user. |
|
Change the reaction notification settings. |
|
Pause or unpause a specific chat, temporarily disconnecting it from all business bots. |
|
Allow a user to send messages without paying if paid messages are enabled. |
|
Disable or re-enable Telegram ads for the current Premium account. |
|
Activate or deactivate a collectible username associated to the currently logged-in user. |
|
Toggle web browser settings exception for a specific URL. |
|
Deletes a device by its token, stops sending PUSH notifications to it. |
|
Connect a business bot to the current account, or change connection settings. |
|
When passcode lock is enabled, hides message texts in incoming PUSH notifications after inactivity period. |
|
Update a theme. |
|
Update in-app web browser settings. |
|
Upload a notification sound. |
|
Upload a theme file with platform-specific colors. |
|
Create and upload a new wallpaper. |
|
Verify a phone number for Telegram Passport. |
Messages¶
Add tasks to a checklist in a message. |
|
Adds an option to a poll. |
|
Add a GIF to the list of saved GIFs. |
|
Use this method to approve a suggested post in a direct messages chat. |
|
Check whether a quick reply shortcut name is valid and available. |
|
Check the current flood status and quota for searching public channel posts. |
|
Clear all message drafts. |
|
Clear recently used reactions. |
|
Report a sponsored message as clicked. |
|
Changes text using an AI model. |
|
Copy a media group by providing one of the message ids. |
|
Copy messages of any kind. |
|
Copy messages of any kind in bulk without a forward link. |
|
Use this method to decline a suggested post in a direct messages chat. |
|
Delete the history of a chat. |
|
Delete messages in the topic in a channel direct messages chat administered by the current user. |
|
Delete the fact-check on a message (channel admins only). |
|
Delete messages, including service messages. |
|
Remove all reactions of a specific participant from a single message. |
|
Remove all reactions of a specific participant from every message in a group or channel. |
|
Deletes an option from a poll. |
|
Delete specific messages from a quick reply shortcut. |
|
Delete an entire quick reply shortcut. |
|
Delete scheduled messages. |
|
Download the media from a message. |
|
Edit the fact-check on a message (channel admins only). |
|
Edit the caption of inline media messages. |
|
Edit inline animation, audio, document, photo or video messages. |
|
Edit only the reply markup of inline messages sent via the bot (for inline bots). |
|
Edit the text of inline messages. |
|
Edit the caption of media messages. |
|
Use this method to edit a checklist. |
|
Edit a live location message. |
|
Edit animation, audio, document, photo or video messages. |
|
Edit only the reply markup of messages sent by the bot. |
|
Edit the text of a message. |
|
Edit the name of a quick reply shortcut. |
|
Adds emojis to text using an AI model. |
|
Export an HTTP link to a message in a channel or supergroup. |
|
Fixes text using an AI model. |
|
Forward a media group by providing one of the message ids. |
|
Forward messages of any kind. |
|
Get all saved message drafts. |
|
Get all installed sticker sets. |
|
Get archived sticker sets. |
|
Get all available effects. |
|
Get the reactions available on Telegram. |
|
Get messages from a chat history. |
|
Get the total count of messages in a chat. |
|
Get the default Time-To-Live for messages. |
|
Get default reaction tags for saved messages. |
|
Return messages in the topic in a channel direct messages chat administered 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. |
|
Get custom emoji sticker sets. |
|
Get information about custom emoji stickers by their identifiers. |
|
Get featured/trending custom emoji sticker sets. |
|
Get featured/trending sticker sets. |
|
Get sticker set by short name. |
|
Returns information needed to open the main Web App of a bot. |
|
Get all installed mask sticker sets. |
|
Get the media group a message belongs to. |
|
Get the author of a message in a channel or supergroup. |
|
Get reactions added to a specific message. |
|
Get the list of participants who read a specific message in a chat. |
|
Get one or more messages from a chat by using message identifiers. |
|
Get detailed reactions for a list of messages. |
|
Get default privacy setting for paid reactions (anonymous vs public). |
|
Get the current results of a poll. |
|
Get statistics for a poll sent in a message. |
|
Get a prepared inline message by ID. |
|
Get all quick reply shortcuts created by the user. |
|
Get messages contained in a quick reply shortcut. |
|
Get recently used message reactions. |
|
Get the full rich message of a message that arrived truncated. |
|
Get saved GIFs. |
|
Get saved messages history for a specific peer. |
|
Get reaction tags assigned to saved messages. |
|
Get one or more scheduled messages from a chat. |
|
Get a calendar view of search results. |
|
Get positions of search results within a chat history. |
|
Get sponsored messages for a channel. |
|
Get top reactions used on Telegram. |
|
Get messages with unread reactions in a chat. |
|
Get the gifts owned by a user. |
|
Use this method to get the last messages from the personal chat (i.e., the chat currently added to their profile) of a given user. |
|
Get the list of profile audios (voice/audio messages) for a user. |
|
Returns an HTTPS URL of a Web App to open. |
|
Returns an HTTPS URL of a Web App to open from the side menu, a |
|
Get information about a web page via URL. |
|
Get a web page preview from a message containing a URL. |
|
Gift a Telegram Premium subscription to a user. |
|
Hide the peer settings bar (the "Add to contacts" / "Block" bar) for a user. |
|
Add tasks of a checklist in a message as done or not done. |
|
Informs pyrogram that a Web App is being opened from the attachment menu, a |
|
Mark a chat's message history as read. |
|
Mark audio/video message contents as listened or watched in a channel or supergroup. |
|
Mark featured sticker sets as read. |
|
Mark a mention in the chat as read. |
|
Mark a reaction in the chat as read. |
|
Mark saved messages history as read up to a given message ID. |
|
Reorder pinned dialogs. |
|
Reorder quick reply shortcuts. |
|
Reorder installed sticker sets. |
|
Rephrases text using an AI model tone. |
|
Report specific messages in a chat for rule violations. |
|
Report an abusive or inappropriate reaction on a message. |
|
Report a sponsored message. |
|
Retract your vote in a poll. |
|
Save a message draft. |
|
Store a message that can be sent by a user of a Mini App. |
|
Store a keyboard button that can be used by a user within a Mini App. |
|
Save or remove a sticker from recently used stickers. |
|
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. |
|
Search public posts by hashtag or by text. |
|
Get the number of public posts matching a hashtag or a text search. |
|
Send animation files (animation or H.264/MPEG-4 AVC video without sound). |
|
Send audio files. |
|
Send any media stored on the Telegram servers using a file_id. |
|
Tell the other party that something is happening on your side. |
|
Send a checklist (todo list). |
|
Send phone contacts. |
|
Send a dice with a random value from 1 to 6. |
|
Send generic files. |
|
Send a live photo, a still image paired with the short video it was taken with. |
|
Send points on the map. |
|
Send a group of photos or videos as an album. |
|
Send text messages. |
|
Send a text draft action, allowing bots to stream a partial message. |
|
Send a group or one paid photo/video. |
|
Send a paid reaction to a message, spending Telegram Stars. |
|
Send photos. |
|
Send a new poll. |
|
Send messages from a quick reply shortcut into a target chat. |
|
Send a reaction to a message. |
|
Send a rich formatted message. |
|
Send a rich message draft action, allowing bots to stream partial rich messages. |
|
Send scheduled messages immediately. |
|
Notify the other user that you took a screenshot. |
|
Send static .webp or animated .tgs stickers. |
|
Send information about a venue. |
|
Send video files. |
|
Send video note files. |
|
Send audio files. |
|
Set allowed reactions in a chat or channel. |
|
Set a theme for a chat. |
|
Set a wallpaper for a chat. |
|
Set the default Time-To-Live for messages. |
|
Set default quick reaction (e.g. for double-tap). |
|
Change the marked as unread state of the topic in a channel direct messages chat administered by the current user. |
|
Inform a user that some Telegram Passport elements they provided contain errors. |
|
Start a bot, optionally passing a deep linking parameter. |
|
Stop updating a live location message before its |
|
Stop a poll which was sent by you. |
|
Stream the media from a message chunk by chunk. |
|
Summarize text content using AI. |
|
Pin or unpin a dialog. |
|
Toggle whether your paid reaction on a specific message is anonymous. |
|
Toggle the translation bar for a peer. |
|
Pin or unpin a dialog in Saved Messages. |
|
Transcribe speech in a voice message or video note into text. |
|
Translate text or a message to another language. |
|
Update or rename the tag associated with a saved reaction. |
|
Increment the view counter of one or more messages. |
|
Mark a sponsored message as viewed. |
|
Vote a poll. |
|
Get sticker sets attached to a photo or video. |
|
Get dialogs marked as unread. |
|
Get a document by its SHA256 hash. |
|
Get emoji groups (categories) for the emoji panel. |
|
Get emoji keywords for a given language. |
|
Get emoji keywords difference (updates) for a given language. |
|
Get emoji keyword language codes that need to be fetched. |
|
Get emoji groups for the profile photo emoji panel. |
|
Get emoji groups for the custom emoji sticker panel. |
|
Get emoji groups for the emoji status panel. |
|
Get a CDN URL for downloading emoji keywords for a language. |
|
Request extended media for paid media messages. |
|
Get fact-check information for one or more messages. |
|
Check if a message can be edited and get the current edit data. |
|
Get the date when the recipient read an outgoing message. |
|
Get pinned saved dialogs (pinned chats in Saved Messages). |
|
Get votes in a poll. |
|
Get recently shared live locations in a chat. |
|
Get stickers associated with an emoticon. |
|
Get messages with unread mentions in a chat. |
|
Get unread poll votes in a chat. |
|
Rate the quality of a transcribed audio message. |
|
Mark a discussion (comment thread) as read. |
|
Mark the results of a poll as read. |
|
Reorder pinned dialogs in Saved Messages. |
|
Report successful delivery of messages (for analytics). |
|
Search for custom emoji by emoticon text. |
|
Search for custom emoji sticker sets. |
|
Search for media sent by the current user. |
|
Accept URL authorization (login via Telegram for a website). |
|
Check a URL auth match code. |
|
Decline URL authorization for a login button. |
|
Delete a basic group (legacy group chat). |
|
Delete the phone call history. |
|
Make or revoke admin status in a basic group. |
|
Get information about a bot that can be used in the attach menu. |
|
Get the list of bots available in the attach menu. |
|
Get information about a bot web app. |
|
Get Diffie-Hellman configuration for end-to-end encryption. |
|
Get information about the emoji game. |
|
Get the user who will become the creator of a chat after the current creator leaves. |
|
Get old featured/trending sticker sets (pagination). |
|
Get the ranges of locally stored messages that need to be fetched from the server. |
|
Get suggested chat folder (dialog filter) configurations. |
|
Upgrade a basic group to a supergroup. |
|
Prolong an open web app session to prevent it from expiring. |
|
Mark the content of messages as read (e.g., mark voice notes as listened). |
|
Confirm received messages up to a given max ID. |
|
Acknowledge received secret chat messages up to a given QTS. |
|
Report that the user listened to a music message (for analytics). |
|
Report read metrics for messages in a chat. |
|
Request joining a chat via a web view. |
|
Request URL authorization for a login button or link preview. |
|
Send a peer chosen by the user via a |
|
Send data from a web app button to a bot. |
|
Enable or disable a bot in the attach menu. |
|
Install, uninstall, archive or unarchive multiple sticker sets at once. |
|
Translate a rich message (with formatting) to another language. |
|
Accept an incoming end-to-end encrypted chat request. |
|
Check if a chat history export file can be imported. |
|
Check if a chat history can be imported into a specific chat. |
|
Discard/close a secret (end-to-end encrypted) chat. |
|
Initialize a chat history import. |
|
Mark the history of a secret chat as read up to a given date. |
|
Report a secret chat for spam. |
|
Request an end-to-end encrypted chat (secret chat) with a user. |
|
Send an encrypted message to a secret chat. |
|
Send an encrypted file to a secret chat. |
|
Send a service message to a secret chat. |
|
Send a typing action to a secret chat. |
|
Start a previously initialized history import. |
|
Upload an encrypted file to a secret chat. |
|
Upload a media file for a history import session. |
|
Use AI to compose, proofread, translate or emojify a rich text message. |
Ephemeral¶
Delete every welcome message a bot has stored for a chat. |
|
Delete an ephemeral message. |
|
Delete one of the welcome messages a bot has stored for a chat. |
|
Edit the caption of an ephemeral media message. |
|
Edit the media of an ephemeral message. |
|
Edit only the inline keyboard of an ephemeral message. |
|
Edit the text of an ephemeral message. |
|
Get callback answer from an ephemeral message inline button. |
|
Get the welcome messages a bot has stored for a chat. |
|
Report an ephemeral message. |
|
Send an ephemeral message visible only to a specific user and the bot in a group. |
AI Compose¶
Create a custom AI writing tone. |
|
Permanently delete a custom AI composer tone created by the current user. |
|
Get details about a specific AI writing tone. |
|
Get an example generated text for a specific AI writing tone. |
|
Get the list of available AI writing tones. |
|
Install or uninstall an AI composer tone, adding it to or removing it from the list of saved tones. |
|
Update an existing custom AI writing tone. |
Chats¶
Add new chat members to a group, supergroup or channel |
|
Archive one or more chats. |
|
Ban a user from a group, a supergroup or a channel. |
|
Ban a channel chat from sending messages in a supergroup or channel. |
|
Close a forum topic. |
|
Close a 'General' topic in a forum supergroup chat. |
|
Convert a supergroup to a gigagroup (broadcast group). |
|
Create a new broadcast channel. |
|
Create a new forum topic. |
|
Create a new basic group. |
|
Create a new supergroup. |
|
Deactivate all secondary collectible usernames of a channel or supergroup. |
|
Use this method to remove up to 10000 recent reactions in a group or a supergroup chat added by a given user or chat. |
|
Delete a channel. |
|
Delete a chat photo. |
|
Delete a group sticker set from a supergroup. |
|
Delete a forum topic. |
|
Use this method to remove a reaction from a message in a group or a supergroup chat. |
|
Delete a supergroup. |
|
Delete all messages sent by a certain user in a supergroup. |
|
Edit the location of a geogroup. |
|
Edit a forum topic. |
|
Edit the name of the 'General' topic in a forum supergroup chat. |
|
Get up to date information about a chat. |
|
Get the actions taken by chat members and administrators in the last 48h. |
|
Get information about one member of a chat. |
|
Get the members list of a chat. |
|
Get the number of members in a chat. |
|
Get the number of members that are currently online in a chat. |
|
Get information about a chat settings. |
|
Get a user's dialogs sequentially. |
|
Get the total count of your dialogs. |
|
Get one or more topic from a direct messages channel chat. |
|
Get one or more direct message topic from a chat by using topic identifiers. |
|
Get custom emoji stickers, which can be used as a forum topic icon by any user. |
|
Get one or more topic from a chat. |
|
Get one or more topic from a chat by using topic identifiers. |
|
Get the list of inactive channels and supergroups. |
|
Get a list of channels that the current user has left. |
|
Get nearby chats. |
|
Get all your public channels. |
|
Get the list of "send_as" chats available. |
|
Get similar channels. |
|
Return a list of basic group and supergroup chats, which can be used as a discussion group for a channel. |
|
Returns a list of frequently used chats. |
|
Hide the 'General' topic in a forum supergroup chat. |
|
Join a group chat or channel. |
|
Leave a group chat or channel. |
|
Mark a chat as unread. |
|
Pin a message in a group, channel or your own chat. |
|
Pin a forum topic to the top of the topic list. |
|
Promote or demote a user in a supergroup or a channel. |
|
Remove verification from a chat currently verified on behalf of the organization. |
|
Remove verification from a user currently verified on behalf of the organization. |
|
Reopen a closed forum topic. |
|
Reopen a closed 'General' topic in a forum supergroup chat. |
|
Reorder active collectible usernames of a channel or supergroup. |
|
Reorder pinned forum topics in a forum supergroup. |
|
Report a false positive action by Telegram's native automated anti-spam system in a supergroup. |
|
Report a chat (channel, supergroup, group, or user) for rule violations. |
|
Report a peer as spam and dismiss dialog. |
|
Restrict a user in a supergroup. |
|
Restrict sponsored messages in a channel. |
|
Set a custom title (rank) to an administrator of a supergroup. |
|
Set the required boost level to unblock chat restrictions or slowmode. |
|
Change the accent color of your account or of a channel. |
|
Set or remove the custom emoji sticker set for a supergroup. |
|
Change the description of a supergroup or a channel. |
|
Change the direct messages group settings of a channel. |
|
Link or unlink a discussion group to a channel. |
|
Set a custom tag for a member of a group or a supergroup. |
|
Set default chat permissions for all members. |
|
Set a new chat photo or video (H.264/MPEG-4 AVC video, max 5 seconds). |
|
Set the chat protected content setting. |
|
Set a new group sticker set for a supergroup. |
|
Change the title of a chat. |
|
Set the auto-delete timer of a chat. |
|
Set a channel or a supergroup username. |
|
Change the main profile tab of your account or of a channel. |
|
Set the default "send_as" chat for a chat. |
|
Set the slow mode interval for a chat. |
|
Take the colors of an upgraded gift you own as your account colors. |
|
Toggle the anti-spam filter in a supergroup. |
|
Toggle automatic message translation for a channel. |
|
Activate or deactivate a collectible username on a channel or supergroup. |
|
Toggle forum mode in a supergroup. |
|
Toggle join requests (admin approval to join) on a channel or supergroup. |
|
Toggle whether users must join before sending messages. |
|
Toggle whether participant list is hidden. |
|
Toggle pre-history visibility for new members. |
|
Toggle channel signatures. |
|
Toggle slow mode in a supergroup. |
|
Toggle whether forum topics are displayed as messages. |
|
Transfer the ownership of a supergroup or a channel to another user. |
|
Unarchive one or more chats. |
|
Unban a previously banned user in a supergroup or channel. |
|
Unban a previously banned channel chat in a supergroup or channel. |
|
Unhide the 'General' topic in a forum supergroup chat. |
|
Use this method to clear the list of pinned messages in a chat. |
|
Clear the list of pinned messages in a forum topic. |
|
Clear the list of pinned messages in the General forum topic. |
|
Unpin a message in a group, channel or your own chat. |
|
Unpin a forum topic. |
|
Update the accent color of a channel. |
|
Update the notification settings of a chat. |
|
Verify a chat on behalf of the organization represented by the bot. |
|
Verify a user on behalf of the organization represented by the bot. |
Communities¶
Approve or reject a specific chat's request to link to a community. |
|
Ban or unban a participant from an entire community. |
|
Collapse or expand a community folder in the user's dialogs list. |
|
Create a new Telegram Community around a channel or supergroup. |
|
Get pending chat link requests for a community. |
|
Get the list of Telegram Communities that the current user has joined. |
|
Get the list of chats within a community that a specific participant has joined. |
|
Approve or reject all pending chat link requests for a community in bulk. |
|
Link, unlink, hide, or make visible a chat/channel in a community. |
Users¶
Block a user. |
|
Check if a username is available. |
|
Delete your own profile photos. |
|
Get a user profile audios sequentially. |
|
Get the total count of audios for a chat. |
|
Get a chat or a user profile photos sequentially. |
|
Get the total count of photos for a chat. |
|
Get the common chats you have with a user. |
|
Get the default emoji statuses. |
|
Get your own user identity. |
|
Check whether we can write to the specified users. |
|
Check if the passed songs are still pinned to the user's profile, or refresh their file references. |
|
Get information about a user. |
|
Report a profile photo of a user or channel for rule violations. |
|
Report a user for rule violations or abuse. |
|
Set or remove the profile photo or video of a bot you own. |
|
Set the emoji status. |
|
Set a personal channel in bio. |
|
Set a new profile photo or video (H.264/MPEG-4 AVC video, max 5 seconds). |
|
Notify the user that the sent passport data contains some errors. |
|
Set your own username. |
|
Unblock a user. |
|
Update birthday in your profile. |
|
Update your profile details such as first name, last name and bio. |
|
Update your profile status. |
Invite Links¶
Approve all pending join requests in a chat. |
|
Approve a chat join request. |
|
Create an additional invite link for a chat. |
|
Create a subscription invite link for a channel chat. |
|
Decline all pending join requests in a chat. |
|
Decline a chat join request. |
|
Delete all revoked invite links of an administrator. |
|
Delete an already revoked invite link. |
|
Edit a non-primary invite link. |
|
Edit a subscription invite link created by the bot. |
|
Generate a new primary invite link for a chat; any previously generated primary link is revoked. |
|
Get the invite links created by an administrator in a chat. |
|
Get the count of the invite links created by an administrator in a chat. |
|
Get the list of the administrators that have exported invite links in a chat. |
|
Get detailed information about a chat invite link. |
|
Get the members who joined the chat with the invite link. |
|
Get the count of the members who joined the chat with the invite link. |
|
Get the pending join requests of a chat. |
|
Revoke a previously created invite link. |
Contacts¶
Accept an incoming contact if the add contact action bar is active. |
|
Add an existing Telegram user as contact, even without a phone number. |
|
Stop getting notifications about discussion replies of a certain user in @replies. |
|
Delete contacts from your Telegram address book. |
|
Delete contacts by phone number. |
|
Edit the close friends list. |
|
Generate a temporary profile link token for the currently logged-in user. |
|
Get contacts' upcoming birthdays. |
|
Returns users and chats that were blocked by the current user. |
|
Get the Telegram user IDs of all contacts. |
|
Obtain the online statuses of all contacts. |
|
Get contacts from your Telegram address book. |
|
Get the total count of contacts from your Telegram address book. |
|
Get list of saved phone contacts. |
|
Obtain a list of sponsored peer search results for a given query. |
|
Obtain user info from a temporary profile link token. |
|
Import contacts to your Telegram address book. |
|
Remove all contacts without an associated Telegram account. |
|
Reset rating of a top peer in a given category. |
|
Resolve a phone number to get user info, if their privacy settings allow it. |
|
Returns users or channels found by name substring and auxiliary data. |
|
Replace the contents of an entire blocklist. |
|
Changes a note of a contact user. |
|
Enable or disable top peers rating. |
|
Upload a custom profile picture for a contact, or suggest a new profile picture to a contact. |
Folders¶
Checks the validity of an invite link for a chat folder and returns information about the corresponding chat folder. |
|
Create new chat folder. |
|
Create a new invite link for a chat folder. |
|
Delete a user's folder. |
|
Deletes an invite link for a chat folder. |
|
Update chat folder. |
|
Edits an invite link for a chat folder. |
|
Fetch new chats associated with an imported chat folder deep link. |
|
Returns chats from a chat folder, suitable for adding to a chat folder invite link. |
|
Returns invite links created by the current user for a shareable chat folder. |
|
Return information about a chat folders. |
|
Return identifiers of pinned or always included chats suggested to be left when deleting a chat folder. |
|
Dismiss new pending peers recently added to a chat folder deep link. |
|
Join channels and supergroups recently added to a chat folder deep link. |
|
Join a folder by its invite link. |
|
Leave a folder by its invite link. |
|
Change the order of chat folders. |
|
Enable or disable chat folder tags. |
Password¶
Change your Two-Step Verification password (Cloud Password) with a new one. |
|
Enable the Two-Step Verification security feature (Cloud Password) on your account. |
|
Turn off the Two-Step Verification security feature (Cloud Password) on your account. |
Bots¶
Add a Main Mini App preview for a bot. |
|
Add an additional username to a bot we own. |
|
Allow a bot to send messages to the user. |
|
Send answers to callback queries sent from inline keyboards. |
|
Use this method to process a received chat join request query. |
|
Use this method to reply to a received guest message. |
|
Send answers to an inline query. |
|
Send answers to pre-checkout queries. |
|
If you sent an invoice requesting a shipping address and the parameter |
|
Set the result of an interaction with a Web App and send a corresponding message on behalf of the user to the chat from which the query originated. |
|
Answer a custom webhook JSON query (for bots). |
|
Check if a bot can send messages to the user. |
|
Checks whether a username can be set for a new bot or as an additional username. |
|
Check if a Mini App can request the download of a specific file. |
|
Creates a bot which will be managed by another bot. |
|
Create invoice link. |
|
Delete the list of the bot's commands for the given scope and user language. |
|
Delete Main Mini App previews for a bot. |
|
Edit a Main Mini App preview for a bot. |
|
Cancels or re-enables Telegram Star subscription for a user. |
|
Get a list of bots you administrate. |
|
Get the current list of the bot's commands for the given scope and user language. |
|
Get the current default privileges of the bot. |
|
Get bot info (name, about, description). |
|
Use this method to get the current / owned bot description for the given user language. |
|
Use this method to get the current / owned bot short description for the given user language. |
|
Use this method to get the current / owned bot name for the given user language. |
|
Fetch Main Mini App preview information for a bot. |
|
Fetch Main Mini App previews for a bot. |
|
Obtain a list of similarly themed bots based on similarities in subscriber bases. |
|
Get the current value of the bot's menu button in a private chat, or the default menu button. |
|
Get data for high score tables. |
|
Get bot results via inline queries. |
|
Use this method to get the access settings of a managed bot. |
|
Use this method to get the token of a managed bot. |
|
Returns the list of bots owned by the current user. |
|
Fetch popular Main Mini Apps used in global search. |
|
Fetch the peer request button a bot prepared for a Mini App. |
|
Send a custom request from a Mini Bot App. |
|
Refunds a successful payment in Telegram Stars. |
|
Reorder Main Mini App previews for a bot. |
|
Reorder active usernames associated to a bot we own. |
|
Remove an additional username from a bot we own. |
|
Use this method to revoke the current token of a managed bot and generate a new one. |
|
Request a callback answer from bots. |
|
Prepare a peer request button for a Mini App (for bots). |
|
Use this method to process a received chat join request query by showing a Mini App to the user before deciding the outcome. |
|
Send a custom request (for bots). |
|
Send a game. |
|
Send an inline bot result. |
|
Use this method to send invoices. |
|
Set the list of the bot's commands. |
|
Change the default privileges requested by the bot when it's added as an administrator to groups or channels. |
|
Use this method to change the bot's description, which is shown in the chat with the bot if the chat is empty. |
|
Use this method to change the bot's short description, which is shown on the bot's profile page and is sent together with the link when users share the bot. |
|
Use this method to get the current / owned bot name for the given user language. |
|
Change the bot's menu button in a private chat, or the default menu button. |
|
Set the score of the specified user in a game. |
|
Use this method to get the access settings of a managed bot. |
|
Activate or deactivate a purchased fragment.com username associated to a bot we own. |
|
Allow or prevent a bot from changing our emoji status. |
|
Create, edit or delete the affiliate program of a bot we own. |
|
Change the emoji status of a user (for bots). |
Business¶
Create a business chat link with a predefined message. |
|
Delete a business chat link by slug. |
|
Delete messages on behalf of a business account. |
|
Return the gifts received and owned by a managed business account. |
|
Return the amount of Telegram Stars owned by a managed business account. |
|
Get all business chat links. |
|
Use this method to get information about the connection of the bot with a business account. |
|
Get bots connected to your business account. |
|
Mark an incoming message as read on behalf of a managed business account. |
|
Remove the current profile photo of a managed business account. |
|
Resolve a business chat link slug to its info. |
|
Change the bio of a managed business account. |
|
Change the privacy settings for incoming gifts of a managed business account. |
|
Change the first and last name of a managed business account. |
|
Change the profile photo of a managed business account. |
|
Change the username of a managed business account. |
|
Transfers Telegram Stars from the business account balance to the bot’s balance. |
|
Set an automatic away message when you are offline. |
|
Set an automatic greeting message for new conversations. |
|
Update your business intro (title, description, sticker). |
|
Update the business location shown on your business page. |
|
Update business work hours for your business account. |
Payments¶
Adds gifts to the beginning of a previously created collection. |
|
Apply a gift code. |
|
Assign and verify an Apple App Store receipt to a payment purpose. |
|
Assign and verify a Google Play Store receipt to a payment purpose. |
|
Pays for upgrade of a regular gift that is owned by another user or channel chat. |
|
Check if an in-app store purchase can be made for the given purpose. |
|
Check if a limited Star Gift can still be sent or is sold out. |
|
Get information about a gift code. |
|
Clear saved payment credentials and/or shipping information. |
|
Connect a Star affiliate referral bot to a channel. |
|
Convert a given regular gift to Telegram Stars. |
|
Crafts a new gift from other gifts that will be permanently lost. |
|
Creates a collection from gifts on the current user's or a channel's profile page. |
|
Initiate a purchase session with an onramp provider. |
|
Deletes a gift collection. |
|
Drops original details for an upgraded gift. |
|
Edit or revoke a connected Star affiliate referral link. |
|
Cancels or re-enables Telegram Star subscription. |
|
Get all available star gifts that can be sent to other users. |
|
Get bank card BIN details and issuer information. |
|
Get all gifts owned by specified chat. |
|
Get the total count of owned gifts of specified chat. |
|
Get details about a specific connected Star affiliate bot. |
|
Get the list of connected Star affiliate referral bots for a channel. |
|
Get the current currency exchange rates. |
|
Returns auction state for a gift. |
|
Returns collections of gifts owned by the given user or chat. |
|
Return examples of possible upgraded gifts for a regular gift. |
|
Returns all possible variants of upgraded gifts for a regular gift. |
|
Returns upgraded gifts of the current user that can be used to craft another gifts. |
|
Get status and winners information of a Telegram Giveaway. |
|
Check availability and supported payment methods for an onramp provider. |
|
Get the supported base fiat currencies for an onramp provider. |
|
Get transaction limits for an onramp provider and currency pair. |
|
Fetch available crypto onramp providers. |
|
Request a price quote for purchasing cryptocurrency via an onramp provider. |
|
Get an invoice payment form. |
|
Get payment receipt for a successful payment message. |
|
Get Telegram Premium gift code options and pricing. |
|
Get all gifts owned by specified chat. |
|
Get the total count of owned gifts of specified chat. |
|
Get saved payment credentials and shipping information. |
|
Get one or more saved star gifts by their input identifiers. |
|
Get the list of currently active Star Gift auctions. |
|
Get the list of gifts acquired in a specific Star Gift auction. |
|
Get the blockchain/Fragment withdrawal URL to transfer an upgraded Star Gift. |
|
Get the current Telegram Stars balance of the current account. |
|
Get available Telegram Stars gift packages for a user. |
|
Get options and pricing for launching a Telegram Stars giveaway. |
|
Get the URL of the Telegram Ads account for stars revenue. |
|
Get Telegram Stars revenue statistics and monetization status for a channel or bot. |
|
Get the Fragment withdrawal URL for Telegram Stars revenue. |
|
Get Telegram Stars subscriptions of a user or channel. |
|
Get Telegram Stars top-up purchasing packages and pricing options. |
|
Get the Telegram Stars transaction history for an account, bot, or channel. |
|
Get Telegram Stars transactions by their identifiers. |
|
Get suggested Star affiliate referral bots for a channel. |
|
Get the current TON balance of the current account. |
|
Get information about upgraded gift. |
|
Returns information about value of an upgraded gift by its name. |
|
Allows to buy a Telegram Premium subscription for another user with payment in Telegram Stars. |
|
Hide gift on the current user's or the channel's profile page. |
|
Increases a bid for an auction gift without changing gift text and receiver. |
|
Launch a previously prepaid giveaway in a channel. |
|
Places a bid on an auction gift. |
|
Handles a pending gift purchase offer. |
|
Removes gifts from a collection. |
|
Changes order of gifts in a collection. |
|
Changes order of gift collections. |
|
Reuses an active Telegram Star subscription to a channel chat and joins the chat again. |
|
Get upgraded gifts that can be bought from other owners. |
|
Send a gift to another user or channel chat. |
|
Sends an offer to purchase an upgraded gift. |
|
Send a filled-out payment form to the bot for final verification. |
|
Send an upgraded gift that is available for resale to another user or channel chat. |
|
Changes name of a gift collection. |
|
Change resale price of a unique gift owned by the current user. |
|
Change the list of pinned gifts on the current user. |
|
Display gift on the current user's or the channel's profile page. |
|
Suggests a birthdate to another regular user with common messages and allowing non-paid messages. |
|
Toggle notifications for incoming star gifts in a channel or chat. |
|
Transfers an owned unique gift to another user. |
|
Upgrade a given regular gift to a unique gift. |
|
Validate requested order and shipping information before payment. |
Stories¶
Check whether we can post stories as the specified chat. |
|
Copy story. |
|
Copy all stories from a story album (highlight) to another chat and create a new album. |
|
Create a new story album (highlight). |
|
Delete posted stories. |
|
Delete a story album (highlight). |
|
Edit the caption of story. |
|
Edit story media. |
|
Edit the privacy of story. |
|
Activates stories stealth mode. |
|
Generate a story deep link for a specific story. |
|
Forward story. |
|
Fetch all read peer stories state. |
|
Get all active or hidden stories that displayed on the action bar on the homescreen. |
|
Get all archived stories from a chat by using chat identifier. |
|
Get all non expired stories from a chat by using chat identifier. |
|
Get a list of chats and channels where the current user can post stories. |
|
Get the maximum read story identifier for one or more peers. |
|
Get all pinned stories from a chat by using chat identifier. |
|
Get one or more stories from a chat by using stories identifiers. |
|
Obtain view summary counts and reaction stats for multiple stories. |
|
Get all stories in a story album (highlight). |
|
Get all story albums (highlights) from a chat or channel. |
|
Obtain the list of reactions sent to a specific story. |
|
Obtain the list of users that have viewed a specific story we posted. |
|
Hide the active stories of a user, preventing them from being displayed on the action bar on the homescreen. |
|
Pin one or more stories in a chat by using stories identifiers. |
|
Mark all stories up to a certain identifier as read, for a given chat. |
|
Reorder story albums (highlights). |
|
Report stories of a user or channel for rule violations. |
|
Repost a story on behalf of a user or business account. |
|
Search public stories by hashtag, location area, or chat. |
|
Post new story. |
|
React to a story. |
|
Show the active stories of a user and display them in the action bar on the homescreen. |
|
Start a live stream broadcast in a story. |
|
Globally hide or unhide all stories from the top of the chat list. |
|
Pin stories to the top of the pinned stories list. |
|
Unpin one or more stories in a chat by using stories identifiers. |
|
Update a story album (highlight). |
|
Increment story views. |
Stickers¶
Add a sticker to the list of favorite stickers. |
|
Add a sticker to the list of recently used stickers. |
|
Add a new sticker to a sticker set. |
|
Install, uninstall, archive or unarchive a sticker set. |
|
Check whether a short name can be used to create a sticker set. |
|
Clear the list of recently used stickers. |
|
Create a new sticker set. |
|
Delete a sticker from a sticker set. |
|
Delete a sticker set. |
|
Get the list of favorite stickers. |
|
Get the sticker sets owned by the current user. |
|
Get the list of recently used stickers. |
|
Get a sticker set by its name. |
|
Get a suggested name for a new sticker set with a given title. |
|
Remove a sticker from the list of favorite stickers. |
|
Remove a sticker from the list of recently used stickers. |
|
Change the order of installed sticker sets. |
|
Replace an existing sticker in a sticker set with a new one. |
|
Search for sticker sets by looking for the query in their title and name. |
|
Search for stickers from public sticker sets that match any of the given emoji. |
|
Set the thumbnail of a custom emoji sticker set. |
|
Change the list of emoji assigned to a regular or custom emoji sticker. |
|
Change the search keywords assigned to a regular or custom emoji sticker. |
|
Change the mask position of a mask sticker. |
|
Move a sticker in a sticker set to a specific position. |
|
Set the thumbnail of a regular or mask sticker set. |
|
Set the title of a sticker set. |
|
Upload a file with a sticker for later use in |
SMS Jobs¶
Finish an SMS job (official clients only). |
|
Get info about an SMS job (official clients only). |
|
Get SMS jobs status (official clients only). |
|
Check if we can process SMS jobs (official clients only). |
|
Enable SMS jobs (official clients only). |
|
Disable SMS jobs (official clients only). |
|
Update SMS job settings (official clients only). |
Phone¶
Accept an incoming 1-on-1 private phone call. |
|
Change the stream volume in a voice chat. |
|
Check which audio/video source IDs the server still recognizes in a group call. |
|
Confirm Diffie-Hellman encryption parameters for a 1-on-1 private call. |
|
Create and optionally join a new end-to-end encrypted conference call. |
|
Decline an invitation to join a conference call. |
|
Remove or kick participants from an end-to-end encrypted conference call. |
|
Delete messages sent in a group call or live stream chat. |
|
Delete all messages from a specific participant in a group call or live stream chat. |
|
Decline, reject, or hang up a 1-on-1 private phone call. |
|
Edit participant properties in a group voice chat (mute, volume, video, hand raise). |
|
Edit settings for an active group voice chat (join muted, chat messages, stars). |
|
Edit the title of an active or scheduled group voice chat. |
|
End and terminate an active group voice chat or live stream for all members. |
|
Export an invite link for an active group voice chat or live stream. |
|
Get phone call VoIP configuration (STUN/TURN server endpoints). |
|
Get the members list of a chat call. |
|
Get details about an active group voice chat or live stream. |
|
Get chain blocks for an end-to-end encrypted conference call. |
|
Get the list of peers (user profile or channels) that can be used to join a voice chat. |
|
Get current settings of an active group voice chat or live stream. |
|
Get Telegram Stars revenue / statistics for an active voice chat. |
|
Get available audio/video stream channels in an RTMP livestream or group call. |
|
Get RTMP streaming URL and Stream Key for broadcasting to a chat (e.g. via OBS). |
|
Invite a user to an end-to-end encrypted conference call. |
|
Invite one or more users to an active group voice chat. |
|
Join a group call / voice chat via MTProto signaling. |
|
Start screen sharing / presentation in an active group call. |
|
Leave an active group voice chat or video stream without ending the call for others. |
|
Stop screen sharing / presentation in an active group call. |
|
Pause the current media stream in a voice chat. |
|
Stream an audio file, remote live URL, or Telegram media directly into group voice chat. |
|
Stream a video file, remote stream, or Telegram media directly into group voice chat. |
|
Notify the server that the user received an incoming phone call and is currently busy. |
|
Start a 1-on-1 private phone call. |
|
Resume a paused media stream in a voice chat. |
|
Send phone call debug statistics to Telegram servers. |
|
Upload VoIP phone call log file. |
|
Save default peer identity (personal profile or channel) to join voice chats in a chat. |
|
Save the default peer identity displayed as author of live story comments/reactions. |
|
Broadcast state updates to all participants in an end-to-end encrypted conference call. |
|
Send an end-to-end encrypted message in a conference call. |
|
Send a live chat text message during an active group voice chat or live stream. |
|
Send VoIP signaling data (e.g. ICE candidates) for an ongoing phone call. |
|
Send quality rating and feedback for a finished phone call. |
|
Start or schedule a group voice chat or live stream in a chat. |
|
Start server-side recording of an active group voice chat or live stream. |
|
Start a previously scheduled group voice chat immediately. |
|
Stop server-side recording of an active group voice chat or live stream. |
|
Subscribe to notifications when a scheduled voice chat starts. |
|
Unsubscribe from notifications when a scheduled voice chat starts. |
Stats¶
Get channel statistics. |
|
Get supergroup statistics. |
|
Obtain a list of public channel forwards for a message. |
|
Get message statistics. |
|
Obtain forwards of a story as a message to public chats and reposts by public channels. |
|
Get statistics for a certain story. |
|
Load channel statistics graph asynchronously. |
Decorators¶
Decorator for handling changes in business connection. |
|
Decorator for handling new messages from business connection. |
|
Decorator for handling callback queries. |
|
Decorator for handling applied chat boosts. |
|
Decorator for handling chat join requests. |
|
Decorator for handling chat member leave events. |
|
Decorator for handling event changes on chat members. |
|
Decorator for handling chosen inline results. |
|
Decorator for handling connections. |
|
Decorator for handling deleted messages from business connection. |
|
Decorator for handling deleted messages. |
|
Decorator for handling disconnections. |
|
Decorator for handling edited messages from business connection. |
|
Decorator for handling edited messages. |
|
Decorator for handling unexpected errors. |
|
Decorator for handling new guest messages. |
|
Decorator for handling inline queries. |
|
Decorator for handling new managed bot creation updates. |
|
Decorator for handling new messages. |
|
Decorator for handling a user stopping the generation of a message. |
|
Decorator for handling reaction changes on messages. |
|
Decorator for handling anonymous reaction changes on messages. |
|
Decorator for handling poll updates. |
|
Decorator for handling pre-checkout queries. |
|
Decorator for handling purchased paid media. |
|
Decorator for handling raw updates. |
|
Decorator for handling shipping queries. |
|
Decorator for handling client start. |
|
Decorator for handling client stop. |
|
Decorator for handling new stories. |
|
Decorator for handling when an audio or video stream in a voice chat ends. |
|
Decorator for handling when an audio or video stream in a voice chat starts. |
|
Decorator for handling user status updates. |
Advanced¶
Methods used only when dealing with the raw Telegram API. Learn more about how to use the raw API at Advanced Usage.
Fetch information about a Fragment collectible (username or phone number). |
|
Get SHA256 hashes for verifying downloaded files. |
|
Get existing session or create a new one. |
|
Returns content of a web file, by proxying the request through Telegram. |
|
Initialize connection with client information wrapping a query. |
|
Invoke raw Telegram functions. |
|
Invokes a query after successful completion of one of the previous queries. |
|
Invokes a query after successful completion of previous queries. |
|
Official clients only, invoke query with Apple push verification secret. |
|
Official clients only, invoke query with Google Play Integrity token. |
|
Invoke the specified query using the specified API layer. |
|
Invoke with the given message range. |
|
Restores updates for the time while the client was offline. |
|
Get the InputPeer of a known peer id. |
|
Upload a file onto Telegram servers, without sending the message to anyone. |
|
Set configuration for the specified datacenter. |