INDEPENDENT · LLM-READY · OPEN
The Bot API,
ready to talk.
A clean, linked mirror of Telegram’s Bot API reference—split into useful pieces for people and language models alike.
A snapshot of the official docs, not a live API.
THE REFERENCE, IN PIECES
Find your way around.
Search methods, types, and topics. Each entry opens its own Markdown page.
647 sections
Recent changes
Authorizing your bot
Making requests
Making requestsAll queries to the Telegram Bot API must be served over HTTPS and need to be presented in this form: https://api.telegram.org/bot<token>/METHODNAME. Like this for example:Making requests when getting updatesIf you're using webhooks, you can perform a request to the Bot API while sending an answer to the webhook. Use either application/json or application/x-www-form-urlencoded or multipart/form-data response content type for
Using a Local Bot API Server
Using a Local Bot API ServerThe Bot API server source code is available at telegram-bot-api. You can run it locally and send the requests to your own server instead of https://api.telegram.org. If you switch to a local Bot API server, your bot willDo I need a Local Bot API ServerThe majority of bots will be OK with the default configuration, running on our servers. But if you feel that you need one of these features, you're welcome to switch to your own at any time.
Getting updates
Getting updatesThere are two mutually exclusive ways of receiving updates for your bot - the getUpdates method on one hand and webhooks on the other. Incoming updates are stored on the server until the bot receives them either way, butUpdateThis object represents an incoming update.getUpdatesUse this method to receive incoming updates using long polling (wiki). Returns an Array of Update objects.setWebhookUse this method to specify a URL and receive incoming updates via an outgoing webhook. Whenever there is an update for the bot, we will send an HTTPS POST request to the specified URL, containing a JSON-serialized UpdatedeleteWebhookUse this method to remove webhook integration if you decide to switch back to getUpdates. Returns True on success.getWebhookInfoUse this method to get current webhook status. Requires no parameters. On success, returns a WebhookInfo object. If the bot is using getUpdates, will return an object with the url field empty.WebhookInfoDescribes the current status of a webhook.
Available types
Available typesAll types used in the Bot API responses are represented as JSON-objects.UserThis object represents a Telegram user or bot.ChatThis object represents a chat.ChatFullInfoThis object contains full information about a chat.MessageThis object represents a message.MessageIdThis object represents a unique message identifier.InaccessibleMessageThis object describes a message that was deleted or is otherwise inaccessible to the bot.MaybeInaccessibleMessageThis object describes a message that can be inaccessible to the bot. It can be one ofMessageEntityThis object represents one special entity in a text message. For example, hashtags, usernames, URLs, etc.TextQuoteThis object contains information about the quoted part of a message that is replied to by the given message.ExternalReplyInfoThis object contains information about a message that is being replied to, which may come from another chat or forum topic.ReplyParametersDescribes reply parameters for the message that is being sent.EphemeralMessageParametersMessageOriginThis object describes the origin of a message. It can be one ofMessageOriginUserThe message was originally sent by a known user.MessageOriginHiddenUserThe message was originally sent by an unknown user.MessageOriginChatThe message was originally sent on behalf of a chat to a group chat.MessageOriginChannelThe message was originally sent to a channel chat.PhotoSizeThis object represents one size of a photo or a file / sticker thumbnail.AnimationThis object represents an animation file (GIF or H.264/MPEG-4 AVC video without sound).AudioThis object represents an audio file to be treated as music by the Telegram clients.DocumentThis object represents a general file (as opposed to photos, voice messages and audio files).LivePhotoThis object represents a live photo.StoryThis object represents a story.VideoQualityThis object represents a video file of a specific quality.VideoThis object represents a video file.VideoNoteThis object represents a video message.VoiceThis object represents a voice note.WidgetThis object describes an HTML widget.PaidMediaInfoDescribes the paid media added to a message.PaidMediaThis object describes paid media. Currently, it can be one ofPaidMediaLivePhotoThe paid media is a live photo.PaidMediaPhotoThe paid media is a photo.PaidMediaPreviewThe paid media isn't available before the payment.PaidMediaVideoThe paid media is a video.ContactThis object represents a phone contact.DiceThis object represents an animated emoji that displays a random value.LinkRepresents an HTTP link.PollMediaAt most one of the optional fields can be present in any given object.InputPollMediaThis object represents the content of a poll description or a quiz explanation to be sent. It should be one ofInputPollOptionMediaThis object represents the content of a poll option to be sent. It should be one ofPollOptionThis object contains information about one answer option in a poll.InputPollOptionThis object contains information about one answer option in a poll to be sent.PollAnswerThis object represents an answer of a user in a non-anonymous poll.PollThis object contains information about a poll.ChecklistTaskDescribes a task in a checklist.ChecklistDescribes a checklist.InputChecklistTaskDescribes a task to add to a checklist.InputChecklistDescribes a checklist to create.LocationThis object represents a point on the map.VenueThis object represents a venue.WebAppDataDescribes data sent from a Web App to the bot.ProximityAlertTriggeredThis object represents the content of a service message, sent whenever a user in the chat triggers a proximity alert set by another user.MessageAutoDeleteTimerChangedThis object represents a service message about a change in auto-delete timer settings.ManagedBotCreatedThis object contains information about the bot that was created to be managed by the current bot.ManagedBotUpdatedThis object contains information about the creation, token update, or owner update of a bot that is managed by the current bot.BotSubscriptionUpdatedThis object contains information about changes to a user payment subscription toward the current bot.MessageGenerationStoppedThis object describes an update about a user stopping message generation.PollOptionAddedDescribes a service message about an option added to a poll.PollOptionDeletedDescribes a service message about an option deleted from a poll.ChatBoostAddedThis object represents a service message about a user boosting a chat.BackgroundFillThis object describes the way a background is filled based on the selected colors. Currently, it can be one ofBackgroundFillSolidThe background is filled using the selected color.BackgroundFillGradientThe background is a gradient fill.BackgroundFillFreeformGradientThe background is a freeform gradient that rotates after every message in the chat.BackgroundTypeThis object describes the type of a background. Currently, it can be one ofBackgroundTypeFillThe background is automatically filled based on the selected colors.BackgroundTypeWallpaperThe background is a wallpaper in the JPEG format.BackgroundTypePatternThe background is a .PNG or .TGV (gzipped subset of SVG with MIME type “application/x-tgwallpattern”) pattern to be combined with the background fill chosen by the user.BackgroundTypeChatThemeThe background is taken directly from a built-in chat theme.ChatBackgroundThis object represents a chat background.ChecklistTasksDoneDescribes a service message about checklist tasks marked as done or not done.ChecklistTasksAddedDescribes a service message about tasks added to a checklist.CommunityChatAddedDescribes a service message about a chat or a bot being added to a community.CommunityChatJoinedDescribes a service message about a chat being joined by a user from a community.CommunityChatRemovedDescribes a service message about a chat or a bot being removed from a community. Currently holds no information.ForumTopicCreatedThis object represents a service message about a new forum topic created in the chat.ForumTopicClosedThis object represents a service message about a forum topic closed in the chat. Currently holds no information.ForumTopicEditedThis object represents a service message about an edited forum topic.ForumTopicReopenedThis object represents a service message about a forum topic reopened in the chat. Currently holds no information.GeneralForumTopicHiddenThis object represents a service message about General forum topic hidden in the chat. Currently holds no information.GeneralForumTopicUnhiddenThis object represents a service message about General forum topic unhidden in the chat. Currently holds no information.SharedUserThis object contains information about a user that was shared with the bot using a KeyboardButtonRequestUsers button.UsersSharedThis object contains information about the users whose identifiers were shared with the bot using a KeyboardButtonRequestUsers button.ChatSharedThis object contains information about a chat that was shared with the bot using a KeyboardButtonRequestChat button.WriteAccessAllowedThis object represents a service message about a user allowing a bot to write messages after adding it to the attachment menu, launching a Web App from a link, or accepting an explicit request from a Web App sent by the VideoChatScheduledThis object represents a service message about a video chat scheduled in the chat.VideoChatStartedThis object represents a service message about a video chat started in the chat. Currently holds no information.VideoChatEndedThis object represents a service message about a video chat ended in the chat.VideoChatParticipantsInvitedThis object represents a service message about new members invited to a video chat.PaidMessagePriceChangedDescribes a service message about a change in the price of paid messages within a chat.DirectMessagePriceChangedDescribes a service message about a change in the price of direct messages sent to a channel chat.SuggestedPostApprovedDescribes a service message about the approval of a suggested post.SuggestedPostApprovalFailedDescribes a service message about the failed approval of a suggested post. Currently, only caused by insufficient user funds at the time of approval.SuggestedPostDeclinedDescribes a service message about the rejection of a suggested post.SuggestedPostPaidDescribes a service message about a successful payment for a suggested post.SuggestedPostRefundedDescribes a service message about a payment refund for a suggested post.PaidMessagesWaivedDescribes a service message about the sender of the message using a link of the other user, which allows sending messages to the user without paying Telegram Stars. Currently holds no information.TonWalletTransferDescribes a service message about a transfer with a TON wallet.GiveawayCreatedThis object represents a service message about the creation of a scheduled giveaway.GiveawayThis object represents a message about a scheduled giveaway.GiveawayWinnersThis object represents a message about the completion of a giveaway with public winners.GiveawayCompletedThis object represents a service message about the completion of a giveaway without public winners.LinkPreviewOptionsDescribes the options used for link preview generation.SuggestedPostPriceDescribes the price of a suggested post.SuggestedPostInfoContains information about a suggested post.SuggestedPostParametersContains parameters of a post that is being suggested by the bot.DirectMessagesTopicDescribes a topic of a direct messages chat.UserProfilePhotosThis object represent a user's profile pictures.UserProfileAudiosThis object represents the audios displayed on a user's profile.FileThis object represents a file ready to be downloaded. The file can be downloaded via the link https://api.telegram.org/file/bot<token>/<filepath>. It is guaranteed that the link will be valid for at least 1 hour. When thWebAppInfoDescribes a Web App.ReplyKeyboardMarkupThis object represents a custom keyboard with reply options (see Introduction to bots for details and examples). Not supported in channels and for messages sent on behalf of a business account.KeyboardButtonThis object represents one button of the reply keyboard. At most one of the fields other than text, icon\custom\emoji\id, and style must be used to specify the type of the button. For simple text buttons, String can be uKeyboardButtonRequestUsersThis object defines the criteria used to request suitable users. Information about the selected users will be shared with the bot when the corresponding button is pressed. More about requesting users »KeyboardButtonRequestChatThis object defines the criteria used to request a suitable chat. Information about the selected chat will be shared with the bot when the corresponding button is pressed. The bot will be granted requested rights in the KeyboardButtonRequestManagedBotThis object defines the parameters for the creation of a managed bot. Information about the created bot will be shared with the bot using the update managed\bot and a Message with the field managed\bot\created.KeyboardButtonPollTypeThis object represents type of a poll, which is allowed to be created and sent when the corresponding button is pressed.ReplyKeyboardRemoveUpon receiving a message with this object, Telegram clients will remove the current custom keyboard and display the default letter-keyboard. By default, custom keyboards are displayed until a new keyboard is sent by a boInlineKeyboardMarkupThis object represents an inline keyboard that appears right next to the message it belongs to.InlineKeyboardButtonThis object represents one button of an inline keyboard. Exactly one of the fields other than text, icon\custom\emoji\id, and style must be used to specify the type of the button.LoginUrlThis object represents a parameter of the inline keyboard button used to automatically authorize a user. It serves as a great replacement for the Telegram Login Widget when the user is coming from Telegram. All the user SwitchInlineQueryChosenChatThis object represents an inline button that switches the current user to inline mode in a chosen chat, with an optional default inline query.CopyTextButtonThis object represents an inline keyboard button that copies specified text to the clipboard.DisabledButtonThis object represents a disabled button which does nothing. Currently holds no information.CallbackQueryThis object represents an incoming callback query from a callback button in an inline keyboard. If the button that originated the query was attached to a message sent by the bot, the field message will be present. If theWidgetQueryTypeThis object describes the type of a query from a widget. Currently, it can be one ofWidgetQueryTypeDataThe query contains data for the bot.WidgetQueryTypeSignDataThe query contains data signed by a TON wallet of the user who sent the query. The data is signed for the domain bot<botid>, where <botid> is the identifier of the bot.WidgetQueryTypeSentTransactionThe query notifies the bot about a transaction sent from a TON wallet of the user who sent the query.WidgetQueryWalletThis object describes a TON wallet of the user, which is used in a query from a widget.WidgetQueryThis object represents an incoming query from a widget in a message sent by the bot or via the bot. Use answerWidgetQuery to answer the query. Each user can send at most 5 queries per 5 seconds to the bot from all its wiSharedWidgetQueryThis object represents an incoming query from a forwarded message with a shared widget created by the bot. Use answerWidgetQuery to answer the query. Each user can send at most 5 queries per 5 seconds to the bot from allForceReplyUpon receiving a message with this object, Telegram clients will display a reply interface to the user (act as if the user has selected the bot's message and tapped 'Reply'). This can be extremely useful if you want to cCommunityRepresents a community (a group of chats).ChatPhotoThis object represents a chat photo.ChatInviteLinkRepresents an invite link for a chat.ChatAdministratorRightsRepresents the rights of an administrator in a chat.ChatMemberUpdatedThis object represents changes in the status of a chat member.ChatMemberThis object contains information about one member of a chat. Currently, the following 6 types of chat members are supported:ChatMemberOwnerRepresents a chat member that owns the chat and has all administrator privileges.ChatMemberAdministratorRepresents a chat member that has some additional privileges.ChatMemberMemberRepresents a chat member that has no additional privileges or restrictions.ChatMemberRestrictedRepresents a chat member that is under certain restrictions in the chat. Supergroups only.ChatMemberLeftRepresents a chat member that isn't currently a member of the chat, but may join it themselves.ChatMemberBannedRepresents a chat member that was banned in the chat and can't return to the chat or view chat messages.ChatJoinRequestRepresents a join request sent to a chat.ChatPermissionsDescribes actions that a non-administrator user is allowed to take in a chat.BirthdateDescribes the birthdate of a user.BusinessIntroContains information about the start page settings of a Telegram Business account.BusinessLocationContains information about the location of a Telegram Business account.BusinessOpeningHoursIntervalDescribes an interval of time during which a business is open.BusinessOpeningHoursDescribes the opening hours of a business.UserRatingThis object describes the rating of a user based on their Telegram Star spendings.AreaPositionDescribes the position of a rectangle area on a story media or a TON wallet card.TonNftThis object represents an NFT in the TON blockchain.TonNftAttributeThis object represents an attribute of an NFT in the TON blockchain.TonWalletCardStickerThis object describes a sticker on a TON wallet card.TonWalletCardThis object describes a TON wallet card, which is shown on the profile page of a user to everyone.EmojiTypeThis object describes an emoji. Currently, it can be one ofEmojiTypeEmojiA regular emoji.EmojiTypeCustomEmojiA custom emoji.ChatShareThemeThis object describes the theme of the screen for sharing a link to a user or a chat. Currently, it can be one ofChatShareThemeEmojiThe theme with emoji placed on a background.ChatShareThemeUniqueGiftThe theme based on a unique gift owned by the user or the chat.ChatShareThemeBackdropsThis object contains a list of backdrops, which can be used as the background of a theme of the screen for sharing a link to a user or a chat.ChatShareThemeBackdropThis object describes a backdrop, which can be used as the background of a theme of the screen for sharing a link to a user or a chat.LocationAddressDescribes the physical address of a location.StoryAreaTypeDescribes the type of a clickable area on a story. Currently, it can be one ofStoryAreaTypeLocationDescribes a story area pointing to a location. Currently, a story can have up to 10 location areas.StoryAreaTypeSuggestedReactionDescribes a story area pointing to a suggested reaction. Currently, a story can have up to 5 suggested reaction areas.StoryAreaTypeLinkDescribes a story area pointing to an HTTP or tg:// link. Currently, a story can have up to 3 link areas.StoryAreaTypeWeatherDescribes a story area containing weather information. Currently, a story can have up to 3 weather areas.StoryAreaTypeUniqueGiftDescribes a story area pointing to a unique gift. Currently, a story can have at most 1 unique gift area.StoryAreaDescribes a clickable area on a story media.ChatLocationRepresents a location to which a chat is connected.ReactionTypeThis object describes the type of a reaction. Currently, it can be one ofReactionTypeEmojiThe reaction is based on an emoji.ReactionTypeCustomEmojiThe reaction is based on a custom emoji.ReactionTypePaidThe reaction is paid.ReactionCountRepresents a reaction added to a message along with the number of times it was added.MessageReactionUpdatedThis object represents a change of a reaction on a message performed by a user.MessageReactionCountUpdatedThis object represents reaction changes on a message with anonymous reactions.ForumTopicThis object represents a forum topic.GiftBackgroundThis object describes the background of a gift.GiftThis object represents a gift that can be sent by the bot.GiftsThis object represent a list of gifts.UniqueGiftModelThis object describes the model of a unique gift.UniqueGiftSymbolThis object describes the symbol shown on the pattern of a unique gift.UniqueGiftBackdropColorsThis object describes the colors of the backdrop of a unique gift.UniqueGiftBackdropThis object describes the backdrop of a unique gift.UniqueGiftColorsThis object contains information about the color scheme for a user's name, message replies and link previews based on a unique gift.UniqueGiftThis object describes a unique gift that was upgraded from a regular gift.GiftInfoDescribes a service message about a regular gift that was sent or received.UniqueGiftInfoDescribes a service message about a unique gift that was sent or received.OwnedGiftThis object describes a gift received and owned by a user or a chat. Currently, it can be one ofOwnedGiftRegularDescribes a regular gift owned by a user or a chat.OwnedGiftUniqueDescribes a unique gift received and owned by a user or a chat.OwnedGiftsContains the list of gifts received and owned by a user or a chat.BotAccessSettingsThis object describes the access settings of a bot.AcceptedGiftTypesThis object describes the types of gifts that can be gifted to a user or a chat.StarAmountDescribes an amount of Telegram Stars.BotCommandThis object represents a bot command.BotCommandScopeThis object represents the scope to which bot commands are applied. Currently, the following 7 scopes are supported:Determining list of commandsThe following algorithm is used to determine the list of commands for a particular user viewing the bot menu. The first list of commands which is set is returned:BotCommandScopeDefaultRepresents the default scope of bot commands. Default commands are used if no commands with a narrower scope are specified for the user.BotCommandScopeAllPrivateChatsRepresents the scope of bot commands, covering all private chats.BotCommandScopeAllGroupChatsRepresents the scope of bot commands, covering all group and supergroup chats.BotCommandScopeAllChatAdministratorsRepresents the scope of bot commands, covering all group and supergroup chat administrators.BotCommandScopeChatRepresents the scope of bot commands, covering a specific chat.BotCommandScopeChatAdministratorsRepresents the scope of bot commands, covering all administrators of a specific group or supergroup chat.BotCommandScopeChatMemberRepresents the scope of bot commands, covering a specific member of a group or supergroup chat.BotNameThis object represents the bot's name.BotDescriptionThis object represents the bot's description.BotShortDescriptionThis object represents the bot's short description.MenuButtonThis object describes the bot's menu button in a private chat. It should be one ofMenuButtonCommandsRepresents a menu button, which opens the bot's list of commands.MenuButtonWebAppRepresents a menu button, which launches a Web App.MenuButtonDefaultDescribes that no specific value for the menu button was set.ChatBoostSourceThis object describes the source of a chat boost. It can be one ofChatBoostSourcePremiumThe boost was obtained by subscribing to Telegram Premium or by gifting a Telegram Premium subscription to another user.ChatBoostSourceGiftCodeThe boost was obtained by the creation of Telegram Premium gift codes to boost a chat. Each such code boosts the chat 4 times for the duration of the corresponding Telegram Premium subscription.ChatBoostSourceGiveawayThe boost was obtained by the creation of a Telegram Premium or a Telegram Star giveaway. This boosts the chat 4 times for the duration of the corresponding Telegram Premium subscription for Telegram Premium giveaways anChatBoostThis object contains information about a chat boost.ChatBoostUpdatedThis object represents a boost added to a chat or changed.ChatBoostRemovedThis object represents a boost removed from a chat.ChatOwnerLeftDescribes a service message about the chat owner leaving the chat.ChatOwnerChangedDescribes a service message about an ownership change in the chat.UserChatBoostsThis object represents a list of boosts added to a chat by a user.BusinessBotRightsRepresents the rights of a business bot.BusinessConnectionDescribes the connection of the bot with a business account.BusinessMessagesDeletedThis object is received when messages are deleted from a connected business account.SentWebAppMessageDescribes an inline message sent by a Web App on behalf of a user.SentGuestMessageDescribes an inline message sent by a guest bot.PreparedInlineMessageDescribes an inline message to be sent by a user of a Mini App.PreparedKeyboardButtonDescribes a keyboard button to be used by a user of a Mini App.ResponseParametersDescribes why a request was unsuccessful.InputMediaThis object represents the content of a media message to be sent. It should be one ofInputMediaAnimationRepresents an animation file (GIF or H.264/MPEG-4 AVC video without sound) to be sent.InputMediaAudioRepresents an audio file to be treated as music to be sent.InputMediaDocumentRepresents a general file to be sent.InputMediaLinkRepresents an HTTP link to be sent.InputMediaLivePhotoRepresents a live photo to be sent.InputMediaLocationRepresents a location to be sent.InputMediaPhotoRepresents a photo to be sent.InputMediaStickerRepresents a sticker file to be sent.InputMediaVenueRepresents a venue to be sent.InputMediaVideoRepresents a video to be sent.InputMediaVoiceNoteRepresents a voice message file to be sent.InputFileThis object represents the contents of a file to be uploaded. Must be posted using multipart/form-data in the usual way that files are uploaded via the browser.InputPaidMediaThis object describes the paid media to be sent. Currently, it can be one ofInputPaidMediaLivePhotoThe paid media to send is a live photo.InputPaidMediaPhotoThe paid media to send is a photo.InputPaidMediaVideoThe paid media to send is a video.InputProfilePhotoThis object describes a profile photo to set. Currently, it can be one ofInputProfilePhotoStaticA static profile photo in the .JPG format.InputProfilePhotoAnimatedAn animated profile photo in the MPEG4 format.InputStoryContentThis object describes the content of a story to post. Currently, it can be one ofInputStoryContentPhotoDescribes a photo to post as a story.InputStoryContentVideoDescribes a video to post as a story.Sending filesThere are three ways to send files (photos, stickers, audio, media, etc.):Accent colorsColors with identifiers 0 (red), 1 (orange), 2 (purple/violet), 3 (green), 4 (cyan), 5 (blue), 6 (pink) can be customized by app themes. Additionally, the following colors in RGB format are currently in use.Profile accent colorsCurrently, the following colors in RGB format are in use for profile backgrounds.Inline mode objectsObjects and methods used in the inline mode are described in the Inline mode section.
Available methods
Available methodsgetMeA simple method for testing your bot's authentication token. Requires no parameters. Returns basic information about the bot in form of a User object.logOutUse this method to log out from the cloud Bot API server before launching the bot locally. You must log out the bot before running it locally, otherwise there is no guarantee that the bot will receive updates. After a sucloseUse this method to close the bot instance before moving it from one local server to another. You need to delete the webhook before calling this method to ensure that the bot isn't launched again after server restart. ThesendMessageUse this method to send text messages. On success, the sent Message is returned.Formatting optionsThe Bot API supports basic formatting for messages. You can use bold, italic, underlined, strikethrough, spoiler text, block quotations as well as inline links and pre-formatted code in your bots' messages. Telegram clieEphemeral Messages and CommandsEphemeral interactions allow a bot and an individual member of a group or supergroup chat to communicate privately on the public timeline without cluttering the chat for other members. They may disappear automatically afPaid BroadcastsBy default, all bots are able to broadcast up to 30 messages per second to their users. Developers can increase this limit by enabling Paid Broadcasts in @BotFather - allowing their bot to broadcast up to 1000 messages pforwardMessageUse this method to forward messages of any kind. Service messages and messages with protected content can't be forwarded. On success, the sent Message is returned.forwardMessagesUse this method to forward multiple messages of any kind. If some of the specified messages can't be found or forwarded, they are skipped. Service messages and messages with protected content can't be forwarded. Album grcopyMessageUse this method to copy messages of any kind. Service messages, paid media messages, giveaway messages, giveaway winners messages, invoice messages, and widget messages can't be copied. A quiz poll can be copied only if copyMessagesUse this method to copy messages of any kind. If some of the specified messages can't be found or copied, they are skipped. Service messages, paid media messages, giveaway messages, giveaway winners messages, invoice messendPhotoUse this method to send photos. On success, the sent Message is returned.sendLivePhotoUse this method to send live photos. On success, the sent Message is returned.sendAudioUse this method to send audio files, if you want Telegram clients to display them in the music player. Your audio must be in the .MP3 or .M4A format. On success, the sent Message is returned. Bots can currently send audisendDocumentUse this method to send general files. On success, the sent Message is returned. Bots can currently send files of any type of up to 50 MB in size, this limit may be changed in the future.sendVideoUse this method to send video files, Telegram clients support MPEG4 videos (other formats may be sent as Document). On success, the sent Message is returned. Bots can currently send video files of up to 50 MB in size, thsendAnimationUse this method to send animation files (GIF or H.264/MPEG-4 AVC video without sound). On success, the sent Message is returned. Bots can currently send animation files of up to 50 MB in size, this limit may be changed isendVoiceUse this method to send audio files, if you want Telegram clients to display the file as a playable voice message. For this to work, your audio must be in an .OGG file encoded with OPUS, or in .MP3 format, or in .M4A forsendVideoNoteUse this method to send a rounded square MPEG4 video of up to 1 minute long. On success, the sent Message is returned.sendWidgetUse this method to send a message with an HTML widget. Currently, in the production environment, widgets can be sent only to private chats, and sent widgets automatically have protected content and therefore can't be forsendSharedWidgetUse this method to send again a shared widget created by the bot. Currently, in the production environment, widgets can be sent only to private chats, and sent widgets automatically have protected content and therefore csendPaidMediaUse this method to send paid media. On success, the sent Message is returned.sendMediaGroupUse this method to send a group of photos, live photos, videos, documents or audios as an album. Documents and audio files can be only grouped in an album with messages of the same type. On success, an Array of Message osendLocationUse this method to send point on the map. On success, the sent Message is returned.sendVenueUse this method to send information about a venue. On success, the sent Message is returned.sendContactUse this method to send phone contacts. On success, the sent Message is returned.sendPollUse this method to send a native poll. On success, the sent Message is returned.sendChecklistUse this method to send a checklist on behalf of a connected business account. On success, the sent Message is returned.sendDiceUse this method to send an animated emoji that will display a random value. On success, the sent Message is returned.sendMessageDraftUse this method to stream a partial message to a user while the message is being generated. Note that the streamed draft is ephemeral and acts as a temporary 30-second preview - once the output is finalized, you must calsendChatActionUse this method when you need to tell the user that something is happening on the bot's side. The status is set for 5 seconds or less (when a message arrives from your bot, Telegram clients clear its typing status). RetusetMessageReactionUse this method to change the chosen reactions on a message. Service messages of some types can't be reacted to. Automatically forwarded messages from a channel to its discussion group have the same available reactions agetUserProfilePhotosUse this method to get a list of profile pictures for a user. Returns a UserProfilePhotos object.getUserProfileAudiosUse this method to get a list of profile audios for a user. Returns a UserProfileAudios object.setUserEmojiStatusChanges the emoji status for a given user that previously allowed the bot to manage their emoji status via the Mini App method requestEmojiStatusAccess. Returns True on success.getFileUse this method to get basic information about a file and prepare it for downloading. For the moment, bots can download files of up to 20MB in size. On success, a File object is returned. The file can then be downloaded banChatMemberUse this method to ban a user in a group, a supergroup or a channel. In the case of supergroups and channels, the user will not be able to return to the chat on their own using invite links, etc., unless unbanned first. unbanChatMemberUse this method to unban a previously banned user in a supergroup or channel. The user will not return to the group or channel automatically, but will be able to join via link, etc. The bot must be an administrator for trestrictChatMemberUse this method to restrict a user in a supergroup. The bot must be an administrator in the supergroup for this to work and must have the appropriate administrator rights. Pass True for all permissions to lift restrictiopromoteChatMemberUse this method to promote or demote a user in a supergroup or a channel. The bot must be an administrator in the chat for this to work and must have the appropriate administrator rights. Pass False for all boolean paramsetChatAdministratorCustomTitleUse this method to set a custom title for an administrator in a supergroup promoted by the bot. Returns True on success.setChatMemberTagUse this method to set a tag for a regular member in a group or a supergroup. The bot must be an administrator in the chat for this to work and must have the can\manage\tags administrator right. Returns True on success.banChatSenderChatUse this method to ban a channel chat in a supergroup or a channel. Until the chat is unbanned, the owner of the banned chat won't be able to send messages on behalf of any of their channels. The bot must be an administrunbanChatSenderChatUse this method to unban a previously banned channel chat in a supergroup or channel. The bot must be an administrator for this to work and must have the appropriate administrator rights. Returns True on success.setChatPermissionsUse this method to set default chat permissions for all members. The bot must be an administrator in the group or a supergroup for this to work and must have the can\restrict\members administrator rights. Returns True onexportChatInviteLinkUse this method to generate a new primary invite link for a chat; any previously generated primary link is revoked. The bot must be an administrator in the chat for this to work and must have the appropriate administratocreateChatInviteLinkUse this method to create an additional invite link for a chat. The bot must be an administrator in the chat for this to work and must have the appropriate administrator rights. The link can be revoked using the method reditChatInviteLinkUse this method to edit a non-primary invite link created by the bot. The bot must be an administrator in the chat for this to work and must have the appropriate administrator rights. Returns the edited invite link as a createChatSubscriptionInviteLinkUse this method to create a subscription invite link for a channel chat. The bot must have the can\invite\users administrator rights. The link can be edited using the method editChatSubscriptionInviteLink or revoked usineditChatSubscriptionInviteLinkUse this method to edit a subscription invite link created by the bot. The bot must have the can\invite\users administrator rights. Returns the edited invite link as a ChatInviteLink object.revokeChatInviteLinkUse this method to revoke an invite link created by the bot. If the primary link is revoked, a new link is automatically generated. The bot must be an administrator in the chat for this to work and must have the appropriapproveChatJoinRequestUse this method to approve a chat join request. The bot must be an administrator in the chat for this to work and must have the can\invite\users administrator right. Returns True on success.declineChatJoinRequestUse this method to decline a chat join request. The bot must be an administrator in the chat for this to work and must have the can\invite\users administrator right. Returns True on success.answerChatJoinRequestQueryUse this method to process a received chat join request query. Returns True on success.sendChatJoinRequestWebAppUse this method to process a received chat join request query by showing a Mini App to the user before deciding the outcome. Call answerChatJoinRequestQuery to resolve the join request query based on the user interactionsetChatPhotoUse this method to set a new profile photo for the chat. Photos can't be changed for private chats. The bot must be an administrator in the chat for this to work and must have the appropriate administrator rights. ReturndeleteChatPhotoUse this method to delete a chat photo. Photos can't be changed for private chats. The bot must be an administrator in the chat for this to work and must have the appropriate administrator rights. Returns True on successsetChatTitleUse this method to change the title of a chat. Titles can't be changed for private chats. The bot must be an administrator in the chat for this to work and must have the appropriate administrator rights. Returns True on setChatDescriptionUse this method to change the description of a group, a supergroup or a channel. The bot must be an administrator in the chat for this to work and must have the appropriate administrator rights. Returns True on success.pinChatMessageUse this method to add a message to the list of pinned messages in a chat. In private chats and channel direct messages chats, all non-service messages can be pinned. Conversely, the bot must be an administrator with theunpinChatMessageUse this method to remove a message from the list of pinned messages in a chat. In private chats and channel direct messages chats, all messages can be unpinned. Conversely, the bot must be an administrator with the 'canunpinAllChatMessagesUse this method to clear the list of pinned messages in a chat. In private chats and channel direct messages chats, no additional rights are required to unpin all pinned messages. Conversely, the bot must be an administrleaveChatUse this method for your bot to leave a group, supergroup or channel. Returns True on success.getChatUse this method to get up-to-date information about the chat. Returns a ChatFullInfo object on success.getChatAdministratorsUse this method to get a list of administrators in a chat. Returns an Array of ChatMember objects.getChatMemberCountUse this method to get the number of members in a chat. Returns Integer on success.getChatMemberUse this method to get information about a member of a chat. The method is only guaranteed to work for other users if the bot is an administrator in the chat. Returns a ChatMember object on success.getChatShareThemeBackdropsUse this method to get the list of backdrops, which can be used as the background of a theme of the screen for sharing a link to a user or a chat. Requires no parameters. Returns a ChatShareThemeBackdrops object.getUserPersonalChatMessagesUse this method to get the last messages from the personal chat (i.e., the chat currently added to their profile) of a given user. On success, an Array of Message objects is returned.setChatStickerSetUse this method to set a new group sticker set for a supergroup. The bot must be an administrator in the chat for this to work and must have the appropriate administrator rights. Use the field can\set\sticker\set optionadeleteChatStickerSetUse this method to delete a group sticker set from a supergroup. The bot must be an administrator in the chat for this to work and must have the appropriate administrator rights. Use the field can\set\sticker\set optionagetForumTopicIconStickersUse this method to get custom emoji stickers, which can be used as a forum topic icon by any user. Requires no parameters. Returns an Array of Sticker objects.createForumTopicUse this method to create a topic in a forum supergroup chat or a private chat with a user. In the case of a supergroup chat the bot must be an administrator in the chat for this to work and must have the can\manage\topieditForumTopicUse this method to edit name and icon of a topic in a forum supergroup chat or a private chat with a user. In the case of a supergroup chat the bot must be an administrator in the chat for this to work and must have the closeForumTopicUse this method to close an open topic in a forum supergroup chat. The bot must be an administrator in the chat for this to work and must have the can\manage\topics administrator rights, unless it is the creator of the treopenForumTopicUse this method to reopen a closed topic in a forum supergroup chat. The bot must be an administrator in the chat for this to work and must have the can\manage\topics administrator rights, unless it is the creator of thedeleteForumTopicUse this method to delete a forum topic along with all its messages in a forum supergroup chat or a private chat with a user. In the case of a supergroup chat the bot must be an administrator in the chat for this to workunpinAllForumTopicMessagesUse this method to clear the list of pinned messages in a forum topic in a forum supergroup chat or a private chat with a user. In the case of a supergroup chat the bot must be an administrator in the chat for this to woeditGeneralForumTopicUse this method to edit the name of the 'General' topic in a forum supergroup chat. The bot must be an administrator in the chat for this to work and must have the can\manage\topics administrator rights. Returns True on closeGeneralForumTopicUse this method to close an open 'General' topic in a forum supergroup chat. The bot must be an administrator in the chat for this to work and must have the can\manage\topics administrator rights. Returns True on successreopenGeneralForumTopicUse this method to reopen a closed 'General' topic in a forum supergroup chat. The bot must be an administrator in the chat for this to work and must have the can\manage\topics administrator rights. The topic will be authideGeneralForumTopicUse this method to hide the 'General' topic in a forum supergroup chat. The bot must be an administrator in the chat for this to work and must have the can\manage\topics administrator rights. The topic will be automaticaunhideGeneralForumTopicUse this method to unhide the 'General' topic in a forum supergroup chat. The bot must be an administrator in the chat for this to work and must have the can\manage\topics administrator rights. Returns True on success.unpinAllGeneralForumTopicMessagesUse this method to clear the list of pinned messages in a General forum topic. The bot must be an administrator in the chat for this to work and must have the can\pin\messages administrator right in the supergroup. ReturanswerCallbackQueryUse this method to send answers to callback queries sent from inline keyboards. The answer will be displayed to the user as a notification at the top of the chat screen or as an alert. On success, True is returned.answerWidgetQueryUse this method to send an answer to a query from a widget. The query must be answered within 15 seconds. The answer is received only by the widget that sent the query and doesn't change data of the widget; use editMessaanswerGuestQueryUse this method to reply to a received guest message. On success, a SentGuestMessage object is returned.getUserChatBoostsUse this method to get the list of boosts added to a chat by a user. Requires administrator rights in the chat. Returns a UserChatBoosts object.getBusinessConnectionUse this method to get information about the connection of the bot with a business account. Returns a BusinessConnection object on success.getManagedBotTokenUse this method to get the token of a managed bot. Returns the token as String on success.replaceManagedBotTokenUse this method to revoke the current token of a managed bot and generate a new one. Returns the new token as String on success.getManagedBotAccessSettingsUse this method to get the access settings of a managed bot. Returns a BotAccessSettings object on success.setManagedBotAccessSettingsUse this method to change the access settings of a managed bot. Returns True on success.setMyCommandsUse this method to change the list of the bot's commands. See this manual for more details about bot commands. Returns True on success.deleteMyCommandsUse this method to delete the list of the bot's commands for the given scope and user language. After deletion, higher level commands will be shown to affected users. Returns True on success.getMyCommandsUse this method to get the current list of the bot's commands for the given scope and user language. Returns an Array of BotCommand objects. If commands aren't set, an empty list is returned.setMyNameUse this method to change the bot's name. Returns True on success.getMyNameUse this method to get the current bot name for the given user language. Returns BotName on success.setMyDescriptionUse this method to change the bot's description, which is shown in the chat with the bot if the chat is empty. Returns True on success.getMyDescriptionUse this method to get the current bot description for the given user language. Returns BotDescription on success.setMyShortDescriptionUse 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. Returns True on success.getMyShortDescriptionUse this method to get the current bot short description for the given user language. Returns BotShortDescription on success.setMyProfilePhotoChanges the profile photo of the bot. Returns True on success.removeMyProfilePhotoRemoves the profile photo of the bot. Requires no parameters. Returns True on success.setChatMenuButtonUse this method to change the bot's menu button in a private chat, or the default menu button. Returns True on success.getChatMenuButtonUse this method to get the current value of the bot's menu button in a private chat, or the default menu button. Returns MenuButton on success.setMyDefaultAdministratorRightsUse this method to change the default administrator rights requested by the bot when it's added as an administrator to groups or channels. These rights will be suggested to users, but they are free to modify the list befgetMyDefaultAdministratorRightsUse this method to get the current default administrator rights of the bot. Returns ChatAdministratorRights on success.getAvailableGiftsReturns the list of gifts that can be sent by the bot to users and channel chats. Requires no parameters. Returns a Gifts object.sendGiftSends a gift to the given user or channel chat. The gift can't be converted to Telegram Stars by the receiver. Returns True on success.giftPremiumSubscriptionGifts a Telegram Premium subscription to the given user. Returns True on success.verifyUserVerifies a user on behalf of the organization which is represented by the bot. Returns True on success.verifyChatVerifies a chat on behalf of the organization which is represented by the bot. Returns True on success.removeUserVerificationRemoves verification from a user who is currently verified on behalf of the organization represented by the bot. Returns True on success.removeChatVerificationRemoves verification from a chat that is currently verified on behalf of the organization represented by the bot. Returns True on success.readBusinessMessageMarks incoming message as read on behalf of a business account. Requires the can\read\messages business bot right. Returns True on success.deleteBusinessMessagesDelete messages on behalf of a business account. Requires the can\delete\sent\messages business bot right to delete messages sent by the bot itself, or the can\delete\all\messages business bot right to delete any messagesetBusinessAccountNameChanges the first and last name of a managed business account. Requires the can\change\name business bot right. Returns True on success.setBusinessAccountUsernameChanges the username of a managed business account. Requires the can\change\username business bot right. Returns True on success.setBusinessAccountBioChanges the bio of a managed business account. Requires the can\change\bio business bot right. Returns True on success.setBusinessAccountProfilePhotoChanges the profile photo of a managed business account. Requires the can\edit\profile\photo business bot right. Returns True on success.removeBusinessAccountProfilePhotoRemoves the current profile photo of a managed business account. Requires the can\edit\profile\photo business bot right. Returns True on success.setBusinessAccountGiftSettingsChanges the privacy settings pertaining to incoming gifts in a managed business account. Requires the can\change\gift\settings business bot right. Returns True on success.getBusinessAccountStarBalanceReturns the amount of Telegram Stars owned by a managed business account. Requires the can\view\gifts\and\stars business bot right. Returns StarAmount on success.transferBusinessAccountStarsTransfers Telegram Stars from the business account balance to the bot's balance. Requires the can\transfer\stars business bot right. Returns True on success.getBusinessAccountGiftsReturns the gifts received and owned by a managed business account. Requires the can\view\gifts\and\stars business bot right. Returns OwnedGifts on success.getUserGiftsReturns the gifts owned and hosted by a user. Returns OwnedGifts on success.getChatGiftsReturns the gifts owned by a chat. Returns OwnedGifts on success.getUniqueGiftUse this method to get information about a unique gift by its name. Returns a UniqueGift object on success.convertGiftToStarsConverts a given regular gift to Telegram Stars. Requires the can\convert\gifts\to\stars business bot right. Returns True on success.upgradeGiftUpgrades a given regular gift to a unique gift. Requires the can\transfer\and\upgrade\gifts business bot right. Additionally requires the can\transfer\stars business bot right if the upgrade is paid. Returns True on succtransferGiftTransfers an owned unique gift to another user. Requires the can\transfer\and\upgrade\gifts business bot right. Requires can\transfer\stars business bot right if the transfer is paid. Returns True on success.deleteBusinessAccountGiftDeletes a regular gift owned by a managed business account without receiving Telegram Stars for it. Requires the can\convert\gifts\to\stars business bot right. The gift can be deleted only if it isn't limited (the field postStoryPosts a story on behalf of a managed business account. Requires the can\manage\stories business bot right. Returns Story on success.repostStoryReposts a story on behalf of a business account from another business account. Both business accounts must be managed by the same bot, and the story on the source account must have been posted (or reposted) by the bot. ReditStoryEdits a story previously posted by the bot on behalf of a managed business account. Requires the can\manage\stories business bot right. Returns Story on success.deleteStoryDeletes a story previously posted by the bot on behalf of a managed business account. Requires the can\manage\stories business bot right. Returns True on success.answerWebAppQueryUse this method to 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. On success, a SentWebAppMessage object is returned.savePreparedInlineMessageStores a message that can be sent by a user of a Mini App. Returns a PreparedInlineMessage object.savePreparedKeyboardButtonStores a keyboard button that can be used by a user within a Mini App. Returns a PreparedKeyboardButton object.Inline mode methodsMethods and objects used in the inline mode are described in the Inline mode section.
Updating messages
Updating messagesThe following methods allow you to change an existing message in the message history instead of sending a new one with a result of an action. This is most useful for messages with inline keyboards using callback queries,editMessageTextUse this method to edit text, rich and game messages. On success, if the edited message is not an inline message, the edited Message is returned, otherwise True is returned. Note that business messages that were not senteditMessageCaptionUse this method to edit captions of messages. On success, if the edited message is not an inline message, the edited Message is returned, otherwise True is returned. Note that business messages that were not sent by the editMessageMediaUse this method to edit animation, audio, document, live photo, photo, or video messages, or to replace a text or a rich message with a media. If a message is part of a message album, then it can be edited only to an audeditMessageLiveLocationUse this method to edit live location messages. A location can be edited until its live\period expires or editing is explicitly disabled by a call to stopMessageLiveLocation. On success, if the edited message is not an istopMessageLiveLocationUse this method to stop updating a live location message before live\period expires. On success, if the message is not an inline message, the edited Message is returned, otherwise True is returned.editMessageChecklistUse this method to edit a checklist on behalf of a connected business account. On success, the edited Message is returned.editMessageWidgetDataUse this method to edit data of a widget in a message sent by the bot or via the bot (for inline bots). Public data of a shared widget can be changed at most once per second. On success, True is returned.editSharedWidgetDataUse this method to edit public data of a shared widget created by the bot. A shared widget can be edited at most once per second. On success, True is returned.editMessageReplyMarkupUse this method to edit only the reply markup of messages. On success, if the edited message is not an inline message, the edited Message is returned, otherwise True is returned. Note that business messages that were notstopPollUse this method to stop a poll which was sent by the bot. On success, the stopped Poll is returned.editEphemeralMessageTextUse this method to edit an ephemeral text or rich message. Note that it is not guaranteed that the user will receive the message edit event, especially if they are offline. On success, True is returned.editEphemeralMessageMediaUse this method to edit the media of an ephemeral message. Note that it is not guaranteed that the user will receive the message edit event, especially if they are offline. On success, True is returned.editEphemeralMessageCaptionUse this method to edit the caption of an ephemeral message. Note that it is not guaranteed that the user will receive the message edit event, especially if they are offline. On success, True is returned.editEphemeralMessageReplyMarkupUse this method to edit only the reply markup of an ephemeral message. Note that it is not guaranteed that the user will receive the message edit event, especially if they are offline. On success, True is returned.approveSuggestedPostUse this method to approve a suggested post in a direct messages chat. The bot must have the 'can\post\messages' administrator right in the corresponding channel chat. Returns True on success.declineSuggestedPostUse this method to decline a suggested post in a direct messages chat. The bot must have the 'can\manage\direct\messages' administrator right in the corresponding channel chat. Returns True on success.deleteMessageUse this method to delete a message, including service messages, with the following limitations:deleteMessagesUse this method to delete multiple messages simultaneously. If some of the specified messages can't be found, they are skipped. Returns True on success.deleteEphemeralMessageUse this method to delete an ephemeral message. Note that it is not guaranteed that the user will receive the message deletion event, especially if they are offline. Returns True on success.deleteMessageReactionUse this method to remove a reaction from a message in a group or a supergroup chat. The bot must have the 'can\delete\messages' administrator right in the chat. Returns True on success.deleteAllMessageReactionsUse this method to remove up to 10000 recent reactions in a group or a supergroup chat added by a given user or chat. The bot must have the 'can\delete\messages' administrator right in the chat. Returns True on success.
Stickers
StickersThe following methods and objects allow your bot to handle stickers and sticker sets.StickerThis object represents a sticker.StickerSetThis object represents a sticker set.MaskPositionThis object describes the position on faces where a mask should be placed by default.InputStickerThis object describes a sticker to be added to a sticker set.sendStickerUse this method to send static .WEBP, animated .TGS, or video .WEBM stickers. On success, the sent Message is returned.getStickerSetUse this method to get a sticker set. On success, a StickerSet object is returned.getCustomEmojiStickersUse this method to get information about custom emoji stickers by their identifiers. Returns an Array of Sticker objects.uploadStickerFileUse this method to upload a file with a sticker for later use in the createNewStickerSet, addStickerToSet, or replaceStickerInSet methods (the file can be used multiple times). Returns the uploaded File on success.createNewStickerSetUse this method to create a new sticker set owned by a user. The bot will be able to edit the sticker set thus created. Returns True on success.addStickerToSetUse this method to add a new sticker to a set created by the bot. Emoji sticker sets can have up to 200 stickers. Other sticker sets can have up to 120 stickers. Returns True on success.setStickerPositionInSetUse this method to move a sticker in a set created by the bot to a specific position. Returns True on success.deleteStickerFromSetUse this method to delete a sticker from a set created by the bot. Returns True on success.replaceStickerInSetUse this method to replace an existing sticker in a sticker set with a new one. The method is equivalent to calling deleteStickerFromSet, then addStickerToSet, then setStickerPositionInSet. Returns True on success.setStickerEmojiListUse this method to change the list of emoji assigned to a regular or custom emoji sticker. The sticker must belong to a sticker set created by the bot. Returns True on success.setStickerKeywordsUse this method to change search keywords assigned to a regular or custom emoji sticker. The sticker must belong to a sticker set created by the bot. Returns True on success.setStickerMaskPositionUse this method to change the mask position of a mask sticker. The sticker must belong to a sticker set that was created by the bot. Returns True on success.setStickerSetTitleUse this method to set the title of a created sticker set. Returns True on success.setStickerSetThumbnailUse this method to set the thumbnail of a regular or mask sticker set. The format of the thumbnail file must match the format of the stickers in the set. Returns True on success.setCustomEmojiStickerSetThumbnailUse this method to set the thumbnail of a custom emoji sticker set. Returns True on success.deleteStickerSetUse this method to delete a sticker set that was created by the bot. Returns True on success.
Rich messages
Rich messagesThe following methods and objects allow your bot to handle and send rich messages.Rich Message Formatting OptionsRich messages support advanced structured formatting options like headings, lists, tables, media, block quotations, collapsible blocks, footnotes, and formulas. Telegram clients will render them accordingly. You can specRichMessageRich formatted message.InputRichMessageDescribes a rich message to be sent. Exactly one of the fields html, markdown, or blocks must be used.InputRichMessageMediaDescribes a media element embedded in an outgoing rich message.sendRichMessageUse this method to send rich messages. If the message contains a block with a media element, then the bot must have the right to send the media to the chat. On success, the sent Message is returned.sendRichMessageDraftUse this method to stream a partial rich message to a user while the message is being generated. Note that the streamed draft is ephemeral and acts as a temporary 30-second preview - once the output is finalized, you musRichMessageButtonThis object represents a button in a RichMessage. Exactly one of the fields other than text and style must be used to specify the type of the button.RichTextThis object represents a rich formatted text. Currently, it can be either a String for plain text, an Array of RichText, or any of the following types:RichTextBoldA bold text.RichTextItalicAn italicized text.RichTextUnderlineAn underlined text.RichTextStrikethroughA strikethrough text.RichTextSpoilerA text covered by a spoiler.RichTextDateTimeFormatted date and time.RichTextTextMentionA mention of a Telegram user by their identifier.RichTextSubscriptA subscript text.RichTextSuperscriptA superscript text.RichTextMarkedA marked text.RichTextCodeA monowidth text.RichTextCustomEmojiA custom emoji.RichTextMathematicalExpressionA mathematical expression.RichTextUrlA text with a link.RichTextEmailAddressA text with an email address.RichTextPhoneNumberA text with a phone number.RichTextBankCardNumberA text with a bank card number.RichTextTonAddressAn address in the TON blockchain.RichTextMentionA mention by a username.RichTextHashtagA hashtag.RichTextCashtagA cashtag.RichTextBotCommandA bot command.RichTextButtonA button.RichTextAnchorAn anchor.RichTextAnchorLinkA link to an anchor.RichTextReferenceA reference.RichTextReferenceLinkA link to a reference.RichBlockCaptionCaption of a rich formatted block.RichBlockTableCellCell in a table.RichBlockListItemAn item of a list.RichBlockThis object represents a block in a rich formatted message. Currently, it can be any of the following types:RichBlockParagraphA text paragraph, corresponding to the HTML tag <p>.RichBlockSectionHeadingA section heading, corresponding to the HTML tags <h1>, <h2>, <h3>, <h4>, <h5>, or <h6>.RichBlockPreformattedA preformatted text block, corresponding to the nested HTML tags <pre> and <code>.RichBlockFooterA footer, corresponding to the HTML tag <footer>.RichBlockDividerA divider, corresponding to the HTML tag <hr/>.RichBlockMathematicalExpressionA block with a mathematical expression in LaTeX format, corresponding to the custom HTML tag <tg-math-block>.RichBlockAnchorA block with an anchor, corresponding to the HTML tag <a> with the attribute name.RichBlockListA list of blocks, corresponding to the HTML tag <ul> or <ol> with multiple nested tags <li>.RichBlockBlockQuotationA block quotation, corresponding to the HTML tag <blockquote>.RichBlockExpandableBlockQuotationA block quotation, corresponding to the HTML tag <blockquote> with custom attribute "expandable".RichBlockPullQuotationA quotation with centered text, loosely corresponding to the HTML tag <aside>.RichBlockCollageA collage, corresponding to the custom HTML tag <tg-collage>.RichBlockSlideshowA slideshow, corresponding to the custom HTML tag <tg-slideshow>.RichBlockTableA table, corresponding to the HTML tag <table>.RichBlockDetailsAn expandable block for details disclosure, corresponding to the HTML tag <details>.RichBlockMapA block with a map, corresponding to the custom HTML tag <tg-map>.RichBlockButtonsA block containing a list of buttons that are shown in one row, corresponding to the custom HTML tag <tg-button-row>.RichBlockAnimationA block with an animation, corresponding to the HTML tag <video>.RichBlockAudioA block with a music file, corresponding to the HTML tag <audio>.RichBlockDocumentA block with a general file, corresponding to the custom HTML tag <tg-document>.RichBlockPhotoA block with a photo, corresponding to the HTML tag <img>.RichBlockVideoA block with a video, corresponding to the HTML tag <video>.RichBlockVoiceNoteA block with a voice note, corresponding to the HTML tag <audio>.RichBlockThinkingA block with a “Thinking…” placeholder, corresponding to the custom HTML tag <tg-thinking>. The block may be used only in sendRichMessageDraft, therefore it can't be received in messages. See <https://t.me/addemoji/AIActInputRichBlockListItemAn item of a list to be sent.InputRichBlockThis object represents a block in a rich formatted message to be sent. Currently, it can be any of the following types:InputRichBlockParagraphA text paragraph, corresponding to the HTML tag <p>.InputRichBlockSectionHeadingA section heading, corresponding to the HTML tags <h1>, <h2>, <h3>, <h4>, <h5>, or <h6>.InputRichBlockPreformattedA preformatted text block, corresponding to the nested HTML tags <pre> and <code>.InputRichBlockFooterA footer, corresponding to the HTML tag <footer>.InputRichBlockDividerA divider, corresponding to the HTML tag <hr/>.InputRichBlockMathematicalExpressionA block with a mathematical expression in LaTeX format, corresponding to the custom HTML tag <tg-math-block>.InputRichBlockAnchorA block with an anchor, corresponding to the HTML tag <a> with the attribute name.InputRichBlockListA list of blocks, corresponding to the HTML tag <ul> or <ol> with multiple nested tags <li>.InputRichBlockBlockQuotationA block quotation, corresponding to the HTML tag <blockquote>.InputRichBlockExpandableBlockQuotationA block quotation, corresponding to the HTML tag <blockquote> with custom attribute "expandable".InputRichBlockPullQuotationA quotation with centered text, loosely corresponding to the HTML tag <aside>.InputRichBlockCollageA collage, corresponding to the custom HTML tag <tg-collage>.InputRichBlockSlideshowA slideshow, corresponding to the custom HTML tag <tg-slideshow>.InputRichBlockTableA table, corresponding to the HTML tag <table>.InputRichBlockDetailsAn expandable block for details disclosure, corresponding to the HTML tag <details>.InputRichBlockMapA block with a map, corresponding to the custom HTML tag <tg-map>. The map's width and height must not exceed 10000 in total. The width and height ratio must be at most 20.InputRichBlockButtonsA block containing a list of buttons that are shown in one row, corresponding to the custom HTML tag <tg-button-row>.InputRichBlockAnimationA block with an animation, corresponding to the HTML tag <video>.InputRichBlockAudioA block with a music file, corresponding to the HTML tag <audio>.InputRichBlockDocumentA block with a general file, corresponding to the custom HTML tag <tg-document>.InputRichBlockPhotoA block with a photo, corresponding to the HTML tag <img>.InputRichBlockVideoA block with a video, corresponding to the HTML tag <video>.InputRichBlockVoiceNoteA block with a voice note, corresponding to the HTML tag <audio>.InputRichBlockThinkingA block with a “Thinking…” placeholder, corresponding to the custom HTML tag <tg-thinking>. The block may be used only in sendRichMessageDraft, therefore it can't be received in messages. See <https://t.me/addemoji/AIAct
Inline mode
Inline modeThe following methods and objects allow your bot to work in inline mode.InlineQueryThis object represents an incoming inline query. When the user sends an empty query, your bot could return some default or trending results.answerInlineQueryUse this method to send answers to an inline query. On success, True is returned.InlineQueryResultsButtonThis object represents a button to be shown above inline query results. You must use exactly one of the optional fields.InlineQueryResultThis object represents one result of an inline query. Telegram clients currently support results of the following 20 types:InlineQueryResultArticleRepresents a link to an article or web page.InlineQueryResultPhotoRepresents a link to a photo. By default, this photo will be sent by the user with optional caption. Alternatively, you can use input\message\content to send a message with the specified content instead of the photo.InlineQueryResultGifRepresents a link to an animated GIF file. By default, this animated GIF file will be sent by the user with optional caption. Alternatively, you can use input\message\content to send a message with the specified content InlineQueryResultMpeg4GifRepresents a link to a video animation (H.264/MPEG-4 AVC video without sound). By default, this animated MPEG-4 file will be sent by the user with optional caption. Alternatively, you can use input\message\content to senInlineQueryResultVideoRepresents a link to a page containing an embedded video player or a video file. By default, this video file will be sent by the user with an optional caption. Alternatively, you can use input\message\content to send a mInlineQueryResultAudioRepresents a link to an MP3 audio file. By default, this audio file will be sent by the user. Alternatively, you can use input\message\content to send a message with the specified content instead of the audio.InlineQueryResultVoiceRepresents a link to a voice recording in an .OGG container encoded with OPUS. By default, this voice recording will be sent by the user. Alternatively, you can use input\message\content to send a message with the specifInlineQueryResultDocumentRepresents a link to a file. By default, this file will be sent by the user with an optional caption. Alternatively, you can use input\message\content to send a message with the specified content instead of the file. CurInlineQueryResultLocationRepresents a location on a map. By default, the location will be sent by the user. Alternatively, you can use input\message\content to send a message with the specified content instead of the location.InlineQueryResultVenueRepresents a venue. By default, the venue will be sent by the user. Alternatively, you can use input\message\content to send a message with the specified content instead of the venue.InlineQueryResultContactRepresents a contact with a phone number. By default, this contact will be sent by the user. Alternatively, you can use input\message\content to send a message with the specified content instead of the contact.InlineQueryResultGameRepresents a Game.InlineQueryResultCachedPhotoRepresents a link to a photo stored on the Telegram servers. By default, this photo will be sent by the user with an optional caption. Alternatively, you can use input\message\content to send a message with the specifiedInlineQueryResultCachedGifRepresents a link to an animated GIF file stored on the Telegram servers. By default, this animated GIF file will be sent by the user with an optional caption. Alternatively, you can use input\message\content to send a mInlineQueryResultCachedMpeg4GifRepresents a link to a video animation (H.264/MPEG-4 AVC video without sound) stored on the Telegram servers. By default, this animated MPEG-4 file will be sent by the user with an optional caption. Alternatively, you caInlineQueryResultCachedStickerRepresents a link to a sticker stored on the Telegram servers. By default, this sticker will be sent by the user. Alternatively, you can use input\message\content to send a message with the specified content instead of tInlineQueryResultCachedDocumentRepresents a link to a file stored on the Telegram servers. By default, this file will be sent by the user with an optional caption. Alternatively, you can use input\message\content to send a message with the specified cInlineQueryResultCachedVideoRepresents a link to a video file stored on the Telegram servers. By default, this video file will be sent by the user with an optional caption. Alternatively, you can use input\message\content to send a message with theInlineQueryResultCachedVoiceRepresents a link to a voice message stored on the Telegram servers. By default, this voice message will be sent by the user. Alternatively, you can use input\message\content to send a message with the specified content InlineQueryResultCachedAudioRepresents a link to an MP3 audio file stored on the Telegram servers. By default, this audio file will be sent by the user. Alternatively, you can use input\message\content to send a message with the specified content iInputMessageContentThis object represents the content of a message to be sent as a result of an inline query. Telegram clients currently support the following types:InputTextMessageContentRepresents the content of a text message to be sent as the result of an inline query.InputRichMessageContentRepresents the content of a rich message to be sent as the result of an inline query.InputLocationMessageContentRepresents the content of a location message to be sent as the result of an inline query.InputVenueMessageContentRepresents the content of a venue message to be sent as the result of an inline query.InputContactMessageContentRepresents the content of a contact message to be sent as the result of an inline query.InputInvoiceMessageContentRepresents the content of an invoice message to be sent as the result of an inline query.InputWidgetMessageContentRepresents the content of a message with an HTML widget to be sent as the result of an inline query. Currently, widgets can't be sent in response to inline queries in the production environment.InputSharedWidgetMessageContentRepresents the content of a message with a shared widget to be sent as the result of an inline query. Currently, widgets can't be sent in response to inline queries in the production environment.ChosenInlineResultRepresents a result of an inline query that was chosen by the user and sent to their chat partner.
Payments
PaymentsYour bot can accept payments from Telegram users. Please see the introduction to payments for more details on the process and how to set up payments for your bot.sendInvoiceUse this method to send invoices. On success, the sent Message is returned.createInvoiceLinkUse this method to create a link for an invoice. Returns the created invoice link as String on success.answerShippingQueryIf you sent an invoice requesting a shipping address and the parameter is\flexible was specified, the Bot API will send an Update with a shipping\query field to the bot. Use this method to reply to shipping queries. On sanswerPreCheckoutQueryOnce the user has confirmed their payment and shipping details, the Bot API sends the final confirmation in the form of an Update with the field pre\checkout\query. Use this method to respond to such pre-checkout queriesgetMyStarBalanceA method to get the current Telegram Stars balance of the bot. Requires no parameters. On success, returns a StarAmount object.getStarTransactionsReturns the bot's Telegram Star transactions in chronological order. On success, returns a StarTransactions object.refundStarPaymentRefunds a successful payment in Telegram Stars. Returns True on success.editUserStarSubscriptionAllows the bot to cancel or re-enable extension of a subscription paid in Telegram Stars. Returns True on success.LabeledPriceThis object represents a portion of the price for goods or services.InvoiceThis object contains basic information about an invoice.ShippingAddressThis object represents a shipping address.OrderInfoThis object represents information about an order.ShippingOptionThis object represents one shipping option.SuccessfulPaymentThis object contains basic information about a successful payment. Note that if the buyer initiates a chargeback with the relevant payment provider following this transaction, the funds may be debited from your balance. RefundedPaymentThis object contains basic information about a refunded payment.ShippingQueryThis object contains information about an incoming shipping query.PreCheckoutQueryThis object contains information about an incoming pre-checkout query.PaidMediaPurchasedThis object contains information about a paid media purchase.RevenueWithdrawalStateThis object describes the state of a revenue withdrawal operation. Currently, it can be one ofRevenueWithdrawalStatePendingThe withdrawal is in progress.RevenueWithdrawalStateSucceededThe withdrawal succeeded.RevenueWithdrawalStateFailedThe withdrawal failed and the transaction was refunded.AffiliateInfoContains information about the affiliate that received a commission via this transaction.TransactionPartnerThis object describes the source of a transaction, or its recipient for outgoing transactions. Currently, it can be one ofTransactionPartnerUserDescribes a transaction with a user.TransactionPartnerChatDescribes a transaction with a chat.TransactionPartnerAffiliateProgramDescribes the affiliate program that issued the affiliate commission received via this transaction.TransactionPartnerFragmentDescribes a withdrawal transaction with Fragment.TransactionPartnerTelegramAdsDescribes a withdrawal transaction to the Telegram Ads platform.TransactionPartnerTelegramApiDescribes a transaction with payment for paid broadcasting.TransactionPartnerOtherDescribes a transaction with an unknown source or recipient.StarTransactionDescribes a Telegram Star transaction. Note that if the buyer initiates a chargeback with the payment provider from whom they acquired Stars (e.g., Apple, Google) following this transaction, the refunded Stars will be deStarTransactionsContains a list of Telegram Star transactions.
Telegram Passport
Telegram PassportTelegram Passport is a unified authorization method for services that require personal identification. Users can upload their documents once, then instantly share their data with services that require real-world ID (finaPassportDataDescribes Telegram Passport data shared with the bot by the user.PassportFileThis object represents a file uploaded to Telegram Passport. Currently all Telegram Passport files are in JPEG format when decrypted and don't exceed 10MB.EncryptedPassportElementDescribes documents or other Telegram Passport elements shared with the bot by the user.EncryptedCredentialsDescribes data required for decrypting and authenticating EncryptedPassportElement. See the Telegram Passport Documentation for a complete description of the data decryption and authentication processes.setPassportDataErrorsInforms a user that some of the Telegram Passport elements they provided contains errors. The user will not be able to re-submit their Passport to you until the errors are fixed (the contents of the field for which you rPassportElementErrorThis object represents an error in the Telegram Passport element which was submitted that should be resolved by the user. It should be one of:PassportElementErrorDataFieldRepresents an issue in one of the data fields that was provided by the user. The error is considered resolved when the field's value changes.PassportElementErrorFrontSideRepresents an issue with the front side of a document. The error is considered resolved when the file with the front side of the document changes.PassportElementErrorReverseSideRepresents an issue with the reverse side of a document. The error is considered resolved when the file with reverse side of the document changes.PassportElementErrorSelfieRepresents an issue with the selfie with a document. The error is considered resolved when the file with the selfie changes.PassportElementErrorFileRepresents an issue with a document scan. The error is considered resolved when the file with the document scan changes.PassportElementErrorFilesRepresents an issue with a list of scans. The error is considered resolved when the list of files containing the scans changes.PassportElementErrorTranslationFileRepresents an issue with one of the files that constitute the translation of a document. The error is considered resolved when the file changes.PassportElementErrorTranslationFilesRepresents an issue with the translated version of a document. The error is considered resolved when a file with the document translation change.PassportElementErrorUnspecifiedRepresents an issue in an unspecified place. The error is considered resolved when new data is added.
Games
GamesYour bot can offer users HTML5 games to play solo or to compete against each other in groups and one-on-one chats. Create games via @BotFather using the /newgame command. Please note that this kind of power requires respsendGameUse this method to send a game. On success, the sent Message is returned.GameThis object represents a game. Use BotFather to create and edit games, their short names will act as unique identifiers.CallbackGameA placeholder, currently holds no information. Use BotFather to set up your game.setGameScoreUse this method to set the score of the specified user in a game message. On success, if the message is not an inline message, the Message is returned, otherwise True is returned. Returns an error, if the new score is nogetGameHighScoresUse this method to get data for high score tables. Will return the score of the specified user and several of their neighbors in a game. Returns an Array of GameHighScore objects.GameHighScoreThis object represents one row of the high scores table for a game.