diff --git a/api/enums.gen.go b/api/enums.gen.go index 6086f20..0170f4c 100644 --- a/api/enums.gen.go +++ b/api/enums.gen.go @@ -41,6 +41,14 @@ const ( BotSubscriptionUpdatedStateFailed BotSubscriptionUpdatedState = "failed" ) +type CallbackQueryMode string + +const ( + CallbackQueryModeDefault CallbackQueryMode = "default" + CallbackQueryModeAuto CallbackQueryMode = "auto" + CallbackQueryModeInline CallbackQueryMode = "inline" +) + type ChatBoostSourceKind string const ( @@ -60,6 +68,13 @@ const ( ChatMemberStatusKicked ChatMemberStatus = "kicked" ) +type ChatShareThemeType string + +const ( + ChatShareThemeTypeEmoji ChatShareThemeType = "emoji" + ChatShareThemeTypeUniqueGift ChatShareThemeType = "unique_gift" +) + type ChatType string const ( @@ -69,6 +84,13 @@ const ( ChatTypeChannel ChatType = "channel" ) +type EmojiTypeKind string + +const ( + EmojiTypeKindEmoji EmojiTypeKind = "emoji" + EmojiTypeKindCustomEmoji EmojiTypeKind = "custom_emoji" +) + type EncryptedPassportElementType string const ( @@ -267,6 +289,8 @@ const ( MessageEntityTypeURL MessageEntityType = "url" MessageEntityTypeEmail MessageEntityType = "email" MessageEntityTypePhoneNumber MessageEntityType = "phone_number" + MessageEntityTypeBankCardNumber MessageEntityType = "bank_card_number" + MessageEntityTypeTonAddress MessageEntityType = "ton_address" MessageEntityTypeBold MessageEntityType = "bold" MessageEntityTypeItalic MessageEntityType = "italic" MessageEntityTypeUnderline MessageEntityType = "underline" @@ -501,6 +525,7 @@ const ( RichTextTypeEmailAddress RichTextType = "email_address" RichTextTypePhoneNumber RichTextType = "phone_number" RichTextTypeBankCardNumber RichTextType = "bank_card_number" + RichTextTypeTonAddress RichTextType = "ton_address" RichTextTypeMention RichTextType = "mention" RichTextTypeHashtag RichTextType = "hashtag" RichTextTypeCashtag RichTextType = "cashtag" @@ -592,3 +617,11 @@ const ( UniqueGiftModelRarityEpic UniqueGiftModelRarity = "epic" UniqueGiftModelRarityLegendary UniqueGiftModelRarity = "legendary" ) + +type WidgetQueryTypeKind string + +const ( + WidgetQueryTypeKindData WidgetQueryTypeKind = "data" + WidgetQueryTypeKindSignData WidgetQueryTypeKind = "sign_data" + WidgetQueryTypeKindSentTransaction WidgetQueryTypeKind = "sent_transaction" +) diff --git a/api/me.go b/api/me.go index 58c1803..52dc1e0 100644 --- a/api/me.go +++ b/api/me.go @@ -8,7 +8,7 @@ import ( ) // MeCache caches the result of GetMe across calls. Construct one per -// Bot and call Get to retrieve the cached User on subsequent invocations. +// Bot and call Get to retrieve the cached BotFullInfo on subsequent invocations. // // var meCache api.MeCache // me, err := meCache.Get(ctx, bot) @@ -16,12 +16,12 @@ import ( // MeCache is safe for concurrent use. type MeCache struct { mu sync.Mutex - cached *User + cached *BotFullInfo } -// Get returns the User from a cached GetMe call. If the cache is empty, +// Get returns the BotFullInfo from a cached GetMe call. If the cache is empty, // it calls GetMe and populates the cache on success. -func (c *MeCache) Get(ctx context.Context, b *client.Bot) (*User, error) { +func (c *MeCache) Get(ctx context.Context, b *client.Bot) (*BotFullInfo, error) { c.mu.Lock() if c.cached != nil { u := c.cached diff --git a/api/methods.gen.go b/api/methods.gen.go index 074449c..d3c9d0e 100644 --- a/api/methods.gen.go +++ b/api/methods.gen.go @@ -24,7 +24,7 @@ type GetUpdatesParams struct { Offset *int64 `json:"offset,omitempty"` // Limits the number of updates to be retrieved. Values between 1-100 are accepted. Defaults to 100. Limit *int64 `json:"limit,omitempty"` - // Timeout in seconds for long polling. Defaults to 0, i.e. usual short polling. Should be positive, short polling should be used for testing purposes only. + // Timeout in seconds for long polling. Defaults to 0, i.e. usual short polling. Should be positive; short polling should be used for testing purposes only. Timeout *int64 `json:"timeout,omitempty"` // A JSON-serialized list of the update types you want your bot to receive. For example, specify ["message", "edited_channel_post", "callback_query"] to only receive updates of these types. See Update for a complete list of available update types. Specify an empty list to receive all update types except chat_member, message_reaction, and message_reaction_count (default). If not specified, the previous setting will be used.Please note that this parameter doesn't affect updates created before the call to getUpdates, so unwanted updates may be received for a short period of time. AllowedUpdates []UpdateType `json:"allowed_updates,omitempty"` @@ -40,9 +40,9 @@ func GetUpdates(ctx context.Context, b *client.Bot, p *GetUpdatesParams) ([]Upda // SetWebhookParams is the parameter set for SetWebhook. // -// Use 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 Update. In case of an unsuccessful request (a request with response HTTP status code different from 2XY), we will repeat the request and give up after a reasonable amount of attempts. Returns True on success. +// Use 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 Update. In case of an unsuccessful request (a request with response HTTP status code different from 2XY), we will repeat the request and give up after a reasonable number of attempts. Returns True on success. // If you'd like to make sure that the webhook was set by you, you can specify secret data in the parameter secret_token. If specified, the request will contain a header “X-Telegram-Bot-Api-Secret-Token” with the secret token as content. -// Notes1. You will not be able to receive updates using getUpdates for as long as an outgoing webhook is set up.2. To use a self-signed certificate, you need to upload your public key certificate using certificate parameter. Please upload as InputFile, sending a String will not work.3. Ports currently supported for webhooks: 443, 80, 88, 8443. +// Notes1. You will not be able to receive updates using getUpdates for as long as an outgoing webhook is set up.2. To use a self-signed certificate, you need to upload your public key certificate using the certificate parameter. Please upload it as InputFile; sending a String will not work.3. Ports currently supported for webhooks: 443, 80, 88, 8443. // If you're having any trouble setting up webhooks, please check out this amazing guide to webhooks. type SetWebhookParams struct { // HTTPS URL to send updates to. Use an empty string to remove webhook integration. @@ -53,7 +53,7 @@ type SetWebhookParams struct { IPAddress string `json:"ip_address,omitempty"` // The maximum allowed number of simultaneous HTTPS connections to the webhook for update delivery, 1-100. Defaults to 40. Use lower values to limit the load on your bot's server, and higher values to increase your bot's throughput. MaxConnections *int64 `json:"max_connections,omitempty"` - // A JSON-serialized list of the update types you want your bot to receive. For example, specify ["message", "edited_channel_post", "callback_query"] to only receive updates of these types. See Update for a complete list of available update types. Specify an empty list to receive all update types except chat_member, message_reaction, and message_reaction_count (default). If not specified, the previous setting will be used.Please note that this parameter doesn't affect updates created before the call to the setWebhook, so unwanted updates may be received for a short period of time. + // A JSON-serialized list of the update types you want your bot to receive. For example, specify ["message", "edited_channel_post", "callback_query"] to only receive updates of these types. See Update for a complete list of available update types. Specify an empty list to receive all update types except chat_member, message_reaction, and message_reaction_count (default). If not specified, the previous setting will be used.Please note that this parameter doesn't affect updates created before the call to setWebhook, so unwanted updates may be received for a short period of time. AllowedUpdates []UpdateType `json:"allowed_updates,omitempty"` // Pass True to drop all pending updates DropPendingUpdates *bool `json:"drop_pending_updates,omitempty"` @@ -108,9 +108,9 @@ func (p *SetWebhookParams) MultipartFiles() []client.MultipartFile { // SetWebhook calls the setWebhook Telegram Bot API method. // -// Use 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 Update. In case of an unsuccessful request (a request with response HTTP status code different from 2XY), we will repeat the request and give up after a reasonable amount of attempts. Returns True on success. +// Use 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 Update. In case of an unsuccessful request (a request with response HTTP status code different from 2XY), we will repeat the request and give up after a reasonable number of attempts. Returns True on success. // If you'd like to make sure that the webhook was set by you, you can specify secret data in the parameter secret_token. If specified, the request will contain a header “X-Telegram-Bot-Api-Secret-Token” with the secret token as content. -// Notes1. You will not be able to receive updates using getUpdates for as long as an outgoing webhook is set up.2. To use a self-signed certificate, you need to upload your public key certificate using certificate parameter. Please upload as InputFile, sending a String will not work.3. Ports currently supported for webhooks: 443, 80, 88, 8443. +// Notes1. You will not be able to receive updates using getUpdates for as long as an outgoing webhook is set up.2. To use a self-signed certificate, you need to upload your public key certificate using the certificate parameter. Please upload it as InputFile; sending a String will not work.3. Ports currently supported for webhooks: 443, 80, 88, 8443. // If you're having any trouble setting up webhooks, please check out this amazing guide to webhooks. func SetWebhook(ctx context.Context, b *client.Bot, p *SetWebhookParams) (bool, error) { return client.Call[*SetWebhookParams, bool](ctx, b, "setWebhook", p) @@ -133,39 +133,39 @@ func DeleteWebhook(ctx context.Context, b *client.Bot, p *DeleteWebhookParams) ( // GetWebhookInfoParams is the parameter set for GetWebhookInfo. // -// Use 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. +// Use this method to get the current webhook status. Requires no parameters. On success, returns a WebhookInfo object. If the bot is using getUpdates, it will return an object with the url field empty. type GetWebhookInfoParams struct { } // GetWebhookInfo calls the getWebhookInfo Telegram Bot API method. // -// Use 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. +// Use this method to get the current webhook status. Requires no parameters. On success, returns a WebhookInfo object. If the bot is using getUpdates, it will return an object with the url field empty. func GetWebhookInfo(ctx context.Context, b *client.Bot, p *GetWebhookInfoParams) (*WebhookInfo, error) { return client.Call[*GetWebhookInfoParams, *WebhookInfo](ctx, b, "getWebhookInfo", p) } // GetMeParams is the parameter set for GetMe. // -// A simple method for testing your bot's authentication token. Requires no parameters. Returns basic information about the bot in form of a User object. +// A simple method for testing your bot's authentication token. Requires no parameters. Returns information about the bot in the form of a BotFullInfo object. type GetMeParams struct { } // GetMe calls the getMe Telegram Bot API method. // -// A simple method for testing your bot's authentication token. Requires no parameters. Returns basic information about the bot in form of a User object. -func GetMe(ctx context.Context, b *client.Bot, p *GetMeParams) (*User, error) { - return client.Call[*GetMeParams, *User](ctx, b, "getMe", p) +// A simple method for testing your bot's authentication token. Requires no parameters. Returns information about the bot in the form of a BotFullInfo object. +func GetMe(ctx context.Context, b *client.Bot, p *GetMeParams) (*BotFullInfo, error) { + return client.Call[*GetMeParams, *BotFullInfo](ctx, b, "getMe", p) } // LogOutParams is the parameter set for LogOut. // -// Use 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 successful call, you can immediately log in on a local server, but will not be able to log in back to the cloud Bot API server for 10 minutes. Returns True on success. Requires no parameters. +// Use 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 successful call, you can immediately log in on a local server, but will not be able to log back in to the cloud Bot API server for 10 minutes. Returns True on success. Requires no parameters. type LogOutParams struct { } // LogOut calls the logOut Telegram Bot API method. // -// Use 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 successful call, you can immediately log in on a local server, but will not be able to log in back to the cloud Bot API server for 10 minutes. Returns True on success. Requires no parameters. +// Use 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 successful call, you can immediately log in on a local server, but will not be able to log back in to the cloud Bot API server for 10 minutes. Returns True on success. Requires no parameters. func LogOut(ctx context.Context, b *client.Bot, p *LogOutParams) (bool, error) { return client.Call[*LogOutParams, bool](ctx, b, "logOut", p) } @@ -189,8 +189,8 @@ func Close(ctx context.Context, b *client.Bot, p *CloseParams) (bool, error) { type SendMessageParams struct { // Unique identifier of the business connection on behalf of which the message will be sent BusinessConnectionID string `json:"business_connection_id,omitempty"` - // Unique identifier for the target chat or username of the target bot, supergroup or channel in the format @username - ChatID ChatID `json:"chat_id"` + // Unique identifier for the target chat or username of the target bot, supergroup, or channel in the format @username; required unless the message is sent as an ephemeral reply to a callback query + ChatID *ChatID `json:"chat_id,omitempty"` // Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only MessageThreadID *int64 `json:"message_thread_id,omitempty"` // Identifier of the direct messages topic to which the message will be sent; required if the message is sent to a direct messages chat @@ -232,13 +232,13 @@ func SendMessage(ctx context.Context, b *client.Bot, p *SendMessageParams) (*Mes // // Use 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. type ForwardMessageParams struct { - // Unique identifier for the target chat or username of the target bot, supergroup or channel in the format @username + // Unique identifier for the target chat or username of the target bot, supergroup, or channel in the format @username ChatID ChatID `json:"chat_id"` // Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only MessageThreadID *int64 `json:"message_thread_id,omitempty"` // Identifier of the direct messages topic to which the message will be forwarded; required if the message is forwarded to a direct messages chat DirectMessagesTopicID *int64 `json:"direct_messages_topic_id,omitempty"` - // Unique identifier for the chat where the original message was sent (or username of the target bot, supergroup or channel in the format @username) + // Unique identifier for the chat where the original message was sent (or username of the target bot, supergroup, or channel in the format @username) FromChatID ChatID `json:"from_chat_id"` // New start timestamp for the forwarded video in the message VideoStartTimestamp *int64 `json:"video_start_timestamp,omitempty"` @@ -265,13 +265,13 @@ func ForwardMessage(ctx context.Context, b *client.Bot, p *ForwardMessageParams) // // Use 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 grouping is kept for forwarded messages. On success, an Array of MessageId of the sent messages is returned. type ForwardMessagesParams struct { - // Unique identifier for the target chat or username of the target bot, supergroup or channel in the format @username + // Unique identifier for the target chat or username of the target bot, supergroup, or channel in the format @username ChatID ChatID `json:"chat_id"` // Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only MessageThreadID *int64 `json:"message_thread_id,omitempty"` // Identifier of the direct messages topic to which the messages will be forwarded; required if the messages are forwarded to a direct messages chat DirectMessagesTopicID *int64 `json:"direct_messages_topic_id,omitempty"` - // Unique identifier for the chat where the original messages were sent (or username of the target bot, supergroup or channel in the format @username) + // Unique identifier for the chat where the original messages were sent (or username of the target bot, supergroup, or channel in the format @username) FromChatID ChatID `json:"from_chat_id"` // A JSON-serialized list of 1-100 identifiers of messages in the chat from_chat_id to forward. The identifiers must be specified in a strictly increasing order. MessageIds []int64 `json:"message_ids"` @@ -290,15 +290,15 @@ func ForwardMessages(ctx context.Context, b *client.Bot, p *ForwardMessagesParam // CopyMessageParams is the parameter set for CopyMessage. // -// Use this method to copy messages of any kind. Service messages, paid media messages, giveaway messages, giveaway winners messages, and invoice messages can't be copied. A quiz poll can be copied only if the value of the field correct_option_ids is known to the bot. The method is analogous to the method forwardMessage, but the copied message doesn't have a link to the original message. Returns the MessageId of the sent message on success. +// Use 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 the value of the field correct_option_ids is known to the bot. The method is analogous to the method forwardMessage, but the copied message doesn't have a link to the original message. Returns the MessageId of the sent message on success. type CopyMessageParams struct { - // Unique identifier for the target chat or username of the target bot, supergroup or channel in the format @username + // Unique identifier for the target chat or username of the target bot, supergroup, or channel in the format @username ChatID ChatID `json:"chat_id"` // Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only MessageThreadID *int64 `json:"message_thread_id,omitempty"` // Identifier of the direct messages topic to which the message will be sent; required if the message is sent to a direct messages chat DirectMessagesTopicID *int64 `json:"direct_messages_topic_id,omitempty"` - // Unique identifier for the chat where the original message was sent (or username of the target bot, supergroup or channel in the format @username) + // Unique identifier for the chat where the original message was sent (or username of the target bot, supergroup, or channel in the format @username) FromChatID ChatID `json:"from_chat_id"` // Message identifier in the chat specified in from_chat_id MessageID int64 `json:"message_id"` @@ -330,22 +330,22 @@ type CopyMessageParams struct { // CopyMessage calls the copyMessage Telegram Bot API method. // -// Use this method to copy messages of any kind. Service messages, paid media messages, giveaway messages, giveaway winners messages, and invoice messages can't be copied. A quiz poll can be copied only if the value of the field correct_option_ids is known to the bot. The method is analogous to the method forwardMessage, but the copied message doesn't have a link to the original message. Returns the MessageId of the sent message on success. +// Use 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 the value of the field correct_option_ids is known to the bot. The method is analogous to the method forwardMessage, but the copied message doesn't have a link to the original message. Returns the MessageId of the sent message on success. func CopyMessage(ctx context.Context, b *client.Bot, p *CopyMessageParams) (*MessageId, error) { return client.Call[*CopyMessageParams, *MessageId](ctx, b, "copyMessage", p) } // CopyMessagesParams is the parameter set for CopyMessages. // -// Use 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, and invoice messages can't be copied. A quiz poll can be copied only if the value of the field correct_option_ids is known to the bot. The method is analogous to the method forwardMessages, but the copied messages don't have a link to the original message. Album grouping is kept for copied messages. On success, an Array of MessageId of the sent messages is returned. +// Use 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 messages, and widget messages can't be copied. A quiz poll can be copied only if the value of the field correct_option_ids is known to the bot. The method is analogous to the method forwardMessages, but the copied messages don't have a link to the original message. Album grouping is kept for copied messages. On success, an Array of MessageId of the sent messages is returned. type CopyMessagesParams struct { - // Unique identifier for the target chat or username of the target bot, supergroup or channel in the format @username + // Unique identifier for the target chat or username of the target bot, supergroup, or channel in the format @username ChatID ChatID `json:"chat_id"` // Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only MessageThreadID *int64 `json:"message_thread_id,omitempty"` // Identifier of the direct messages topic to which the messages will be sent; required if the messages are sent to a direct messages chat DirectMessagesTopicID *int64 `json:"direct_messages_topic_id,omitempty"` - // Unique identifier for the chat where the original messages were sent (or username of the target bot, supergroup or channel in the format @username) + // Unique identifier for the chat where the original messages were sent (or username of the target bot, supergroup, or channel in the format @username) FromChatID ChatID `json:"from_chat_id"` // A JSON-serialized list of 1-100 identifiers of messages in the chat from_chat_id to copy. The identifiers must be specified in a strictly increasing order. MessageIds []int64 `json:"message_ids"` @@ -359,7 +359,7 @@ type CopyMessagesParams struct { // CopyMessages calls the copyMessages Telegram Bot API method. // -// Use 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, and invoice messages can't be copied. A quiz poll can be copied only if the value of the field correct_option_ids is known to the bot. The method is analogous to the method forwardMessages, but the copied messages don't have a link to the original message. Album grouping is kept for copied messages. On success, an Array of MessageId of the sent messages is returned. +// Use 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 messages, and widget messages can't be copied. A quiz poll can be copied only if the value of the field correct_option_ids is known to the bot. The method is analogous to the method forwardMessages, but the copied messages don't have a link to the original message. Album grouping is kept for copied messages. On success, an Array of MessageId of the sent messages is returned. func CopyMessages(ctx context.Context, b *client.Bot, p *CopyMessagesParams) ([]MessageId, error) { return client.Call[*CopyMessagesParams, []MessageId](ctx, b, "copyMessages", p) } @@ -370,8 +370,8 @@ func CopyMessages(ctx context.Context, b *client.Bot, p *CopyMessagesParams) ([] type SendPhotoParams struct { // Unique identifier of the business connection on behalf of which the message will be sent BusinessConnectionID string `json:"business_connection_id,omitempty"` - // Unique identifier for the target chat or username of the target bot, supergroup or channel in the format @username - ChatID ChatID `json:"chat_id"` + // Unique identifier for the target chat or username of the target bot, supergroup, or channel in the format @username; required unless the message is sent as an ephemeral reply to a callback query + ChatID *ChatID `json:"chat_id,omitempty"` // Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only MessageThreadID *int64 `json:"message_thread_id,omitempty"` // Identifier of the direct messages topic to which the message will be sent; required if the message is sent to a direct messages chat @@ -420,7 +420,9 @@ func (p *SendPhotoParams) MultipartFields() map[string]string { if p.BusinessConnectionID != "" { out["business_connection_id"] = p.BusinessConnectionID } - out["chat_id"] = p.ChatID.String() + if !p.ChatID.IsZero() { + out["chat_id"] = p.ChatID.String() + } if p.MessageThreadID != nil { out["message_thread_id"] = strconv.FormatInt(*p.MessageThreadID, 10) } @@ -505,8 +507,8 @@ func SendPhoto(ctx context.Context, b *client.Bot, p *SendPhotoParams) (*Message type SendLivePhotoParams struct { // Unique identifier of the business connection on behalf of which the message will be sent BusinessConnectionID string `json:"business_connection_id,omitempty"` - // Unique identifier for the target chat or username of the target channel (in the format @channelusername) - ChatID ChatID `json:"chat_id"` + // Unique identifier for the target chat or username of the target bot, supergroup, or channel in the format @username; required unless the message is sent as an ephemeral reply to a callback query + ChatID *ChatID `json:"chat_id,omitempty"` // Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only MessageThreadID *int64 `json:"message_thread_id,omitempty"` // Identifier of the direct messages topic to which the message will be sent; required if the message is sent to a direct messages chat @@ -515,17 +517,17 @@ type SendLivePhotoParams struct { EphemeralMessageParameters *EphemeralMessageParameters `json:"ephemeral_message_parameters,omitempty"` // Live photo video to send. The video must be no longer than 10 seconds and must not exceed 10 MB in size. Pass a file_id as String to send a video that exists on the Telegram servers (recommended) or upload a new video using multipart/form-data. More information on Sending Files ». Sending live photos by a URL is currently unsupported. LivePhoto *InputFile `json:"live_photo"` - // The static photo to send. Pass a file_id as String to send a photo that exists on the Telegram servers (recommended) or upload a new video using multipart/form-data. More information on Sending Files ». Sending live photos by a URL is currently unsupported. + // The static photo to send. Pass a file_id as String to send a photo that exists on the Telegram servers (recommended) or upload a new photo using multipart/form-data. More information on Sending Files ». Sending live photos by a URL is currently unsupported. Photo *InputFile `json:"photo"` - // Video caption (may also be used when resending videos by file_id), 0-1024 characters after entities parsing + // Live photo caption (may also be used when resending live photos by file_id), 0-1024 characters after entities parsing Caption string `json:"caption,omitempty"` - // Mode for parsing entities in the video caption. See formatting options for more details. + // Mode for parsing entities in the live photo caption. See formatting options for more details. ParseMode ParseMode `json:"parse_mode,omitempty"` // A JSON-serialized list of special entities that appear in the caption, which can be specified instead of parse_mode CaptionEntities []MessageEntity `json:"caption_entities,omitempty"` // Pass True if the caption must be shown above the message media ShowCaptionAboveMedia *bool `json:"show_caption_above_media,omitempty"` - // Pass True if the video needs to be covered with a spoiler animation + // Pass True if the live photo needs to be covered with a spoiler animation HasSpoiler *bool `json:"has_spoiler,omitempty"` // Sends the message silently. Users will receive a notification with no sound. DisableNotification *bool `json:"disable_notification,omitempty"` @@ -560,7 +562,9 @@ func (p *SendLivePhotoParams) MultipartFields() map[string]string { if p.BusinessConnectionID != "" { out["business_connection_id"] = p.BusinessConnectionID } - out["chat_id"] = p.ChatID.String() + if !p.ChatID.IsZero() { + out["chat_id"] = p.ChatID.String() + } if p.MessageThreadID != nil { out["message_thread_id"] = strconv.FormatInt(*p.MessageThreadID, 10) } @@ -648,13 +652,13 @@ func SendLivePhoto(ctx context.Context, b *client.Bot, p *SendLivePhotoParams) ( // SendAudioParams is the parameter set for SendAudio. // -// Use 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 audio files of up to 50 MB in size, this limit may be changed in the future. +// Use 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 audio files of up to 50 MB in size; this limit may be changed in the future. // For sending voice messages, use the sendVoice method instead. type SendAudioParams struct { // Unique identifier of the business connection on behalf of which the message will be sent BusinessConnectionID string `json:"business_connection_id,omitempty"` - // Unique identifier for the target chat or username of the target bot, supergroup or channel in the format @username - ChatID ChatID `json:"chat_id"` + // Unique identifier for the target chat or username of the target bot, supergroup, or channel in the format @username; required unless the message is sent as an ephemeral reply to a callback query + ChatID *ChatID `json:"chat_id,omitempty"` // Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only MessageThreadID *int64 `json:"message_thread_id,omitempty"` // Identifier of the direct messages topic to which the message will be sent; required if the message is sent to a direct messages chat @@ -675,7 +679,7 @@ type SendAudioParams struct { Performer string `json:"performer,omitempty"` // Track name Title string `json:"title,omitempty"` - // Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass “attach://” if the thumbnail was uploaded using multipart/form-data under . More information on Sending Files » + // Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can only be uploaded as a new file, so you can pass “attach://” if the thumbnail was uploaded using multipart/form-data under . More information on Sending Files » Thumbnail *InputFile `json:"thumbnail,omitempty"` // Sends the message silently. Users will receive a notification with no sound. DisableNotification *bool `json:"disable_notification,omitempty"` @@ -710,7 +714,9 @@ func (p *SendAudioParams) MultipartFields() map[string]string { if p.BusinessConnectionID != "" { out["business_connection_id"] = p.BusinessConnectionID } - out["chat_id"] = p.ChatID.String() + if !p.ChatID.IsZero() { + out["chat_id"] = p.ChatID.String() + } if p.MessageThreadID != nil { out["message_thread_id"] = strconv.FormatInt(*p.MessageThreadID, 10) } @@ -794,7 +800,7 @@ func (p *SendAudioParams) MultipartFiles() []client.MultipartFile { // SendAudio calls the sendAudio Telegram Bot API method. // -// Use 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 audio files of up to 50 MB in size, this limit may be changed in the future. +// Use 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 audio files of up to 50 MB in size; this limit may be changed in the future. // For sending voice messages, use the sendVoice method instead. func SendAudio(ctx context.Context, b *client.Bot, p *SendAudioParams) (*Message, error) { return client.Call[*SendAudioParams, *Message](ctx, b, "sendAudio", p) @@ -802,12 +808,12 @@ func SendAudio(ctx context.Context, b *client.Bot, p *SendAudioParams) (*Message // SendDocumentParams is the parameter set for SendDocument. // -// Use 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. +// Use 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. type SendDocumentParams struct { // Unique identifier of the business connection on behalf of which the message will be sent BusinessConnectionID string `json:"business_connection_id,omitempty"` - // Unique identifier for the target chat or username of the target bot, supergroup or channel in the format @username - ChatID ChatID `json:"chat_id"` + // Unique identifier for the target chat or username of the target bot, supergroup, or channel in the format @username; required unless the message is sent as an ephemeral reply to a callback query + ChatID *ChatID `json:"chat_id,omitempty"` // Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only MessageThreadID *int64 `json:"message_thread_id,omitempty"` // Identifier of the direct messages topic to which the message will be sent; required if the message is sent to a direct messages chat @@ -816,7 +822,7 @@ type SendDocumentParams struct { EphemeralMessageParameters *EphemeralMessageParameters `json:"ephemeral_message_parameters,omitempty"` // File to send. Pass a file_id as String to send a file that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get a file from the Internet, or upload a new one using multipart/form-data. More information on Sending Files » Document *InputFile `json:"document"` - // Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass “attach://” if the thumbnail was uploaded using multipart/form-data under . More information on Sending Files » + // Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can only be uploaded as a new file, so you can pass “attach://” if the thumbnail was uploaded using multipart/form-data under . More information on Sending Files » Thumbnail *InputFile `json:"thumbnail,omitempty"` // Document caption (may also be used when resending documents by file_id), 0-1024 characters after entities parsing Caption string `json:"caption,omitempty"` @@ -859,7 +865,9 @@ func (p *SendDocumentParams) MultipartFields() map[string]string { if p.BusinessConnectionID != "" { out["business_connection_id"] = p.BusinessConnectionID } - out["chat_id"] = p.ChatID.String() + if !p.ChatID.IsZero() { + out["chat_id"] = p.ChatID.String() + } if p.MessageThreadID != nil { out["message_thread_id"] = strconv.FormatInt(*p.MessageThreadID, 10) } @@ -937,19 +945,19 @@ func (p *SendDocumentParams) MultipartFiles() []client.MultipartFile { // SendDocument calls the sendDocument Telegram Bot API method. // -// Use 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. +// Use 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. func SendDocument(ctx context.Context, b *client.Bot, p *SendDocumentParams) (*Message, error) { return client.Call[*SendDocumentParams, *Message](ctx, b, "sendDocument", p) } // SendVideoParams is the parameter set for SendVideo. // -// Use 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, this limit may be changed in the future. +// Use 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; this limit may be changed in the future. type SendVideoParams struct { // Unique identifier of the business connection on behalf of which the message will be sent BusinessConnectionID string `json:"business_connection_id,omitempty"` - // Unique identifier for the target chat or username of the target bot, supergroup or channel in the format @username - ChatID ChatID `json:"chat_id"` + // Unique identifier for the target chat or username of the target bot, supergroup, or channel in the format @username; required unless the message is sent as an ephemeral reply to a callback query + ChatID *ChatID `json:"chat_id,omitempty"` // Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only MessageThreadID *int64 `json:"message_thread_id,omitempty"` // Identifier of the direct messages topic to which the message will be sent; required if the message is sent to a direct messages chat @@ -964,7 +972,7 @@ type SendVideoParams struct { Width *int64 `json:"width,omitempty"` // Video height Height *int64 `json:"height,omitempty"` - // Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass “attach://” if the thumbnail was uploaded using multipart/form-data under . More information on Sending Files » + // Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can only be uploaded as a new file, so you can pass “attach://” if the thumbnail was uploaded using multipart/form-data under . More information on Sending Files » Thumbnail *InputFile `json:"thumbnail,omitempty"` // Cover for the video in the message. Pass a file_id to send a file that exists on the Telegram servers (recommended), pass an HTTP URL for Telegram to get a file from the Internet, or pass “attach://” to upload a new one using multipart/form-data under name. More information on Sending Files » Cover *InputFile `json:"cover,omitempty"` @@ -1018,7 +1026,9 @@ func (p *SendVideoParams) MultipartFields() map[string]string { if p.BusinessConnectionID != "" { out["business_connection_id"] = p.BusinessConnectionID } - out["chat_id"] = p.ChatID.String() + if !p.ChatID.IsZero() { + out["chat_id"] = p.ChatID.String() + } if p.MessageThreadID != nil { out["message_thread_id"] = strconv.FormatInt(*p.MessageThreadID, 10) } @@ -1121,19 +1131,19 @@ func (p *SendVideoParams) MultipartFiles() []client.MultipartFile { // SendVideo calls the sendVideo Telegram Bot API method. // -// Use 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, this limit may be changed in the future. +// Use 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; this limit may be changed in the future. func SendVideo(ctx context.Context, b *client.Bot, p *SendVideoParams) (*Message, error) { return client.Call[*SendVideoParams, *Message](ctx, b, "sendVideo", p) } // SendAnimationParams is the parameter set for SendAnimation. // -// Use 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 in the future. +// Use 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 in the future. type SendAnimationParams struct { // Unique identifier of the business connection on behalf of which the message will be sent BusinessConnectionID string `json:"business_connection_id,omitempty"` - // Unique identifier for the target chat or username of the target bot, supergroup or channel in the format @username - ChatID ChatID `json:"chat_id"` + // Unique identifier for the target chat or username of the target bot, supergroup, or channel in the format @username; required unless the message is sent as an ephemeral reply to a callback query + ChatID *ChatID `json:"chat_id,omitempty"` // Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only MessageThreadID *int64 `json:"message_thread_id,omitempty"` // Identifier of the direct messages topic to which the message will be sent; required if the message is sent to a direct messages chat @@ -1148,9 +1158,9 @@ type SendAnimationParams struct { Width *int64 `json:"width,omitempty"` // Animation height Height *int64 `json:"height,omitempty"` - // Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass “attach://” if the thumbnail was uploaded using multipart/form-data under . More information on Sending Files » + // Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can only be uploaded as a new file, so you can pass “attach://” if the thumbnail was uploaded using multipart/form-data under . More information on Sending Files » Thumbnail *InputFile `json:"thumbnail,omitempty"` - // Animation caption (may also be used when resending animation by file_id), 0-1024 characters after entities parsing + // Animation caption (may also be used when resending animations by file_id), 0-1024 characters after entities parsing Caption string `json:"caption,omitempty"` // Mode for parsing entities in the animation caption. See formatting options for more details. ParseMode ParseMode `json:"parse_mode,omitempty"` @@ -1193,7 +1203,9 @@ func (p *SendAnimationParams) MultipartFields() map[string]string { if p.BusinessConnectionID != "" { out["business_connection_id"] = p.BusinessConnectionID } - out["chat_id"] = p.ChatID.String() + if !p.ChatID.IsZero() { + out["chat_id"] = p.ChatID.String() + } if p.MessageThreadID != nil { out["message_thread_id"] = strconv.FormatInt(*p.MessageThreadID, 10) } @@ -1283,19 +1295,19 @@ func (p *SendAnimationParams) MultipartFiles() []client.MultipartFile { // SendAnimation calls the sendAnimation Telegram Bot API method. // -// Use 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 in the future. +// Use 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 in the future. func SendAnimation(ctx context.Context, b *client.Bot, p *SendAnimationParams) (*Message, error) { return client.Call[*SendAnimationParams, *Message](ctx, b, "sendAnimation", p) } // SendVoiceParams is the parameter set for SendVoice. // -// Use 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 format (other formats may be sent as Audio or Document). On success, the sent Message is returned. Bots can currently send voice messages of up to 50 MB in size, this limit may be changed in the future. +// Use 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 format (other formats may be sent as Audio or Document). On success, the sent Message is returned. Bots can currently send voice messages of up to 50 MB in size; this limit may be changed in the future. type SendVoiceParams struct { // Unique identifier of the business connection on behalf of which the message will be sent BusinessConnectionID string `json:"business_connection_id,omitempty"` - // Unique identifier for the target chat or username of the target bot, supergroup or channel in the format @username - ChatID ChatID `json:"chat_id"` + // Unique identifier for the target chat or username of the target bot, supergroup, or channel in the format @username; required unless the message is sent as an ephemeral reply to a callback query + ChatID *ChatID `json:"chat_id,omitempty"` // Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only MessageThreadID *int64 `json:"message_thread_id,omitempty"` // Identifier of the direct messages topic to which the message will be sent; required if the message is sent to a direct messages chat @@ -1342,7 +1354,9 @@ func (p *SendVoiceParams) MultipartFields() map[string]string { if p.BusinessConnectionID != "" { out["business_connection_id"] = p.BusinessConnectionID } - out["chat_id"] = p.ChatID.String() + if !p.ChatID.IsZero() { + out["chat_id"] = p.ChatID.String() + } if p.MessageThreadID != nil { out["message_thread_id"] = strconv.FormatInt(*p.MessageThreadID, 10) } @@ -1413,19 +1427,19 @@ func (p *SendVoiceParams) MultipartFiles() []client.MultipartFile { // SendVoice calls the sendVoice Telegram Bot API method. // -// Use 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 format (other formats may be sent as Audio or Document). On success, the sent Message is returned. Bots can currently send voice messages of up to 50 MB in size, this limit may be changed in the future. +// Use 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 format (other formats may be sent as Audio or Document). On success, the sent Message is returned. Bots can currently send voice messages of up to 50 MB in size; this limit may be changed in the future. func SendVoice(ctx context.Context, b *client.Bot, p *SendVoiceParams) (*Message, error) { return client.Call[*SendVoiceParams, *Message](ctx, b, "sendVoice", p) } // SendVideoNoteParams is the parameter set for SendVideoNote. // -// Use this method to send a rounded square MPEG4 video of up to 1 minute long. On success, the sent Message is returned. +// Use this method to send a rounded square MPEG4 video up to 1 minute long. On success, the sent Message is returned. type SendVideoNoteParams struct { // Unique identifier of the business connection on behalf of which the message will be sent BusinessConnectionID string `json:"business_connection_id,omitempty"` - // Unique identifier for the target chat or username of the target bot, supergroup or channel in the format @username - ChatID ChatID `json:"chat_id"` + // Unique identifier for the target chat or username of the target bot, supergroup, or channel in the format @username; required unless the message is sent as an ephemeral reply to a callback query + ChatID *ChatID `json:"chat_id,omitempty"` // Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only MessageThreadID *int64 `json:"message_thread_id,omitempty"` // Identifier of the direct messages topic to which the message will be sent; required if the message is sent to a direct messages chat @@ -1438,7 +1452,7 @@ type SendVideoNoteParams struct { Duration *int64 `json:"duration,omitempty"` // Video width and height, i.e. diameter of the video message Length *int64 `json:"length,omitempty"` - // Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass “attach://” if the thumbnail was uploaded using multipart/form-data under . More information on Sending Files » + // Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can only be uploaded as a new file, so you can pass “attach://” if the thumbnail was uploaded using multipart/form-data under . More information on Sending Files » Thumbnail *InputFile `json:"thumbnail,omitempty"` // Sends the message silently. Users will receive a notification with no sound. DisableNotification *bool `json:"disable_notification,omitempty"` @@ -1473,7 +1487,9 @@ func (p *SendVideoNoteParams) MultipartFields() map[string]string { if p.BusinessConnectionID != "" { out["business_connection_id"] = p.BusinessConnectionID } - out["chat_id"] = p.ChatID.String() + if !p.ChatID.IsZero() { + out["chat_id"] = p.ChatID.String() + } if p.MessageThreadID != nil { out["message_thread_id"] = strconv.FormatInt(*p.MessageThreadID, 10) } @@ -1543,18 +1559,110 @@ func (p *SendVideoNoteParams) MultipartFiles() []client.MultipartFile { // SendVideoNote calls the sendVideoNote Telegram Bot API method. // -// Use this method to send a rounded square MPEG4 video of up to 1 minute long. On success, the sent Message is returned. +// Use this method to send a rounded square MPEG4 video up to 1 minute long. On success, the sent Message is returned. func SendVideoNote(ctx context.Context, b *client.Bot, p *SendVideoNoteParams) (*Message, error) { return client.Call[*SendVideoNoteParams, *Message](ctx, b, "sendVideoNote", p) } +// SendWidgetParams is the parameter set for SendWidget. +// +// Use 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 forwarded. On success, the sent Message is returned. +type SendWidgetParams struct { + // Unique identifier for the target chat or username of the target supergroup in the format @username + ChatID ChatID `json:"chat_id"` + // Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only + MessageThreadID *int64 `json:"message_thread_id,omitempty"` + // HTML code of the widget, 1-32768 bytes. The code must not exceed 4096 bytes when compressed by zlib with the maximum compression level. + HTML string `json:"html"` + // Width of the widget in logical pixels; omit if the widget must occupy the whole width of the message bubble. The width is clamped by the app to the range from 200 to the maximum width of the message bubble. + Width *int64 `json:"width,omitempty"` + // Height of the widget in logical pixels; omit if the height of the widget isn't fixed. The height is clamped by the app to the range 50-600. + Height *int64 `json:"height,omitempty"` + // Public data of the widget, 0-1024 bytes, which will be available wherever the widget is shown. If the widget is shared, then all messages with it will have the same public data. + PublicData string `json:"public_data,omitempty"` + // Data of the widget, which is specific to the message, 0-1024 bytes + ChatData string `json:"chat_data,omitempty"` + // Widget caption, 0-1024 characters after entities parsing + Caption string `json:"caption,omitempty"` + // Mode for parsing entities in the widget caption. See formatting options for more details. + ParseMode ParseMode `json:"parse_mode,omitempty"` + // A JSON-serialized list of special entities that appear in the caption, which can be specified instead of parse_mode + CaptionEntities []MessageEntity `json:"caption_entities,omitempty"` + // Pass True if the caption must be shown above the widget + ShowCaptionAboveMedia *bool `json:"show_caption_above_media,omitempty"` + // Pass True to allow the widget to send queries to the bot + AllowQueries *bool `json:"allow_queries,omitempty"` + // Pass True to create a shared widget, which can be sent again using the method sendSharedWidget + IsShared *bool `json:"is_shared,omitempty"` + // Sends the message silently. Users will receive a notification with no sound. + DisableNotification *bool `json:"disable_notification,omitempty"` + // Protects the contents of the sent message from forwarding and saving + ProtectContent *bool `json:"protect_content,omitempty"` + // Pass True to allow up to 1000 messages per second, ignoring broadcasting limits for a fee of 0.1 Telegram Stars per message. The relevant Stars will be withdrawn from the bot's balance. + AllowPaidBroadcast *bool `json:"allow_paid_broadcast,omitempty"` + // Unique identifier of the message effect to be added to the message; for private chats only + MessageEffectID string `json:"message_effect_id,omitempty"` + // Description of the message to reply to + ReplyParameters *ReplyParameters `json:"reply_parameters,omitempty"` + // Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove a reply keyboard or to force a reply from the user. + ReplyMarkup any `json:"reply_markup,omitempty"` +} + +// SendWidget calls the sendWidget Telegram Bot API method. +// +// Use 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 forwarded. On success, the sent Message is returned. +func SendWidget(ctx context.Context, b *client.Bot, p *SendWidgetParams) (*Message, error) { + return client.Call[*SendWidgetParams, *Message](ctx, b, "sendWidget", p) +} + +// SendSharedWidgetParams is the parameter set for SendSharedWidget. +// +// Use this method to resend 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 can't be forwarded. On success, the sent Message is returned. +type SendSharedWidgetParams struct { + // Unique identifier for the target chat or username of the target supergroup in the format @username + ChatID ChatID `json:"chat_id"` + // Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only + MessageThreadID *int64 `json:"message_thread_id,omitempty"` + // Unique identifier of the shared widget + WidgetID string `json:"widget_id"` + // Data of the widget, which is specific to the message, 0-1024 bytes + ChatData string `json:"chat_data,omitempty"` + // Widget caption, 0-1024 characters after entities parsing + Caption string `json:"caption,omitempty"` + // Mode for parsing entities in the widget caption. See formatting options for more details. + ParseMode ParseMode `json:"parse_mode,omitempty"` + // A JSON-serialized list of special entities that appear in the caption, which can be specified instead of parse_mode + CaptionEntities []MessageEntity `json:"caption_entities,omitempty"` + // Pass True if the caption must be shown above the widget + ShowCaptionAboveMedia *bool `json:"show_caption_above_media,omitempty"` + // Sends the message silently. Users will receive a notification with no sound. + DisableNotification *bool `json:"disable_notification,omitempty"` + // Protects the contents of the sent message from forwarding and saving + ProtectContent *bool `json:"protect_content,omitempty"` + // Pass True to allow up to 1000 messages per second, ignoring broadcasting limits for a fee of 0.1 Telegram Stars per message. The relevant Stars will be withdrawn from the bot's balance. + AllowPaidBroadcast *bool `json:"allow_paid_broadcast,omitempty"` + // Unique identifier of the message effect to be added to the message; for private chats only + MessageEffectID string `json:"message_effect_id,omitempty"` + // Description of the message to reply to + ReplyParameters *ReplyParameters `json:"reply_parameters,omitempty"` + // Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove a reply keyboard or to force a reply from the user. + ReplyMarkup any `json:"reply_markup,omitempty"` +} + +// SendSharedWidget calls the sendSharedWidget Telegram Bot API method. +// +// Use this method to resend 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 can't be forwarded. On success, the sent Message is returned. +func SendSharedWidget(ctx context.Context, b *client.Bot, p *SendSharedWidgetParams) (*Message, error) { + return client.Call[*SendSharedWidgetParams, *Message](ctx, b, "sendSharedWidget", p) +} + // SendPaidMediaParams is the parameter set for SendPaidMedia. // // Use this method to send paid media. On success, the sent Message is returned. type SendPaidMediaParams struct { // Unique identifier of the business connection on behalf of which the message will be sent BusinessConnectionID string `json:"business_connection_id,omitempty"` - // Unique identifier for the target chat or username of the target bot, supergroup or channel in the format @username. If the chat is a channel, all Telegram Star proceeds from this media will be credited to the chat's balance. Otherwise, they will be credited to the bot's balance. + // Unique identifier for the target chat or username of the target bot, supergroup, or channel in the format @username. If the chat is a channel, all Telegram Star proceeds from this media will be credited to the chat's balance. Otherwise, they will be credited to the bot's balance. ChatID ChatID `json:"chat_id"` // Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only MessageThreadID *int64 `json:"message_thread_id,omitempty"` @@ -1564,7 +1672,7 @@ type SendPaidMediaParams struct { StarCount int64 `json:"star_count"` // A JSON-serialized Array describing the media to be sent; up to 10 items Media []InputPaidMedia `json:"media"` - // Bot-defined paid media payload, 0-128 bytes. This will not be displayed to the user, use it for your internal processes. + // Bot-defined paid media payload, 0-128 bytes. This will not be displayed to the user; use it for your internal processes. Payload string `json:"payload,omitempty"` // Media caption, 0-1024 characters after entities parsing Caption string `json:"caption,omitempty"` @@ -1669,11 +1777,11 @@ func SendPaidMedia(ctx context.Context, b *client.Bot, p *SendPaidMediaParams) ( // SendMediaGroupParams is the parameter set for SendMediaGroup. // -// Use 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 objects that were sent is returned. +// Use this method to send a group of photos, live photos, videos, documents or audios as an album. Documents and audio files can only be grouped in an album with messages of the same type. On success, an Array of Message objects that were sent is returned. type SendMediaGroupParams struct { // Unique identifier of the business connection on behalf of which the message will be sent BusinessConnectionID string `json:"business_connection_id,omitempty"` - // Unique identifier for the target chat or username of the target bot, supergroup or channel in the format @username + // Unique identifier for the target chat or username of the target bot, supergroup, or channel in the format @username ChatID ChatID `json:"chat_id"` // Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only MessageThreadID *int64 `json:"message_thread_id,omitempty"` @@ -1742,19 +1850,19 @@ func (p *SendMediaGroupParams) MultipartFiles() []client.MultipartFile { // SendMediaGroup calls the sendMediaGroup Telegram Bot API method. // -// Use 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 objects that were sent is returned. +// Use this method to send a group of photos, live photos, videos, documents or audios as an album. Documents and audio files can only be grouped in an album with messages of the same type. On success, an Array of Message objects that were sent is returned. func SendMediaGroup(ctx context.Context, b *client.Bot, p *SendMediaGroupParams) ([]Message, error) { return client.Call[*SendMediaGroupParams, []Message](ctx, b, "sendMediaGroup", p) } // SendLocationParams is the parameter set for SendLocation. // -// Use this method to send point on the map. On success, the sent Message is returned. +// Use this method to send a point on the map. On success, the sent Message is returned. type SendLocationParams struct { // Unique identifier of the business connection on behalf of which the message will be sent BusinessConnectionID string `json:"business_connection_id,omitempty"` - // Unique identifier for the target chat or username of the target bot, supergroup or channel in the format @username - ChatID ChatID `json:"chat_id"` + // Unique identifier for the target chat or username of the target bot, supergroup, or channel in the format @username; required unless the message is sent as an ephemeral reply to a callback query + ChatID *ChatID `json:"chat_id,omitempty"` // Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only MessageThreadID *int64 `json:"message_thread_id,omitempty"` // Identifier of the direct messages topic to which the message will be sent; required if the message is sent to a direct messages chat @@ -1791,7 +1899,7 @@ type SendLocationParams struct { // SendLocation calls the sendLocation Telegram Bot API method. // -// Use this method to send point on the map. On success, the sent Message is returned. +// Use this method to send a point on the map. On success, the sent Message is returned. func SendLocation(ctx context.Context, b *client.Bot, p *SendLocationParams) (*Message, error) { return client.Call[*SendLocationParams, *Message](ctx, b, "sendLocation", p) } @@ -1802,8 +1910,8 @@ func SendLocation(ctx context.Context, b *client.Bot, p *SendLocationParams) (*M type SendVenueParams struct { // Unique identifier of the business connection on behalf of which the message will be sent BusinessConnectionID string `json:"business_connection_id,omitempty"` - // Unique identifier for the target chat or username of the target bot, supergroup or channel in the format @username - ChatID ChatID `json:"chat_id"` + // Unique identifier for the target chat or username of the target bot, supergroup, or channel in the format @username; required unless the message is sent as an ephemeral reply to a callback query + ChatID *ChatID `json:"chat_id,omitempty"` // Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only MessageThreadID *int64 `json:"message_thread_id,omitempty"` // Identifier of the direct messages topic to which the message will be sent; required if the message is sent to a direct messages chat @@ -1855,8 +1963,8 @@ func SendVenue(ctx context.Context, b *client.Bot, p *SendVenueParams) (*Message type SendContactParams struct { // Unique identifier of the business connection on behalf of which the message will be sent BusinessConnectionID string `json:"business_connection_id,omitempty"` - // Unique identifier for the target chat or username of the target bot, supergroup or channel in the format @username - ChatID ChatID `json:"chat_id"` + // Unique identifier for the target chat or username of the target bot, supergroup, or channel in the format @username; required unless the message is sent as an ephemeral reply to a callback query + ChatID *ChatID `json:"chat_id,omitempty"` // Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only MessageThreadID *int64 `json:"message_thread_id,omitempty"` // Identifier of the direct messages topic to which the message will be sent; required if the message is sent to a direct messages chat @@ -1900,7 +2008,7 @@ func SendContact(ctx context.Context, b *client.Bot, p *SendContactParams) (*Mes type SendPollParams struct { // Unique identifier of the business connection on behalf of which the message will be sent BusinessConnectionID string `json:"business_connection_id,omitempty"` - // Unique identifier for the target chat or username of the target bot, supergroup or channel in the format @username. Polls can't be sent to channel direct messages chats. + // Unique identifier for the target chat or username of the target bot, supergroup, or channel in the format @username. Polls can't be sent to channel direct messages chats. ChatID ChatID `json:"chat_id"` // Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only MessageThreadID *int64 `json:"message_thread_id,omitempty"` @@ -1918,7 +2026,7 @@ type SendPollParams struct { Type string `json:"type,omitempty"` // Pass True if the poll allows multiple answers, defaults to False AllowsMultipleAnswers *bool `json:"allows_multiple_answers,omitempty"` - // Pass True if the poll allows to change chosen answer options, defaults to False for quizzes and to True for regular polls + // Pass True if the poll allows changing the chosen answer options, defaults to False for quizzes and to True for regular polls AllowsRevoting *bool `json:"allows_revoting,omitempty"` // Pass True if the poll options must be shown in random order ShuffleOptions *bool `json:"shuffle_options,omitempty"` @@ -2010,7 +2118,7 @@ func SendChecklist(ctx context.Context, b *client.Bot, p *SendChecklistParams) ( type SendDiceParams struct { // Unique identifier of the business connection on behalf of which the message will be sent BusinessConnectionID string `json:"business_connection_id,omitempty"` - // Unique identifier for the target chat or username of the target bot, supergroup or channel in the format @username + // Unique identifier for the target chat or username of the target bot, supergroup, or channel in the format @username ChatID ChatID `json:"chat_id"` // Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only MessageThreadID *int64 `json:"message_thread_id,omitempty"` @@ -2099,7 +2207,7 @@ func SendChatAction(ctx context.Context, b *client.Bot, p *SendChatActionParams) // // Use 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 as messages in the channel. Bots can't use paid reactions. Returns True on success. type SetMessageReactionParams struct { - // Unique identifier for the target chat or username of the target bot, supergroup or channel in the format @username + // Unique identifier for the target chat or username of the target bot, supergroup, or channel in the format @username ChatID ChatID `json:"chat_id"` // Identifier of the target message. If the message belongs to a media group, the reaction is set to the first non-deleted message in the group instead. MessageID int64 `json:"message_id"` @@ -2198,7 +2306,7 @@ type BanChatMemberParams struct { ChatID ChatID `json:"chat_id"` // Unique identifier of the target user UserID int64 `json:"user_id"` - // Date when the user will be unbanned; Unix time. If user is banned for more than 366 days or less than 30 seconds from the current time they are considered to be banned forever. Applied for supergroups and channels only. + // Date when the user will be unbanned; Unix time. If the user is banned for more than 366 days or less than 30 seconds from the current time, they are considered to be banned forever. Applied for supergroups and channels only. UntilDate *int64 `json:"until_date,omitempty"` // Pass True to delete all messages from the chat for the user that is being removed. If False, the user will be able to see messages in the group that were sent before the user was removed. Always True for supergroups and channels. RevokeMessages *bool `json:"revoke_messages,omitempty"` @@ -2242,7 +2350,7 @@ type RestrictChatMemberParams struct { Permissions ChatPermissions `json:"permissions"` // Pass True if chat permissions are set independently. Otherwise, the can_send_other_messages and can_add_web_page_previews permissions will imply the can_send_messages, can_send_audios, can_send_documents, can_send_photos, can_send_videos, can_send_video_notes, and can_send_voice_notes permissions; the can_send_polls permission will imply the can_send_messages permission. UseIndependentChatPermissions *bool `json:"use_independent_chat_permissions,omitempty"` - // Date when restrictions will be lifted for the user; Unix time. If user is restricted for more than 366 days or less than 30 seconds from the current time, they are considered to be restricted forever. + // Date when restrictions will be lifted for the user; Unix time. If the user is restricted for more than 366 days or less than 30 seconds from the current time, they are considered to be restricted forever. UntilDate *int64 `json:"until_date,omitempty"` } @@ -2273,7 +2381,7 @@ type PromoteChatMemberParams struct { CanRestrictMembers *bool `json:"can_restrict_members,omitempty"` // Pass True if the administrator can add new administrators with a subset of their own privileges or demote administrators that they have promoted, directly or indirectly (promoted by administrators that were appointed by him) CanPromoteMembers *bool `json:"can_promote_members,omitempty"` - // Pass True if the administrator can change chat title, photo and other settings + // Pass True if the administrator can change the chat title, photo and other settings CanChangeInfo *bool `json:"can_change_info,omitempty"` // Pass True if the administrator can invite new users to the chat CanInviteUsers *bool `json:"can_invite_users,omitempty"` @@ -2380,7 +2488,7 @@ func UnbanChatSenderChat(ctx context.Context, b *client.Bot, p *UnbanChatSenderC // SetChatPermissionsParams is the parameter set for SetChatPermissions. // -// Use 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 on success. +// Use 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 right. Returns True on success. type SetChatPermissionsParams struct { // Unique identifier for the target chat or username of the target supergroup in the format @username ChatID ChatID `json:"chat_id"` @@ -2392,7 +2500,7 @@ type SetChatPermissionsParams struct { // SetChatPermissions calls the setChatPermissions Telegram Bot API method. // -// Use 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 on success. +// Use 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 right. Returns True on success. func SetChatPermissions(ctx context.Context, b *client.Bot, p *SetChatPermissionsParams) (bool, error) { return client.Call[*SetChatPermissionsParams, bool](ctx, b, "setChatPermissions", p) } @@ -2416,7 +2524,7 @@ func ExportChatInviteLink(ctx context.Context, b *client.Bot, p *ExportChatInvit // CreateChatInviteLinkParams is the parameter set for CreateChatInviteLink. // -// Use 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 revokeChatInviteLink. Returns the new invite link as ChatInviteLink object. +// Use 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 revokeChatInviteLink. Returns the new invite link as a ChatInviteLink object. type CreateChatInviteLinkParams struct { // Unique identifier for the target chat or username of the target channel in the format @username ChatID ChatID `json:"chat_id"` @@ -2432,7 +2540,7 @@ type CreateChatInviteLinkParams struct { // CreateChatInviteLink calls the createChatInviteLink Telegram Bot API method. // -// Use 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 revokeChatInviteLink. Returns the new invite link as ChatInviteLink object. +// Use 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 revokeChatInviteLink. Returns the new invite link as a ChatInviteLink object. func CreateChatInviteLink(ctx context.Context, b *client.Bot, p *CreateChatInviteLinkParams) (*ChatInviteLink, error) { return client.Call[*CreateChatInviteLinkParams, *ChatInviteLink](ctx, b, "createChatInviteLink", p) } @@ -2464,7 +2572,7 @@ func EditChatInviteLink(ctx context.Context, b *client.Bot, p *EditChatInviteLin // CreateChatSubscriptionInviteLinkParams is the parameter set for CreateChatSubscriptionInviteLink. // -// Use 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 using the method revokeChatInviteLink. Returns the new invite link as a ChatInviteLink object. +// Use this method to create a subscription invite link for a channel chat. The bot must have the can_invite_users administrator right. The link can be edited using the method editChatSubscriptionInviteLink or revoked using the method revokeChatInviteLink. Returns the new invite link as a ChatInviteLink object. type CreateChatSubscriptionInviteLinkParams struct { // Unique identifier for the target channel chat or username of the target channel in the format @username ChatID ChatID `json:"chat_id"` @@ -2478,14 +2586,14 @@ type CreateChatSubscriptionInviteLinkParams struct { // CreateChatSubscriptionInviteLink calls the createChatSubscriptionInviteLink Telegram Bot API method. // -// Use 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 using the method revokeChatInviteLink. Returns the new invite link as a ChatInviteLink object. +// Use this method to create a subscription invite link for a channel chat. The bot must have the can_invite_users administrator right. The link can be edited using the method editChatSubscriptionInviteLink or revoked using the method revokeChatInviteLink. Returns the new invite link as a ChatInviteLink object. func CreateChatSubscriptionInviteLink(ctx context.Context, b *client.Bot, p *CreateChatSubscriptionInviteLinkParams) (*ChatInviteLink, error) { return client.Call[*CreateChatSubscriptionInviteLinkParams, *ChatInviteLink](ctx, b, "createChatSubscriptionInviteLink", p) } // EditChatSubscriptionInviteLinkParams is the parameter set for EditChatSubscriptionInviteLink. // -// Use 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. +// Use this method to edit a subscription invite link created by the bot. The bot must have the can_invite_users administrator right. Returns the edited invite link as a ChatInviteLink object. type EditChatSubscriptionInviteLinkParams struct { // Unique identifier for the target chat or username of the target channel in the format @username ChatID ChatID `json:"chat_id"` @@ -2497,14 +2605,14 @@ type EditChatSubscriptionInviteLinkParams struct { // EditChatSubscriptionInviteLink calls the editChatSubscriptionInviteLink Telegram Bot API method. // -// Use 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. +// Use this method to edit a subscription invite link created by the bot. The bot must have the can_invite_users administrator right. Returns the edited invite link as a ChatInviteLink object. func EditChatSubscriptionInviteLink(ctx context.Context, b *client.Bot, p *EditChatSubscriptionInviteLinkParams) (*ChatInviteLink, error) { return client.Call[*EditChatSubscriptionInviteLinkParams, *ChatInviteLink](ctx, b, "editChatSubscriptionInviteLink", p) } // RevokeChatInviteLinkParams is the parameter set for RevokeChatInviteLink. // -// Use 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 appropriate administrator rights. Returns the revoked invite link as ChatInviteLink object. +// Use 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 appropriate administrator rights. Returns the revoked invite link as a ChatInviteLink object. type RevokeChatInviteLinkParams struct { // Unique identifier of the target chat or username of the target channel in the format @username ChatID ChatID `json:"chat_id"` @@ -2514,7 +2622,7 @@ type RevokeChatInviteLinkParams struct { // RevokeChatInviteLink calls the revokeChatInviteLink Telegram Bot API method. // -// Use 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 appropriate administrator rights. Returns the revoked invite link as ChatInviteLink object. +// Use 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 appropriate administrator rights. Returns the revoked invite link as a ChatInviteLink object. func RevokeChatInviteLink(ctx context.Context, b *client.Bot, p *RevokeChatInviteLinkParams) (*ChatInviteLink, error) { return client.Call[*RevokeChatInviteLinkParams, *ChatInviteLink](ctx, b, "revokeChatInviteLink", p) } @@ -2835,6 +2943,19 @@ func GetChatMember(ctx context.Context, b *client.Bot, p *GetChatMemberParams) ( return UnmarshalChatMember(raw) } +// GetChatShareThemeBackdropsParams is the parameter set for GetChatShareThemeBackdrops. +// +// Use 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. +type GetChatShareThemeBackdropsParams struct { +} + +// GetChatShareThemeBackdrops calls the getChatShareThemeBackdrops Telegram Bot API method. +// +// Use 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. +func GetChatShareThemeBackdrops(ctx context.Context, b *client.Bot, p *GetChatShareThemeBackdropsParams) (*ChatShareThemeBackdrops, error) { + return client.Call[*GetChatShareThemeBackdropsParams, *ChatShareThemeBackdrops](ctx, b, "getChatShareThemeBackdrops", p) +} + // GetUserPersonalChatMessagesParams is the parameter set for GetUserPersonalChatMessages. // // 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. On success, an Array of Message objects is returned. @@ -2899,7 +3020,7 @@ func GetForumTopicIconStickers(ctx context.Context, b *client.Bot, p *GetForumTo // CreateForumTopicParams is the parameter set for CreateForumTopic. // -// Use 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_topics administrator right. Returns information about the created topic as a ForumTopic object. +// Use 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_topics administrator right. In the case of a private chat, a link to the topic can be created in the format https://t.me//; the link opens the topic only for the user. Returns information about the created topic as a ForumTopic object. type CreateForumTopicParams struct { // Unique identifier for the target chat or username of the target supergroup in the format @username ChatID ChatID `json:"chat_id"` @@ -2913,14 +3034,14 @@ type CreateForumTopicParams struct { // CreateForumTopic calls the createForumTopic Telegram Bot API method. // -// Use 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_topics administrator right. Returns information about the created topic as a ForumTopic object. +// Use 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_topics administrator right. In the case of a private chat, a link to the topic can be created in the format https://t.me//; the link opens the topic only for the user. Returns information about the created topic as a ForumTopic object. func CreateForumTopic(ctx context.Context, b *client.Bot, p *CreateForumTopicParams) (*ForumTopic, error) { return client.Call[*CreateForumTopicParams, *ForumTopic](ctx, b, "createForumTopic", p) } // EditForumTopicParams is the parameter set for EditForumTopic. // -// Use 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 can_manage_topics administrator rights, unless it is the creator of the topic. Returns True on success. +// Use this method to edit the 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 can_manage_topics administrator right, unless it is the creator of the topic. Returns True on success. type EditForumTopicParams struct { // Unique identifier for the target chat or username of the target supergroup in the format @username ChatID ChatID `json:"chat_id"` @@ -2934,14 +3055,14 @@ type EditForumTopicParams struct { // EditForumTopic calls the editForumTopic Telegram Bot API method. // -// Use 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 can_manage_topics administrator rights, unless it is the creator of the topic. Returns True on success. +// Use this method to edit the 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 can_manage_topics administrator right, unless it is the creator of the topic. Returns True on success. func EditForumTopic(ctx context.Context, b *client.Bot, p *EditForumTopicParams) (bool, error) { return client.Call[*EditForumTopicParams, bool](ctx, b, "editForumTopic", p) } // CloseForumTopicParams is the parameter set for CloseForumTopic. // -// Use 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 topic. Returns True on success. +// Use 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 right, unless it is the creator of the topic. Returns True on success. type CloseForumTopicParams struct { // Unique identifier for the target chat or username of the target supergroup in the format @username ChatID ChatID `json:"chat_id"` @@ -2951,14 +3072,14 @@ type CloseForumTopicParams struct { // CloseForumTopic calls the closeForumTopic Telegram Bot API method. // -// Use 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 topic. Returns True on success. +// Use 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 right, unless it is the creator of the topic. Returns True on success. func CloseForumTopic(ctx context.Context, b *client.Bot, p *CloseForumTopicParams) (bool, error) { return client.Call[*CloseForumTopicParams, bool](ctx, b, "closeForumTopic", p) } // ReopenForumTopicParams is the parameter set for ReopenForumTopic. // -// Use 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 the topic. Returns True on success. +// Use 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 right, unless it is the creator of the topic. Returns True on success. type ReopenForumTopicParams struct { // Unique identifier for the target chat or username of the target supergroup in the format @username ChatID ChatID `json:"chat_id"` @@ -2968,14 +3089,14 @@ type ReopenForumTopicParams struct { // ReopenForumTopic calls the reopenForumTopic Telegram Bot API method. // -// Use 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 the topic. Returns True on success. +// Use 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 right, unless it is the creator of the topic. Returns True on success. func ReopenForumTopic(ctx context.Context, b *client.Bot, p *ReopenForumTopicParams) (bool, error) { return client.Call[*ReopenForumTopicParams, bool](ctx, b, "reopenForumTopic", p) } // DeleteForumTopicParams is the parameter set for DeleteForumTopic. // -// Use this method to delete a forum topic along with all its messages in a forum supergroup chat or a private chat with a user. 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_delete_messages administrator rights. Returns True on success. +// Use this method to delete a forum topic along with all its messages in a forum supergroup chat or a private chat with a user. 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_delete_messages administrator right. Returns True on success. type DeleteForumTopicParams struct { // Unique identifier for the target chat or username of the target supergroup in the format @username ChatID ChatID `json:"chat_id"` @@ -2985,7 +3106,7 @@ type DeleteForumTopicParams struct { // DeleteForumTopic calls the deleteForumTopic Telegram Bot API method. // -// Use this method to delete a forum topic along with all its messages in a forum supergroup chat or a private chat with a user. 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_delete_messages administrator rights. Returns True on success. +// Use this method to delete a forum topic along with all its messages in a forum supergroup chat or a private chat with a user. 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_delete_messages administrator right. Returns True on success. func DeleteForumTopic(ctx context.Context, b *client.Bot, p *DeleteForumTopicParams) (bool, error) { return client.Call[*DeleteForumTopicParams, bool](ctx, b, "deleteForumTopic", p) } @@ -3009,7 +3130,7 @@ func UnpinAllForumTopicMessages(ctx context.Context, b *client.Bot, p *UnpinAllF // EditGeneralForumTopicParams is the parameter set for EditGeneralForumTopic. // -// Use 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 success. +// Use 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 right. Returns True on success. type EditGeneralForumTopicParams struct { // Unique identifier for the target chat or username of the target supergroup in the format @username ChatID ChatID `json:"chat_id"` @@ -3019,14 +3140,14 @@ type EditGeneralForumTopicParams struct { // EditGeneralForumTopic calls the editGeneralForumTopic Telegram Bot API method. // -// Use 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 success. +// Use 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 right. Returns True on success. func EditGeneralForumTopic(ctx context.Context, b *client.Bot, p *EditGeneralForumTopicParams) (bool, error) { return client.Call[*EditGeneralForumTopicParams, bool](ctx, b, "editGeneralForumTopic", p) } // CloseGeneralForumTopicParams is the parameter set for CloseGeneralForumTopic. // -// Use 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 success. +// Use 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 right. Returns True on success. type CloseGeneralForumTopicParams struct { // Unique identifier for the target chat or username of the target supergroup in the format @username ChatID ChatID `json:"chat_id"` @@ -3034,14 +3155,14 @@ type CloseGeneralForumTopicParams struct { // CloseGeneralForumTopic calls the closeGeneralForumTopic Telegram Bot API method. // -// Use 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 success. +// Use 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 right. Returns True on success. func CloseGeneralForumTopic(ctx context.Context, b *client.Bot, p *CloseGeneralForumTopicParams) (bool, error) { return client.Call[*CloseGeneralForumTopicParams, bool](ctx, b, "closeGeneralForumTopic", p) } // ReopenGeneralForumTopicParams is the parameter set for ReopenGeneralForumTopic. // -// Use 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 automatically unhidden if it was hidden. Returns True on success. +// Use 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 right. The topic will be automatically unhidden if it was hidden. Returns True on success. type ReopenGeneralForumTopicParams struct { // Unique identifier for the target chat or username of the target supergroup in the format @username ChatID ChatID `json:"chat_id"` @@ -3049,14 +3170,14 @@ type ReopenGeneralForumTopicParams struct { // ReopenGeneralForumTopic calls the reopenGeneralForumTopic Telegram Bot API method. // -// Use 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 automatically unhidden if it was hidden. Returns True on success. +// Use 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 right. The topic will be automatically unhidden if it was hidden. Returns True on success. func ReopenGeneralForumTopic(ctx context.Context, b *client.Bot, p *ReopenGeneralForumTopicParams) (bool, error) { return client.Call[*ReopenGeneralForumTopicParams, bool](ctx, b, "reopenGeneralForumTopic", p) } // HideGeneralForumTopicParams is the parameter set for HideGeneralForumTopic. // -// Use 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 automatically closed if it was open. Returns True on success. +// Use 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 right. The topic will be automatically closed if it was open. Returns True on success. type HideGeneralForumTopicParams struct { // Unique identifier for the target chat or username of the target supergroup in the format @username ChatID ChatID `json:"chat_id"` @@ -3064,14 +3185,14 @@ type HideGeneralForumTopicParams struct { // HideGeneralForumTopic calls the hideGeneralForumTopic Telegram Bot API method. // -// Use 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 automatically closed if it was open. Returns True on success. +// Use 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 right. The topic will be automatically closed if it was open. Returns True on success. func HideGeneralForumTopic(ctx context.Context, b *client.Bot, p *HideGeneralForumTopicParams) (bool, error) { return client.Call[*HideGeneralForumTopicParams, bool](ctx, b, "hideGeneralForumTopic", p) } // UnhideGeneralForumTopicParams is the parameter set for UnhideGeneralForumTopic. // -// Use 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. +// Use 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 right. Returns True on success. type UnhideGeneralForumTopicParams struct { // Unique identifier for the target chat or username of the target supergroup in the format @username ChatID ChatID `json:"chat_id"` @@ -3079,7 +3200,7 @@ type UnhideGeneralForumTopicParams struct { // UnhideGeneralForumTopic calls the unhideGeneralForumTopic Telegram Bot API method. // -// Use 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. +// Use 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 right. Returns True on success. func UnhideGeneralForumTopic(ctx context.Context, b *client.Bot, p *UnhideGeneralForumTopicParams) (bool, error) { return client.Call[*UnhideGeneralForumTopicParams, bool](ctx, b, "unhideGeneralForumTopic", p) } @@ -3101,7 +3222,7 @@ func UnpinAllGeneralForumTopicMessages(ctx context.Context, b *client.Bot, p *Un // AnswerCallbackQueryParams is the parameter set for AnswerCallbackQuery. // -// Use 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. +// Use this method to send answers to callback queries sent from inline keyboards or rich messages. 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. // Alternatively, the user can be redirected to the specified Game URL. For this option to work, you must first create a game for your bot via @BotFather and accept the terms. Otherwise, you may use links like t.me/your_bot?start=XXXX that open your bot with a parameter. type AnswerCallbackQueryParams struct { // Unique identifier for the query to be answered @@ -3118,12 +3239,29 @@ type AnswerCallbackQueryParams struct { // AnswerCallbackQuery calls the answerCallbackQuery Telegram Bot API method. // -// Use 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. +// Use this method to send answers to callback queries sent from inline keyboards or rich messages. 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. // Alternatively, the user can be redirected to the specified Game URL. For this option to work, you must first create a game for your bot via @BotFather and accept the terms. Otherwise, you may use links like t.me/your_bot?start=XXXX that open your bot with a parameter. func AnswerCallbackQuery(ctx context.Context, b *client.Bot, p *AnswerCallbackQueryParams) (bool, error) { return client.Call[*AnswerCallbackQueryParams, bool](ctx, b, "answerCallbackQuery", p) } +// AnswerWidgetQueryParams is the parameter set for AnswerWidgetQuery. +// +// Use 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 editMessageWidgetData or editSharedWidgetData to change it. On success, True is returned. +type AnswerWidgetQueryParams struct { + // Unique identifier for the query to be answered + WidgetQueryID string `json:"widget_query_id"` + // Data to be returned to the widget, 0-1024 bytes + Data string `json:"data,omitempty"` +} + +// AnswerWidgetQuery calls the answerWidgetQuery Telegram Bot API method. +// +// Use 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 editMessageWidgetData or editSharedWidgetData to change it. On success, True is returned. +func AnswerWidgetQuery(ctx context.Context, b *client.Bot, p *AnswerWidgetQueryParams) (bool, error) { + return client.Call[*AnswerWidgetQueryParams, bool](ctx, b, "answerWidgetQuery", p) +} + // AnswerGuestQueryParams is the parameter set for AnswerGuestQuery. // // Use this method to reply to a received guest message. On success, a SentGuestMessage object is returned. @@ -3237,6 +3375,49 @@ func SetManagedBotAccessSettings(ctx context.Context, b *client.Bot, p *SetManag return client.Call[*SetManagedBotAccessSettingsParams, bool](ctx, b, "setManagedBotAccessSettings", p) } +// SetMySettingsParams is the parameter set for SetMySettings. +// +// Use this method to change the settings of the bot. Settings that aren't specified remain unchanged. Returns True on success. +type SetMySettingsParams struct { + // Pass True to enable inline mode for the bot or False to disable it + SupportsInlineQueries *bool `json:"supports_inline_queries,omitempty"` + // New placeholder for inline queries, which is shown in the input field after the bot's username. Pass an empty string to use the default placeholder. + InlineQueryPlaceholder string `json:"inline_query_placeholder,omitempty"` + // Pass True to request the location of the user with every inline query to the bot or False to stop requesting it + NeedsInlineQueryLocation *bool `json:"needs_inline_query_location,omitempty"` + // Denominator of the share of chosen inline results received by the bot; the bot receives 1 out of inline_feedback_share_denominator chosen results. Must be one of 1, 10, 100, or 1000. Pass 0 to stop receiving chosen inline results. + InlineFeedbackShareDenominator *int64 `json:"inline_feedback_share_denominator,omitempty"` + // Pass True to allow adding the bot to groups or False to disallow it + CanJoinGroups *bool `json:"can_join_groups,omitempty"` + // Pass True to disable privacy mode for the bot or False to enable it + CanReadAllGroupMessages *bool `json:"can_read_all_group_messages,omitempty"` + // Pass True to allow connecting the bot to user accounts to manage them or False to disallow it + CanConnectToBusiness *bool `json:"can_connect_to_business,omitempty"` + // Pass True to allow creating other bots that will be controlled by the bot or False to disallow it + CanManageBots *bool `json:"can_manage_bots,omitempty"` + // Pass True to allow guest queries to the bot from chats it isn't a member of or False to disallow them + SupportsGuestQueries *bool `json:"supports_guest_queries,omitempty"` + // Pass True to allow assigning the bot to process join request queries or False to disallow it + SupportsJoinRequestQueries *bool `json:"supports_join_request_queries,omitempty"` + // Pass True to enable forum topic mode in private chats with the bot or False to disable it + HasTopicsEnabled *bool `json:"has_topics_enabled,omitempty"` + // Pass True to allow users to create and delete topics in private chats with the bot or False to disallow it + AllowsUsersToCreateTopics *bool `json:"allows_users_to_create_topics,omitempty"` + // Pass True to show topics in private chats with the bot in a sidebar or False to stop showing them in a sidebar + HasTopicSidebar *bool `json:"has_topic_sidebar,omitempty"` + // Pass True to allow the bot to communicate with other bots in groups, private chats, and through business accounts or False to disallow it + CanCommunicateWithBots *bool `json:"can_communicate_with_bots,omitempty"` + // Mode in which the bot receives callback queries from buttons in messages sent by the bot. Must be one of “default” (the field message is always used and contains an InaccessibleMessage if the message is inaccessible to the bot), “auto” (the field inline_message_id is used instead of the field message if the message is inaccessible to the bot; the field message can still contain an inaccessible message if the message has just been deleted), or “inline” (the field inline_message_id is always used instead of the field message). + CallbackQueryMode CallbackQueryMode `json:"callback_query_mode,omitempty"` +} + +// SetMySettings calls the setMySettings Telegram Bot API method. +// +// Use this method to change the settings of the bot. Settings that aren't specified remain unchanged. Returns True on success. +func SetMySettings(ctx context.Context, b *client.Bot, p *SetMySettingsParams) (bool, error) { + return client.Call[*SetMySettingsParams, bool](ctx, b, "setMySettings", p) +} + // SetMyCommandsParams is the parameter set for SetMyCommands. // // Use this method to change the list of the bot's commands. See this manual for more details about bot commands. Returns True on success. @@ -3471,7 +3652,7 @@ func SetMyDefaultAdministratorRights(ctx context.Context, b *client.Bot, p *SetM // // Use this method to get the current default administrator rights of the bot. Returns ChatAdministratorRights on success. type GetMyDefaultAdministratorRightsParams struct { - // Pass True to get default administrator rights of the bot in channels. Otherwise, default administrator rights of the bot for groups and supergroups will be returned. + // Pass True to get the default administrator rights of the bot in channels. Otherwise, the default administrator rights of the bot for groups and supergroups will be returned. ForChannels *bool `json:"for_channels,omitempty"` } @@ -3501,7 +3682,7 @@ func GetAvailableGifts(ctx context.Context, b *client.Bot, p *GetAvailableGiftsP type SendGiftParams struct { // Required if chat_id is not specified. Unique identifier of the target user who will receive the gift. UserID *int64 `json:"user_id,omitempty"` - // Required if user_id is not specified. Unique identifier for the chat or username of the channel (in the format @username) that will receive the gift. + // Required if user_id is not specified. Unique identifier for the chat that will receive the gift or username of the channel in the format @username. ChatID *ChatID `json:"chat_id,omitempty"` // Identifier of the gift; limited gifts can't be sent to channel chats GiftID string `json:"gift_id"` @@ -3555,6 +3736,10 @@ type VerifyUserParams struct { UserID int64 `json:"user_id"` // Custom description for the verification; 0-70 characters. Must be empty if the organization isn't allowed to provide a custom verification description. CustomDescription string `json:"custom_description,omitempty"` + // Mode for parsing entities in the custom description. See formatting options for more details. Only “text_link” entities are supported. + CustomDescriptionParseMode ParseMode `json:"custom_description_parse_mode,omitempty"` + // A JSON-serialized list of special entities that appear in the custom description, which can be specified instead of custom_description_parse_mode. Only “text_link” entities are supported. + CustomDescriptionEntities []MessageEntity `json:"custom_description_entities,omitempty"` } // VerifyUser calls the verifyUser Telegram Bot API method. @@ -3568,10 +3753,14 @@ func VerifyUser(ctx context.Context, b *client.Bot, p *VerifyUserParams) (bool, // // Verifies a chat on behalf of the organization which is represented by the bot. Returns True on success. type VerifyChatParams struct { - // Unique identifier for the target chat or username of the target bot, supergroup or channel in the format @username. Channel direct messages chats can't be verified. + // Unique identifier for the target chat or username of the target bot, supergroup, or channel in the format @username. Channel direct messages chats can't be verified. ChatID ChatID `json:"chat_id"` // Custom description for the verification; 0-70 characters. Must be empty if the organization isn't allowed to provide a custom verification description. CustomDescription string `json:"custom_description,omitempty"` + // Mode for parsing entities in the custom description. See formatting options for more details. Only “text_link” entities are supported. + CustomDescriptionParseMode ParseMode `json:"custom_description_parse_mode,omitempty"` + // A JSON-serialized list of special entities that appear in the custom description, which can be specified instead of custom_description_parse_mode. Only “text_link” entities are supported. + CustomDescriptionEntities []MessageEntity `json:"custom_description_entities,omitempty"` } // VerifyChat calls the verifyChat Telegram Bot API method. @@ -3600,7 +3789,7 @@ func RemoveUserVerification(ctx context.Context, b *client.Bot, p *RemoveUserVer // // Removes verification from a chat that is currently verified on behalf of the organization represented by the bot. Returns True on success. type RemoveChatVerificationParams struct { - // Unique identifier for the target chat or username of the target bot or channel in the format @username + // Unique identifier for the target chat or username of the target bot, supergroup, or channel in the format @username ChatID ChatID `json:"chat_id"` } @@ -3613,7 +3802,7 @@ func RemoveChatVerification(ctx context.Context, b *client.Bot, p *RemoveChatVer // ReadBusinessMessageParams is the parameter set for ReadBusinessMessage. // -// Marks incoming message as read on behalf of a business account. Requires the can_read_messages business bot right. Returns True on success. +// Marks an incoming message as read on behalf of a business account. Requires the can_read_messages business bot right. Returns True on success. type ReadBusinessMessageParams struct { // Unique identifier of the business connection on behalf of which to read the message BusinessConnectionID string `json:"business_connection_id"` @@ -3625,14 +3814,14 @@ type ReadBusinessMessageParams struct { // ReadBusinessMessage calls the readBusinessMessage Telegram Bot API method. // -// Marks incoming message as read on behalf of a business account. Requires the can_read_messages business bot right. Returns True on success. +// Marks an incoming message as read on behalf of a business account. Requires the can_read_messages business bot right. Returns True on success. func ReadBusinessMessage(ctx context.Context, b *client.Bot, p *ReadBusinessMessageParams) (bool, error) { return client.Call[*ReadBusinessMessageParams, bool](ctx, b, "readBusinessMessage", p) } // DeleteBusinessMessagesParams is the parameter set for DeleteBusinessMessages. // -// Delete 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 message. Returns True on success. +// Deletes 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 message. Returns True on success. type DeleteBusinessMessagesParams struct { // Unique identifier of the business connection on behalf of which to delete the messages BusinessConnectionID string `json:"business_connection_id"` @@ -3642,14 +3831,14 @@ type DeleteBusinessMessagesParams struct { // DeleteBusinessMessages calls the deleteBusinessMessages Telegram Bot API method. // -// Delete 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 message. Returns True on success. +// Deletes 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 message. Returns True on success. func DeleteBusinessMessages(ctx context.Context, b *client.Bot, p *DeleteBusinessMessagesParams) (bool, error) { return client.Call[*DeleteBusinessMessagesParams, bool](ctx, b, "deleteBusinessMessages", p) } // SetBusinessAccountNameParams is the parameter set for SetBusinessAccountName. // -// Changes the first and last name of a managed business account. Requires the can_change_name business bot right. Returns True on success. +// Changes the first and last name of a managed business account. Requires the can_edit_name business bot right. Returns True on success. type SetBusinessAccountNameParams struct { // Unique identifier of the business connection BusinessConnectionID string `json:"business_connection_id"` @@ -3661,14 +3850,14 @@ type SetBusinessAccountNameParams struct { // SetBusinessAccountName calls the setBusinessAccountName Telegram Bot API method. // -// Changes the first and last name of a managed business account. Requires the can_change_name business bot right. Returns True on success. +// Changes the first and last name of a managed business account. Requires the can_edit_name business bot right. Returns True on success. func SetBusinessAccountName(ctx context.Context, b *client.Bot, p *SetBusinessAccountNameParams) (bool, error) { return client.Call[*SetBusinessAccountNameParams, bool](ctx, b, "setBusinessAccountName", p) } // SetBusinessAccountUsernameParams is the parameter set for SetBusinessAccountUsername. // -// Changes the username of a managed business account. Requires the can_change_username business bot right. Returns True on success. +// Changes the username of a managed business account. Requires the can_edit_username business bot right. Returns True on success. type SetBusinessAccountUsernameParams struct { // Unique identifier of the business connection BusinessConnectionID string `json:"business_connection_id"` @@ -3678,14 +3867,14 @@ type SetBusinessAccountUsernameParams struct { // SetBusinessAccountUsername calls the setBusinessAccountUsername Telegram Bot API method. // -// Changes the username of a managed business account. Requires the can_change_username business bot right. Returns True on success. +// Changes the username of a managed business account. Requires the can_edit_username business bot right. Returns True on success. func SetBusinessAccountUsername(ctx context.Context, b *client.Bot, p *SetBusinessAccountUsernameParams) (bool, error) { return client.Call[*SetBusinessAccountUsernameParams, bool](ctx, b, "setBusinessAccountUsername", p) } // SetBusinessAccountBioParams is the parameter set for SetBusinessAccountBio. // -// Changes the bio of a managed business account. Requires the can_change_bio business bot right. Returns True on success. +// Changes the bio of a managed business account. Requires the can_edit_bio business bot right. Returns True on success. type SetBusinessAccountBioParams struct { // Unique identifier of the business connection BusinessConnectionID string `json:"business_connection_id"` @@ -3695,7 +3884,7 @@ type SetBusinessAccountBioParams struct { // SetBusinessAccountBio calls the setBusinessAccountBio Telegram Bot API method. // -// Changes the bio of a managed business account. Requires the can_change_bio business bot right. Returns True on success. +// Changes the bio of a managed business account. Requires the can_edit_bio business bot right. Returns True on success. func SetBusinessAccountBio(ctx context.Context, b *client.Bot, p *SetBusinessAccountBioParams) (bool, error) { return client.Call[*SetBusinessAccountBioParams, bool](ctx, b, "setBusinessAccountBio", p) } @@ -3809,7 +3998,7 @@ type GetBusinessAccountGiftsParams struct { ExcludeFromBlockchain *bool `json:"exclude_from_blockchain,omitempty"` // Pass True to sort results by gift price instead of send date. Sorting is applied before pagination. SortByPrice *bool `json:"sort_by_price,omitempty"` - // Offset of the first entry to return as received from the previous request; use empty string to get the first chunk of results + // Offset of the first entry to return as received from the previous request; use an empty string to get the first chunk of results Offset string `json:"offset,omitempty"` // The maximum number of gifts to be returned; 1-100. Defaults to 100. Limit *int64 `json:"limit,omitempty"` @@ -3888,6 +4077,21 @@ func GetChatGifts(ctx context.Context, b *client.Bot, p *GetChatGiftsParams) (*O return client.Call[*GetChatGiftsParams, *OwnedGifts](ctx, b, "getChatGifts", p) } +// GetUniqueGiftParams is the parameter set for GetUniqueGift. +// +// Use this method to get information about a unique gift by its name. Returns a UniqueGift object on success. +type GetUniqueGiftParams struct { + // Unique name of the gift + Name string `json:"name"` +} + +// GetUniqueGift calls the getUniqueGift Telegram Bot API method. +// +// Use this method to get information about a unique gift by its name. Returns a UniqueGift object on success. +func GetUniqueGift(ctx context.Context, b *client.Bot, p *GetUniqueGiftParams) (*UniqueGift, error) { + return client.Call[*GetUniqueGiftParams, *UniqueGift](ctx, b, "getUniqueGift", p) +} + // ConvertGiftToStarsParams is the parameter set for ConvertGiftToStars. // // Converts a given regular gift to Telegram Stars. Requires the can_convert_gifts_to_stars business bot right. Returns True on success. @@ -3915,7 +4119,7 @@ type UpgradeGiftParams struct { OwnedGiftID string `json:"owned_gift_id"` // Pass True to keep the original gift text, sender and receiver in the upgraded gift KeepOriginalDetails *bool `json:"keep_original_details,omitempty"` - // The amount of Telegram Stars that will be paid for the upgrade from the business account balance. If gift.prepaid_upgrade_star_count > 0, then pass 0, otherwise, the can_transfer_stars business bot right is required and gift.upgrade_star_count must be passed. + // The amount of Telegram Stars that will be paid for the upgrade from the business account balance. If gift.prepaid_upgrade_star_count > 0, then pass 0; otherwise, the can_transfer_stars business bot right is required and gift.upgrade_star_count must be passed. StarCount *int64 `json:"star_count,omitempty"` } @@ -3928,13 +4132,13 @@ func UpgradeGift(ctx context.Context, b *client.Bot, p *UpgradeGiftParams) (bool // TransferGiftParams is the parameter set for TransferGift. // -// Transfers 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. +// Transfers an owned unique gift to another user. Requires the can_transfer_and_upgrade_gifts business bot right. Requires the can_transfer_stars business bot right if the transfer is paid. Returns True on success. type TransferGiftParams struct { // Unique identifier of the business connection BusinessConnectionID string `json:"business_connection_id"` - // Unique identifier of the regular gift that should be transferred + // Unique identifier of the unique gift that should be transferred OwnedGiftID string `json:"owned_gift_id"` - // Unique identifier of the chat which will own the gift. The chat must be active in the last 24 hours. + // Unique identifier of the chat which will own the gift. The chat must have been active in the last 24 hours. NewOwnerChatID int64 `json:"new_owner_chat_id"` // The amount of Telegram Stars that will be paid for the transfer from the business account balance. If positive, then the can_transfer_stars business bot right is required. StarCount *int64 `json:"star_count,omitempty"` @@ -3942,11 +4146,28 @@ type TransferGiftParams struct { // TransferGift calls the transferGift Telegram Bot API method. // -// Transfers 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. +// Transfers an owned unique gift to another user. Requires the can_transfer_and_upgrade_gifts business bot right. Requires the can_transfer_stars business bot right if the transfer is paid. Returns True on success. func TransferGift(ctx context.Context, b *client.Bot, p *TransferGiftParams) (bool, error) { return client.Call[*TransferGiftParams, bool](ctx, b, "transferGift", p) } +// DeleteBusinessAccountGiftParams is the parameter set for DeleteBusinessAccountGift. +// +// Deletes 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 total_count of the Gift is omitted) and wasn't refunded. Returns True on success. +type DeleteBusinessAccountGiftParams struct { + // Unique identifier of the business connection + BusinessConnectionID string `json:"business_connection_id"` + // Unique identifier of the regular gift that should be deleted + OwnedGiftID string `json:"owned_gift_id"` +} + +// DeleteBusinessAccountGift calls the deleteBusinessAccountGift Telegram Bot API method. +// +// Deletes 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 total_count of the Gift is omitted) and wasn't refunded. Returns True on success. +func DeleteBusinessAccountGift(ctx context.Context, b *client.Bot, p *DeleteBusinessAccountGiftParams) (bool, error) { + return client.Call[*DeleteBusinessAccountGiftParams, bool](ctx, b, "deleteBusinessAccountGift", p) +} + // PostStoryParams is the parameter set for PostStory. // // Posts a story on behalf of a managed business account. Requires the can_manage_stories business bot right. Returns Story on success. @@ -4108,11 +4329,11 @@ func SavePreparedKeyboardButton(ctx context.Context, b *client.Bot, p *SavePrepa // EditMessageTextParams is the parameter set for EditMessageText. // -// Use 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 sent by the bot and do not contain an inline keyboard can only be edited within 48 hours from the time they were sent. +// Use 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 sent by the bot and do not contain an inline keyboard can only be edited within 48 hours from the time they were sent. type EditMessageTextParams struct { // Unique identifier of the business connection on behalf of which the message to be edited was sent BusinessConnectionID string `json:"business_connection_id,omitempty"` - // Required if inline_message_id is not specified. Unique identifier for the target chat or username of the target bot, supergroup or channel in the format @username. + // Required if inline_message_id is not specified. Unique identifier for the target chat or username of the target bot, supergroup, or channel in the format @username. ChatID *ChatID `json:"chat_id,omitempty"` // Required if inline_message_id is not specified. Identifier of the message to edit. MessageID *int64 `json:"message_id,omitempty"` @@ -4126,7 +4347,7 @@ type EditMessageTextParams struct { Entities []MessageEntity `json:"entities,omitempty"` // Link preview generation options for the message LinkPreviewOptions *LinkPreviewOptions `json:"link_preview_options,omitempty"` - // New rich content of the message; required if text isn't specified. Direct upload of new files and explicit upload of files by a URL isn't supported when an inline message is edited. + // New rich content of the message; required if text isn't specified. Direct upload of new files and explicit upload of files by a URL aren't supported when an inline message is edited. RichMessage *InputRichMessage `json:"rich_message,omitempty"` // A JSON-serialized object for an inline keyboard ReplyMarkup *InlineKeyboardMarkup `json:"reply_markup,omitempty"` @@ -4134,18 +4355,18 @@ type EditMessageTextParams struct { // EditMessageText calls the editMessageText Telegram Bot API method. // -// Use 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 sent by the bot and do not contain an inline keyboard can only be edited within 48 hours from the time they were sent. -func EditMessageText(ctx context.Context, b *client.Bot, p *EditMessageTextParams) (*MessageOrBool, error) { - return client.Call[*EditMessageTextParams, *MessageOrBool](ctx, b, "editMessageText", p) +// Use 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 sent by the bot and do not contain an inline keyboard can only be edited within 48 hours from the time they were sent. +func EditMessageText(ctx context.Context, b *client.Bot, p *EditMessageTextParams) (bool, error) { + return client.Call[*EditMessageTextParams, bool](ctx, b, "editMessageText", p) } // EditMessageCaptionParams is the parameter set for EditMessageCaption. // -// Use 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 bot and do not contain an inline keyboard can only be edited within 48 hours from the time they were sent. +// Use 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 bot and do not contain an inline keyboard can only be edited within 48 hours from the time they were sent. type EditMessageCaptionParams struct { // Unique identifier of the business connection on behalf of which the message to be edited was sent BusinessConnectionID string `json:"business_connection_id,omitempty"` - // Required if inline_message_id is not specified. Unique identifier for the target chat or username of the target bot, supergroup or channel in the format @username. + // Required if inline_message_id is not specified. Unique identifier for the target chat or username of the target bot, supergroup, or channel in the format @username. ChatID *ChatID `json:"chat_id,omitempty"` // Required if inline_message_id is not specified. Identifier of the message to edit. MessageID *int64 `json:"message_id,omitempty"` @@ -4157,7 +4378,7 @@ type EditMessageCaptionParams struct { ParseMode ParseMode `json:"parse_mode,omitempty"` // A JSON-serialized list of special entities that appear in the caption, which can be specified instead of parse_mode CaptionEntities []MessageEntity `json:"caption_entities,omitempty"` - // Pass True if the caption must be shown above the message media. Supported only for animation, photo and video messages. + // Pass True if the caption must be shown above the message media. Supported only for animation, live photo, paid media, photo, video and widget messages. ShowCaptionAboveMedia *bool `json:"show_caption_above_media,omitempty"` // A JSON-serialized object for an inline keyboard ReplyMarkup *InlineKeyboardMarkup `json:"reply_markup,omitempty"` @@ -4165,18 +4386,18 @@ type EditMessageCaptionParams struct { // EditMessageCaption calls the editMessageCaption Telegram Bot API method. // -// Use 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 bot and do not contain an inline keyboard can only be edited within 48 hours from the time they were sent. -func EditMessageCaption(ctx context.Context, b *client.Bot, p *EditMessageCaptionParams) (*MessageOrBool, error) { - return client.Call[*EditMessageCaptionParams, *MessageOrBool](ctx, b, "editMessageCaption", p) +// Use 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 bot and do not contain an inline keyboard can only be edited within 48 hours from the time they were sent. +func EditMessageCaption(ctx context.Context, b *client.Bot, p *EditMessageCaptionParams) (bool, error) { + return client.Call[*EditMessageCaptionParams, bool](ctx, b, "editMessageCaption", p) } // EditMessageMediaParams is the parameter set for EditMessageMedia. // -// Use 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 audio for audio albums, only to a document for document albums and to a photo, a live photo, or a video otherwise. When an inline message is edited, a new file can't be uploaded; use a previously uploaded file via its file_id or specify a URL. 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 bot and do not contain an inline keyboard can only be edited within 48 hours from the time they were sent. +// Use this method to edit animation, audio, document, live photo, photo, or video messages, or to replace a text or a rich message with media. If a message is part of a message album, then it can be edited only to an audio for audio albums, only to a document for document albums and to a photo, a live photo, or a video otherwise. When an inline message is edited, a new file can't be uploaded; use a previously uploaded file via its file_id or specify a URL. 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 bot and do not contain an inline keyboard can only be edited within 48 hours from the time they were sent. type EditMessageMediaParams struct { // Unique identifier of the business connection on behalf of which the message to be edited was sent BusinessConnectionID string `json:"business_connection_id,omitempty"` - // Required if inline_message_id is not specified. Unique identifier for the target chat or username of the target bot, supergroup or channel in the format @username. + // Required if inline_message_id is not specified. Unique identifier for the target chat or username of the target bot, supergroup, or channel in the format @username. ChatID *ChatID `json:"chat_id,omitempty"` // Required if inline_message_id is not specified. Identifier of the message to edit. MessageID *int64 `json:"message_id,omitempty"` @@ -4227,18 +4448,18 @@ func (p *EditMessageMediaParams) MultipartFiles() []client.MultipartFile { // EditMessageMedia calls the editMessageMedia Telegram Bot API method. // -// Use 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 audio for audio albums, only to a document for document albums and to a photo, a live photo, or a video otherwise. When an inline message is edited, a new file can't be uploaded; use a previously uploaded file via its file_id or specify a URL. 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 bot and do not contain an inline keyboard can only be edited within 48 hours from the time they were sent. -func EditMessageMedia(ctx context.Context, b *client.Bot, p *EditMessageMediaParams) (*MessageOrBool, error) { - return client.Call[*EditMessageMediaParams, *MessageOrBool](ctx, b, "editMessageMedia", p) +// Use this method to edit animation, audio, document, live photo, photo, or video messages, or to replace a text or a rich message with media. If a message is part of a message album, then it can be edited only to an audio for audio albums, only to a document for document albums and to a photo, a live photo, or a video otherwise. When an inline message is edited, a new file can't be uploaded; use a previously uploaded file via its file_id or specify a URL. 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 bot and do not contain an inline keyboard can only be edited within 48 hours from the time they were sent. +func EditMessageMedia(ctx context.Context, b *client.Bot, p *EditMessageMediaParams) (bool, error) { + return client.Call[*EditMessageMediaParams, bool](ctx, b, "editMessageMedia", p) } // EditMessageLiveLocationParams is the parameter set for EditMessageLiveLocation. // -// Use 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 inline message, the edited Message is returned, otherwise True is returned. +// Use 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 inline message, the edited Message is returned; otherwise, True is returned. type EditMessageLiveLocationParams struct { // Unique identifier of the business connection on behalf of which the message to be edited was sent BusinessConnectionID string `json:"business_connection_id,omitempty"` - // Required if inline_message_id is not specified. Unique identifier for the target chat or username of the target bot, supergroup or channel in the format @username. + // Required if inline_message_id is not specified. Unique identifier for the target chat or username of the target bot, supergroup, or channel in the format @username. ChatID *ChatID `json:"chat_id,omitempty"` // Required if inline_message_id is not specified. Identifier of the message to edit. MessageID *int64 `json:"message_id,omitempty"` @@ -4262,18 +4483,18 @@ type EditMessageLiveLocationParams struct { // EditMessageLiveLocation calls the editMessageLiveLocation Telegram Bot API method. // -// Use 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 inline message, the edited Message is returned, otherwise True is returned. -func EditMessageLiveLocation(ctx context.Context, b *client.Bot, p *EditMessageLiveLocationParams) (*MessageOrBool, error) { - return client.Call[*EditMessageLiveLocationParams, *MessageOrBool](ctx, b, "editMessageLiveLocation", p) +// Use 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 inline message, the edited Message is returned; otherwise, True is returned. +func EditMessageLiveLocation(ctx context.Context, b *client.Bot, p *EditMessageLiveLocationParams) (bool, error) { + return client.Call[*EditMessageLiveLocationParams, bool](ctx, b, "editMessageLiveLocation", p) } // StopMessageLiveLocationParams is the parameter set for StopMessageLiveLocation. // -// Use 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. +// Use 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. type StopMessageLiveLocationParams struct { // Unique identifier of the business connection on behalf of which the message to be edited was sent BusinessConnectionID string `json:"business_connection_id,omitempty"` - // Required if inline_message_id is not specified. Unique identifier for the target chat or username of the target bot, supergroup or channel in the format @username. + // Required if inline_message_id is not specified. Unique identifier for the target chat or username of the target bot, supergroup, or channel in the format @username. ChatID *ChatID `json:"chat_id,omitempty"` // Required if inline_message_id is not specified. Identifier of the message with live location to stop. MessageID *int64 `json:"message_id,omitempty"` @@ -4285,16 +4506,16 @@ type StopMessageLiveLocationParams struct { // StopMessageLiveLocation calls the stopMessageLiveLocation Telegram Bot API method. // -// Use 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. -func StopMessageLiveLocation(ctx context.Context, b *client.Bot, p *StopMessageLiveLocationParams) (*MessageOrBool, error) { - return client.Call[*StopMessageLiveLocationParams, *MessageOrBool](ctx, b, "stopMessageLiveLocation", p) +// Use 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. +func StopMessageLiveLocation(ctx context.Context, b *client.Bot, p *StopMessageLiveLocationParams) (bool, error) { + return client.Call[*StopMessageLiveLocationParams, bool](ctx, b, "stopMessageLiveLocation", p) } // EditMessageChecklistParams is the parameter set for EditMessageChecklist. // // Use this method to edit a checklist on behalf of a connected business account. On success, the edited Message is returned. type EditMessageChecklistParams struct { - // Unique identifier of the business connection on behalf of which the message will be sent + // Unique identifier of the business connection on behalf of which the message to be edited was sent BusinessConnectionID string `json:"business_connection_id"` // Unique identifier for the target chat or username of the target bot in the format @username ChatID ChatID `json:"chat_id"` @@ -4313,13 +4534,55 @@ func EditMessageChecklist(ctx context.Context, b *client.Bot, p *EditMessageChec return client.Call[*EditMessageChecklistParams, *Message](ctx, b, "editMessageChecklist", p) } +// EditMessageWidgetDataParams is the parameter set for EditMessageWidgetData. +// +// Use 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. +type EditMessageWidgetDataParams struct { + // Required if inline_message_id is not specified. Unique identifier for the target chat or username of the target supergroup in the format @username. + ChatID *ChatID `json:"chat_id,omitempty"` + // Required if inline_message_id is not specified. Identifier of the message with the widget. + MessageID *int64 `json:"message_id,omitempty"` + // Required if chat_id and message_id are not specified. Identifier of the inline message. + InlineMessageID string `json:"inline_message_id,omitempty"` + // New public data of the widget, 0-1024 bytes; pass an empty string to remove the public data. If omitted, then the public data isn't changed. + PublicData string `json:"public_data,omitempty"` + // New data of the widget, which is specific to the message, 0-1024 bytes; pass an empty string to remove the data. If omitted, then the data isn't changed. + ChatData string `json:"chat_data,omitempty"` +} + +// EditMessageWidgetData calls the editMessageWidgetData Telegram Bot API method. +// +// Use 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. +func EditMessageWidgetData(ctx context.Context, b *client.Bot, p *EditMessageWidgetDataParams) (bool, error) { + return client.Call[*EditMessageWidgetDataParams, bool](ctx, b, "editMessageWidgetData", p) +} + +// EditSharedWidgetDataParams is the parameter set for EditSharedWidgetData. +// +// Use 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. +type EditSharedWidgetDataParams struct { + // Unique identifier of the shared widget + WidgetID string `json:"widget_id"` + // New public data of the widget, 0-1024 bytes; pass an empty string to remove the public data + PublicData string `json:"public_data"` + // The maximum amount of time in seconds that the public data of the widget may be cached client-side; 5-3600. If omitted, then the current value is kept, which is 30 by default. + CacheTime *int64 `json:"cache_time,omitempty"` +} + +// EditSharedWidgetData calls the editSharedWidgetData Telegram Bot API method. +// +// Use 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. +func EditSharedWidgetData(ctx context.Context, b *client.Bot, p *EditSharedWidgetDataParams) (bool, error) { + return client.Call[*EditSharedWidgetDataParams, bool](ctx, b, "editSharedWidgetData", p) +} + // EditMessageReplyMarkupParams is the parameter set for EditMessageReplyMarkup. // -// Use 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 not sent by the bot and do not contain an inline keyboard can only be edited within 48 hours from the time they were sent. +// Use 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 not sent by the bot and do not contain an inline keyboard can only be edited within 48 hours from the time they were sent. type EditMessageReplyMarkupParams struct { // Unique identifier of the business connection on behalf of which the message to be edited was sent BusinessConnectionID string `json:"business_connection_id,omitempty"` - // Required if inline_message_id is not specified. Unique identifier for the target chat or username of the target bot, supergroup or channel in the format @username. + // Required if inline_message_id is not specified. Unique identifier for the target chat or username of the target bot, supergroup, or channel in the format @username. ChatID *ChatID `json:"chat_id,omitempty"` // Required if inline_message_id is not specified. Identifier of the message to edit. MessageID *int64 `json:"message_id,omitempty"` @@ -4331,9 +4594,9 @@ type EditMessageReplyMarkupParams struct { // EditMessageReplyMarkup calls the editMessageReplyMarkup Telegram Bot API method. // -// Use 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 not sent by the bot and do not contain an inline keyboard can only be edited within 48 hours from the time they were sent. -func EditMessageReplyMarkup(ctx context.Context, b *client.Bot, p *EditMessageReplyMarkupParams) (*MessageOrBool, error) { - return client.Call[*EditMessageReplyMarkupParams, *MessageOrBool](ctx, b, "editMessageReplyMarkup", p) +// Use 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 not sent by the bot and do not contain an inline keyboard can only be edited within 48 hours from the time they were sent. +func EditMessageReplyMarkup(ctx context.Context, b *client.Bot, p *EditMessageReplyMarkupParams) (bool, error) { + return client.Call[*EditMessageReplyMarkupParams, bool](ctx, b, "editMessageReplyMarkup", p) } // StopPollParams is the parameter set for StopPoll. @@ -4342,7 +4605,7 @@ func EditMessageReplyMarkup(ctx context.Context, b *client.Bot, p *EditMessageRe type StopPollParams struct { // Unique identifier of the business connection on behalf of which the message to be edited was sent BusinessConnectionID string `json:"business_connection_id,omitempty"` - // Unique identifier for the target chat or username of the target bot, supergroup or channel in the format @username + // Unique identifier for the target chat or username of the target bot, supergroup, or channel in the format @username ChatID ChatID `json:"chat_id"` // Identifier of the original message with the poll MessageID int64 `json:"message_id"` @@ -4455,7 +4718,7 @@ type EditEphemeralMessageCaptionParams struct { ParseMode ParseMode `json:"parse_mode,omitempty"` // A JSON-serialized list of special entities that appear in the caption, which can be specified instead of parse_mode CaptionEntities []MessageEntity `json:"caption_entities,omitempty"` - // Pass True if the caption must be shown above the message media. Supported only for animation, photo and video messages. + // Pass True if the caption must be shown above the message media. Supported only for animation, live photo, photo and video messages. ShowCaptionAboveMedia *bool `json:"show_caption_above_media,omitempty"` // A JSON-serialized object for an inline keyboard ReplyMarkup *InlineKeyboardMarkup `json:"reply_markup,omitempty"` @@ -4497,7 +4760,7 @@ type ApproveSuggestedPostParams struct { ChatID int64 `json:"chat_id"` // Identifier of a suggested post message to approve MessageID int64 `json:"message_id"` - // Point in time (Unix timestamp) when the post is expected to be published; omit if the date has already been specified when the suggested post was created. If specified, then the date must be not more than 2678400 seconds (30 days) in the future. + // Point in time (Unix timestamp) when the post is expected to be published; omit if the date has already been specified when the suggested post was created. If specified, then the date must not be more than 2678400 seconds (30 days) in the future. SendDate *int64 `json:"send_date,omitempty"` } @@ -4529,9 +4792,9 @@ func DeclineSuggestedPost(ctx context.Context, b *client.Bot, p *DeclineSuggeste // DeleteMessageParams is the parameter set for DeleteMessage. // -// Use this method to delete a message, including service messages, with the following limitations:- A message can only be deleted if it was sent less than 48 hours ago.- Service messages about a supergroup, channel, or forum topic creation can't be deleted.- A dice message in a private chat can only be deleted if it was sent more than 24 hours ago.- Bots can delete outgoing messages in private chats, groups, and supergroups.- Bots can delete incoming messages in private chats.- Bots granted can_post_messages permissions can delete outgoing messages in channels.- If the bot is an administrator of a group, it can delete any message there.- If the bot has can_delete_messages administrator right in a supergroup or a channel, it can delete any message there.- If the bot has can_manage_direct_messages administrator right in a channel, it can delete any message in the corresponding direct messages chat.Returns True on success. +// Use this method to delete a message, including service messages, with the following limitations:- A message can only be deleted if it was sent less than 48 hours ago.- Service messages about a supergroup, channel, or forum topic creation can't be deleted.- A dice message in a private chat can only be deleted if it was sent more than 24 hours ago.- Bots can delete outgoing messages in private chats, groups, and supergroups.- Bots can delete incoming messages in private chats.- Bots granted can_post_messages permissions can delete outgoing messages in channels.- If the bot is an administrator of a group, it can delete any message there.- If the bot has the can_delete_messages administrator right in a supergroup or a channel, it can delete any message there.- If the bot has the can_manage_direct_messages administrator right in a channel, it can delete any message in the corresponding direct messages chat.Returns True on success. type DeleteMessageParams struct { - // Unique identifier for the target chat or username of the target bot, supergroup or channel in the format @username + // Unique identifier for the target chat or username of the target bot, supergroup, or channel in the format @username ChatID ChatID `json:"chat_id"` // Identifier of the message to delete MessageID int64 `json:"message_id"` @@ -4539,7 +4802,7 @@ type DeleteMessageParams struct { // DeleteMessage calls the deleteMessage Telegram Bot API method. // -// Use this method to delete a message, including service messages, with the following limitations:- A message can only be deleted if it was sent less than 48 hours ago.- Service messages about a supergroup, channel, or forum topic creation can't be deleted.- A dice message in a private chat can only be deleted if it was sent more than 24 hours ago.- Bots can delete outgoing messages in private chats, groups, and supergroups.- Bots can delete incoming messages in private chats.- Bots granted can_post_messages permissions can delete outgoing messages in channels.- If the bot is an administrator of a group, it can delete any message there.- If the bot has can_delete_messages administrator right in a supergroup or a channel, it can delete any message there.- If the bot has can_manage_direct_messages administrator right in a channel, it can delete any message in the corresponding direct messages chat.Returns True on success. +// Use this method to delete a message, including service messages, with the following limitations:- A message can only be deleted if it was sent less than 48 hours ago.- Service messages about a supergroup, channel, or forum topic creation can't be deleted.- A dice message in a private chat can only be deleted if it was sent more than 24 hours ago.- Bots can delete outgoing messages in private chats, groups, and supergroups.- Bots can delete incoming messages in private chats.- Bots granted can_post_messages permissions can delete outgoing messages in channels.- If the bot is an administrator of a group, it can delete any message there.- If the bot has the can_delete_messages administrator right in a supergroup or a channel, it can delete any message there.- If the bot has the can_manage_direct_messages administrator right in a channel, it can delete any message in the corresponding direct messages chat.Returns True on success. func DeleteMessage(ctx context.Context, b *client.Bot, p *DeleteMessageParams) (bool, error) { return client.Call[*DeleteMessageParams, bool](ctx, b, "deleteMessage", p) } @@ -4548,7 +4811,7 @@ func DeleteMessage(ctx context.Context, b *client.Bot, p *DeleteMessageParams) ( // // Use this method to delete multiple messages simultaneously. If some of the specified messages can't be found, they are skipped. Returns True on success. type DeleteMessagesParams struct { - // Unique identifier for the target chat or username of the target bot, supergroup or channel in the format @username + // Unique identifier for the target chat or username of the target bot, supergroup, or channel in the format @username ChatID ChatID `json:"chat_id"` // A JSON-serialized list of 1-100 identifiers of messages to delete. See deleteMessage for limitations on which messages can be deleted. MessageIds []int64 `json:"message_ids"` @@ -4626,8 +4889,8 @@ func DeleteAllMessageReactions(ctx context.Context, b *client.Bot, p *DeleteAllM type SendStickerParams struct { // Unique identifier of the business connection on behalf of which the message will be sent BusinessConnectionID string `json:"business_connection_id,omitempty"` - // Unique identifier for the target chat or username of the target bot, supergroup or channel in the format @username - ChatID ChatID `json:"chat_id"` + // Unique identifier for the target chat or username of the target bot, supergroup, or channel in the format @username; required unless the message is sent as an ephemeral reply to a callback query + ChatID *ChatID `json:"chat_id,omitempty"` // Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only MessageThreadID *int64 `json:"message_thread_id,omitempty"` // Identifier of the direct messages topic to which the message will be sent; required if the message is sent to a direct messages chat @@ -4668,7 +4931,9 @@ func (p *SendStickerParams) MultipartFields() map[string]string { if p.BusinessConnectionID != "" { out["business_connection_id"] = p.BusinessConnectionID } - out["chat_id"] = p.ChatID.String() + if !p.ChatID.IsZero() { + out["chat_id"] = p.ChatID.String() + } if p.MessageThreadID != nil { out["message_thread_id"] = strconv.FormatInt(*p.MessageThreadID, 10) } @@ -4931,7 +5196,7 @@ func SetStickerEmojiList(ctx context.Context, b *client.Bot, p *SetStickerEmojiL type SetStickerKeywordsParams struct { // File identifier of the sticker Sticker string `json:"sticker"` - // A JSON-serialized list of 0-20 search keywords for the sticker with total length of up to 64 characters + // A JSON-serialized list of 0-20 search keywords for the sticker with a total length of up to 64 characters Keywords []string `json:"keywords,omitempty"` } @@ -5063,10 +5328,10 @@ func DeleteStickerSet(ctx context.Context, b *client.Bot, p *DeleteStickerSetPar // // Use 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. type SendRichMessageParams struct { - // Unique identifier of the business connection on behalf of which the message will be sent. Bot can send rich messages on behalf of a business account only if the corresponding user can send rich messages. + // Unique identifier of the business connection on behalf of which the message will be sent. The bot can send rich messages on behalf of a business account only if the corresponding user can send rich messages. BusinessConnectionID string `json:"business_connection_id,omitempty"` - // Unique identifier for the target chat or username of the target bot, supergroup or channel in the format @username - ChatID ChatID `json:"chat_id"` + // Unique identifier for the target chat or username of the target bot, supergroup, or channel in the format @username; required unless the message is sent as an ephemeral reply to a callback query + ChatID *ChatID `json:"chat_id,omitempty"` // Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only MessageThreadID *int64 `json:"message_thread_id,omitempty"` // Identifier of the direct messages topic to which the message will be sent; required if the message is sent to a direct messages chat @@ -5108,7 +5373,7 @@ type SendRichMessageDraftParams struct { MessageThreadID *int64 `json:"message_thread_id,omitempty"` // Unique identifier of the message draft; must be non-zero. Changes to drafts with the same identifier are animated. Otherwise, the draft is replaced without animation. DraftID int64 `json:"draft_id"` - // The partial message to be streamed. Direct upload of new files and explicit upload of files by a URL isn't supported. + // The partial message to be streamed. Direct upload of new files and explicit upload of files by a URL aren't supported. RichMessage InputRichMessage `json:"rich_message"` // Pass True to show the user a button to stop further drafts. The bot will receive an Update “stopped_message_generation” if the user presses the button. CanStop *bool `json:"can_stop,omitempty"` @@ -5152,7 +5417,7 @@ func AnswerInlineQuery(ctx context.Context, b *client.Bot, p *AnswerInlineQueryP // // Use this method to send invoices. On success, the sent Message is returned. type SendInvoiceParams struct { - // Unique identifier for the target chat or username of the target bot, supergroup or channel in the format @username + // Unique identifier for the target chat or username of the target bot, supergroup, or channel in the format @username ChatID ChatID `json:"chat_id"` // Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only MessageThreadID *int64 `json:"message_thread_id,omitempty"` @@ -5162,7 +5427,7 @@ type SendInvoiceParams struct { Title string `json:"title"` // Product description, 1-255 characters Description string `json:"description"` - // Bot-defined invoice payload, 1-128 bytes. This will not be displayed to the user, use it for your internal processes. + // Bot-defined invoice payload, 1-128 bytes. This will not be displayed to the user; use it for your internal processes. Payload string `json:"payload"` // Payment provider token, obtained via @BotFather. Pass an empty string for payments in Telegram Stars. ProviderToken string `json:"provider_token,omitempty"` @@ -5170,13 +5435,13 @@ type SendInvoiceParams struct { Currency string `json:"currency"` // Price breakdown, a JSON-serialized list of components (e.g. product price, tax, discount, delivery cost, delivery tax, bonus, etc.). Must contain exactly one item for payments in Telegram Stars. Prices []LabeledPrice `json:"prices"` - // The maximum accepted amount for tips in the smallest units of the currency (integer, not float/double). For example, for a maximum tip of US$ 1.45 pass max_tip_amount = 145. See the exp parameter in currencies.json, it shows the number of digits past the decimal point for each currency (2 for the majority of currencies). Defaults to 0. Not supported for payments in Telegram Stars. + // The maximum accepted amount for tips in the smallest units of the currency (integer, not float/double). For example, for a maximum tip of US$ 1.45 pass max_tip_amount = 145. See the exp parameter in currencies.json; it shows the number of digits past the decimal point for each currency (2 for the majority of currencies). Defaults to 0. Not supported for payments in Telegram Stars. MaxTipAmount *int64 `json:"max_tip_amount,omitempty"` - // A JSON-serialized Array of suggested amounts of tips in the smallest units of the currency (integer, not float/double). At most 4 suggested tip amounts can be specified. The suggested tip amounts must be positive, passed in a strictly increased order and must not exceed max_tip_amount. + // A JSON-serialized Array of suggested amounts of tips in the smallest units of the currency (integer, not float/double). At most 4 suggested tip amounts can be specified. The suggested tip amounts must be positive, passed in a strictly increasing order and must not exceed max_tip_amount. SuggestedTipAmounts []int64 `json:"suggested_tip_amounts,omitempty"` // Unique deep-linking parameter. If left empty, forwarded copies of the sent message will have a Pay button, allowing multiple users to pay directly from the forwarded message, using the same invoice. If non-empty, forwarded copies of the sent message will have a URL button with a deep link to the bot (instead of a Pay button), with the value used as the start parameter. StartParameter string `json:"start_parameter,omitempty"` - // JSON-serialized data about the invoice, which will be shared with the payment provider. A detailed description of required fields should be provided by the payment provider. + // JSON-serialized data about the invoice, which will be shared with the payment provider. A detailed description of the required fields should be provided by the payment provider. ProviderData string `json:"provider_data,omitempty"` // URL of the product photo for the invoice. Can be a photo of the goods or a marketing image for a service. People like it better when they see what they are paying for. PhotoURL string `json:"photo_url,omitempty"` @@ -5233,7 +5498,7 @@ type CreateInvoiceLinkParams struct { Title string `json:"title"` // Product description, 1-255 characters Description string `json:"description"` - // Bot-defined invoice payload, 1-128 bytes. This will not be displayed to the user, use it for your internal processes. + // Bot-defined invoice payload, 1-128 bytes. This will not be displayed to the user; use it for your internal processes. Payload string `json:"payload"` // Payment provider token, obtained via @BotFather. Pass an empty string for payments in Telegram Stars. ProviderToken string `json:"provider_token,omitempty"` @@ -5241,13 +5506,13 @@ type CreateInvoiceLinkParams struct { Currency string `json:"currency"` // Price breakdown, a JSON-serialized list of components (e.g. product price, tax, discount, delivery cost, delivery tax, bonus, etc.). Must contain exactly one item for payments in Telegram Stars. Prices []LabeledPrice `json:"prices"` - // The number of seconds the subscription will be active for before the next payment. The currency must be set to “XTR” (Telegram Stars) if the parameter is used. Currently, it must always be 2592000 (30 days) if specified. Any number of subscriptions can be active for a given bot at the same time, including multiple concurrent subscriptions from the same user. Subscription price must no exceed 10000 Telegram Stars. + // The number of seconds the subscription will be active for before the next payment. The currency must be set to “XTR” (Telegram Stars) if the parameter is used. Currently, it must always be 2592000 (30 days) if specified. Any number of subscriptions can be active for a given bot at the same time, including multiple concurrent subscriptions from the same user. Subscription price must not exceed 10000 Telegram Stars. SubscriptionPeriod *int64 `json:"subscription_period,omitempty"` - // The maximum accepted amount for tips in the smallest units of the currency (integer, not float/double). For example, for a maximum tip of US$ 1.45 pass max_tip_amount = 145. See the exp parameter in currencies.json, it shows the number of digits past the decimal point for each currency (2 for the majority of currencies). Defaults to 0. Not supported for payments in Telegram Stars. + // The maximum accepted amount for tips in the smallest units of the currency (integer, not float/double). For example, for a maximum tip of US$ 1.45 pass max_tip_amount = 145. See the exp parameter in currencies.json; it shows the number of digits past the decimal point for each currency (2 for the majority of currencies). Defaults to 0. Not supported for payments in Telegram Stars. MaxTipAmount *int64 `json:"max_tip_amount,omitempty"` - // A JSON-serialized Array of suggested amounts of tips in the smallest units of the currency (integer, not float/double). At most 4 suggested tip amounts can be specified. The suggested tip amounts must be positive, passed in a strictly increased order and must not exceed max_tip_amount. + // A JSON-serialized Array of suggested amounts of tips in the smallest units of the currency (integer, not float/double). At most 4 suggested tip amounts can be specified. The suggested tip amounts must be positive, passed in a strictly increasing order and must not exceed max_tip_amount. SuggestedTipAmounts []int64 `json:"suggested_tip_amounts,omitempty"` - // JSON-serialized data about the invoice, which will be shared with the payment provider. A detailed description of required fields should be provided by the payment provider. + // JSON-serialized data about the invoice, which will be shared with the payment provider. A detailed description of the required fields should be provided by the payment provider. ProviderData string `json:"provider_data,omitempty"` // URL of the product photo for the invoice. Can be a photo of the goods or a marketing image for a service. PhotoURL string `json:"photo_url,omitempty"` @@ -5290,7 +5555,7 @@ type AnswerShippingQueryParams struct { Ok bool `json:"ok"` // Required if ok is True. A JSON-serialized Array of available shipping options. ShippingOptions []ShippingOption `json:"shipping_options,omitempty"` - // Required if ok is False. Error message in human readable form that explains why it is impossible to complete the order (e.g. “Sorry, delivery to your desired address is unavailable”). Telegram will display this message to the user. + // Required if ok is False. Error message in human-readable form that explains why it is impossible to complete the order (e.g. “Sorry, delivery to your desired address is unavailable”). Telegram will display this message to the user. ErrorMessage string `json:"error_message,omitempty"` } @@ -5309,7 +5574,7 @@ type AnswerPreCheckoutQueryParams struct { PreCheckoutQueryID string `json:"pre_checkout_query_id"` // Specify True if everything is alright (goods are available, etc.) and the bot is ready to proceed with the order. Use False if there are any problems. Ok bool `json:"ok"` - // Required if ok is False. Error message in human readable form that explains the reason for failure to proceed with the checkout (e.g. "Sorry, somebody just bought the last of our amazing black T-shirts while you were busy filling out your payment details. Please choose a different color or garment!"). Telegram will display this message to the user. + // Required if ok is False. Error message in human-readable form that explains the reason for failure to proceed with the checkout (e.g. "Sorry, somebody just bought the last of our amazing black T-shirts while you were busy filling out your payment details. Please choose a different color or garment!"). Telegram will display this message to the user. ErrorMessage string `json:"error_message,omitempty"` } @@ -5388,7 +5653,7 @@ func EditUserStarSubscription(ctx context.Context, b *client.Bot, p *EditUserSta // SetPassportDataErrorsParams is the parameter set for SetPassportDataErrors. // -// Informs 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 returned the error must change). Returns True on success. +// Informs a user that some of the Telegram Passport elements they provided contain 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 returned the error must change). Returns True on success. // Use this if the data submitted by the user doesn't satisfy the standards your service requires for any reason. For example, if a birthday date seems invalid, a submitted document is blurry, a scan shows evidence of tampering, etc. Supply some details in the error message to make sure the user knows how to correct the issues. type SetPassportDataErrorsParams struct { // User identifier @@ -5399,7 +5664,7 @@ type SetPassportDataErrorsParams struct { // SetPassportDataErrors calls the setPassportDataErrors Telegram Bot API method. // -// Informs 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 returned the error must change). Returns True on success. +// Informs a user that some of the Telegram Passport elements they provided contain 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 returned the error must change). Returns True on success. // Use this if the data submitted by the user doesn't satisfy the standards your service requires for any reason. For example, if a birthday date seems invalid, a submitted document is blurry, a scan shows evidence of tampering, etc. Supply some details in the error message to make sure the user knows how to correct the issues. func SetPassportDataErrors(ctx context.Context, b *client.Bot, p *SetPassportDataErrorsParams) (bool, error) { return client.Call[*SetPassportDataErrorsParams, bool](ctx, b, "setPassportDataErrors", p) @@ -5440,7 +5705,7 @@ func SendGame(ctx context.Context, b *client.Bot, p *SendGameParams) (*Message, // SetGameScoreParams is the parameter set for SetGameScore. // -// Use 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 not greater than the user's current score in the chat and force is False. +// Use 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 not greater than the user's current score in the chat and force is False. type SetGameScoreParams struct { // User identifier UserID int64 `json:"user_id"` @@ -5460,9 +5725,9 @@ type SetGameScoreParams struct { // SetGameScore calls the setGameScore Telegram Bot API method. // -// Use 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 not greater than the user's current score in the chat and force is False. -func SetGameScore(ctx context.Context, b *client.Bot, p *SetGameScoreParams) (*MessageOrBool, error) { - return client.Call[*SetGameScoreParams, *MessageOrBool](ctx, b, "setGameScore", p) +// Use 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 not greater than the user's current score in the chat and force is False. +func SetGameScore(ctx context.Context, b *client.Bot, p *SetGameScoreParams) (bool, error) { + return client.Call[*SetGameScoreParams, bool](ctx, b, "setGameScore", p) } // GetGameHighScoresParams is the parameter set for GetGameHighScores. diff --git a/api/methods_gen_test.go b/api/methods_gen_test.go index 861fa5a..3619bac 100644 --- a/api/methods_gen_test.go +++ b/api/methods_gen_test.go @@ -892,8 +892,7 @@ func Test_SendMessage_Success(t *testing.T) { bot := client.New("test:token", client.WithHTTPClient(m)) params := &SendMessageParams{ - ChatID: ChatIDFromInt(123), - Text: "test_value", + Text: "test_value", } _, err := SendMessage(context.Background(), bot, params) require.NoError(t, err) @@ -906,8 +905,7 @@ func Test_SendMessage_APIError(t *testing.T) { bot := client.New("test:token", client.WithHTTPClient(m)) params := &SendMessageParams{ - ChatID: ChatIDFromInt(123), - Text: "test_value", + Text: "test_value", } _, err := SendMessage(context.Background(), bot, params) require.Error(t, err) @@ -923,8 +921,7 @@ func Test_SendMessage_NetworkError(t *testing.T) { bot := client.New("test:token", client.WithHTTPClient(m)) params := &SendMessageParams{ - ChatID: ChatIDFromInt(123), - Text: "test_value", + Text: "test_value", } _, err := SendMessage(context.Background(), bot, params) require.Error(t, err) @@ -938,8 +935,7 @@ func Test_SendMessage_ParseError(t *testing.T) { bot := client.New("test:token", client.WithHTTPClient(m)) params := &SendMessageParams{ - ChatID: ChatIDFromInt(123), - Text: "test_value", + Text: "test_value", } _, err := SendMessage(context.Background(), bot, params) require.Error(t, err) @@ -956,8 +952,7 @@ func Test_SendMessage_ContextCanceled(t *testing.T) { bot := client.New("test:token", client.WithHTTPClient(m)) params := &SendMessageParams{ - ChatID: ChatIDFromInt(123), - Text: "test_value", + Text: "test_value", } _, err := SendMessage(ctx, bot, params) require.Error(t, err) @@ -996,8 +991,7 @@ func Test_SendMessage_Forbidden(t *testing.T) { bot := client.New("test:token", client.WithHTTPClient(m)) params := &SendMessageParams{ - ChatID: ChatIDFromInt(123), - Text: "test_value", + Text: "test_value", } _, err := SendMessage(context.Background(), bot, params) require.Error(t, err) @@ -1017,8 +1011,7 @@ func Test_SendMessage_ServerError(t *testing.T) { bot := client.New("test:token", client.WithHTTPClient(m)) params := &SendMessageParams{ - ChatID: ChatIDFromInt(123), - Text: "test_value", + Text: "test_value", } _, err := SendMessage(context.Background(), bot, params) require.Error(t, err) @@ -1640,8 +1633,7 @@ func Test_SendPhoto_Success(t *testing.T) { bot := client.New("test:token", client.WithHTTPClient(m)) params := &SendPhotoParams{ - ChatID: ChatIDFromInt(123), - Photo: &InputFile{PathOrID: "file_id_test"}, + Photo: &InputFile{PathOrID: "file_id_test"}, } _, err := SendPhoto(context.Background(), bot, params) require.NoError(t, err) @@ -1654,8 +1646,7 @@ func Test_SendPhoto_APIError(t *testing.T) { bot := client.New("test:token", client.WithHTTPClient(m)) params := &SendPhotoParams{ - ChatID: ChatIDFromInt(123), - Photo: &InputFile{PathOrID: "file_id_test"}, + Photo: &InputFile{PathOrID: "file_id_test"}, } _, err := SendPhoto(context.Background(), bot, params) require.Error(t, err) @@ -1671,8 +1662,7 @@ func Test_SendPhoto_NetworkError(t *testing.T) { bot := client.New("test:token", client.WithHTTPClient(m)) params := &SendPhotoParams{ - ChatID: ChatIDFromInt(123), - Photo: &InputFile{PathOrID: "file_id_test"}, + Photo: &InputFile{PathOrID: "file_id_test"}, } _, err := SendPhoto(context.Background(), bot, params) require.Error(t, err) @@ -1686,8 +1676,7 @@ func Test_SendPhoto_ParseError(t *testing.T) { bot := client.New("test:token", client.WithHTTPClient(m)) params := &SendPhotoParams{ - ChatID: ChatIDFromInt(123), - Photo: &InputFile{PathOrID: "file_id_test"}, + Photo: &InputFile{PathOrID: "file_id_test"}, } _, err := SendPhoto(context.Background(), bot, params) require.Error(t, err) @@ -1704,8 +1693,7 @@ func Test_SendPhoto_ContextCanceled(t *testing.T) { bot := client.New("test:token", client.WithHTTPClient(m)) params := &SendPhotoParams{ - ChatID: ChatIDFromInt(123), - Photo: &InputFile{PathOrID: "file_id_test"}, + Photo: &InputFile{PathOrID: "file_id_test"}, } _, err := SendPhoto(ctx, bot, params) require.Error(t, err) @@ -1744,8 +1732,7 @@ func Test_SendPhoto_Forbidden(t *testing.T) { bot := client.New("test:token", client.WithHTTPClient(m)) params := &SendPhotoParams{ - ChatID: ChatIDFromInt(123), - Photo: &InputFile{PathOrID: "file_id_test"}, + Photo: &InputFile{PathOrID: "file_id_test"}, } _, err := SendPhoto(context.Background(), bot, params) require.Error(t, err) @@ -1765,8 +1752,7 @@ func Test_SendPhoto_ServerError(t *testing.T) { bot := client.New("test:token", client.WithHTTPClient(m)) params := &SendPhotoParams{ - ChatID: ChatIDFromInt(123), - Photo: &InputFile{PathOrID: "file_id_test"}, + Photo: &InputFile{PathOrID: "file_id_test"}, } _, err := SendPhoto(context.Background(), bot, params) require.Error(t, err) @@ -1784,7 +1770,6 @@ func Test_SendLivePhoto_Success(t *testing.T) { bot := client.New("test:token", client.WithHTTPClient(m)) params := &SendLivePhotoParams{ - ChatID: ChatIDFromInt(123), LivePhoto: &InputFile{PathOrID: "file_id_test"}, Photo: &InputFile{PathOrID: "file_id_test"}, } @@ -1799,7 +1784,6 @@ func Test_SendLivePhoto_APIError(t *testing.T) { bot := client.New("test:token", client.WithHTTPClient(m)) params := &SendLivePhotoParams{ - ChatID: ChatIDFromInt(123), LivePhoto: &InputFile{PathOrID: "file_id_test"}, Photo: &InputFile{PathOrID: "file_id_test"}, } @@ -1817,7 +1801,6 @@ func Test_SendLivePhoto_NetworkError(t *testing.T) { bot := client.New("test:token", client.WithHTTPClient(m)) params := &SendLivePhotoParams{ - ChatID: ChatIDFromInt(123), LivePhoto: &InputFile{PathOrID: "file_id_test"}, Photo: &InputFile{PathOrID: "file_id_test"}, } @@ -1833,7 +1816,6 @@ func Test_SendLivePhoto_ParseError(t *testing.T) { bot := client.New("test:token", client.WithHTTPClient(m)) params := &SendLivePhotoParams{ - ChatID: ChatIDFromInt(123), LivePhoto: &InputFile{PathOrID: "file_id_test"}, Photo: &InputFile{PathOrID: "file_id_test"}, } @@ -1852,7 +1834,6 @@ func Test_SendLivePhoto_ContextCanceled(t *testing.T) { bot := client.New("test:token", client.WithHTTPClient(m)) params := &SendLivePhotoParams{ - ChatID: ChatIDFromInt(123), LivePhoto: &InputFile{PathOrID: "file_id_test"}, Photo: &InputFile{PathOrID: "file_id_test"}, } @@ -1893,7 +1874,6 @@ func Test_SendLivePhoto_Forbidden(t *testing.T) { bot := client.New("test:token", client.WithHTTPClient(m)) params := &SendLivePhotoParams{ - ChatID: ChatIDFromInt(123), LivePhoto: &InputFile{PathOrID: "file_id_test"}, Photo: &InputFile{PathOrID: "file_id_test"}, } @@ -1915,7 +1895,6 @@ func Test_SendLivePhoto_ServerError(t *testing.T) { bot := client.New("test:token", client.WithHTTPClient(m)) params := &SendLivePhotoParams{ - ChatID: ChatIDFromInt(123), LivePhoto: &InputFile{PathOrID: "file_id_test"}, Photo: &InputFile{PathOrID: "file_id_test"}, } @@ -1935,8 +1914,7 @@ func Test_SendAudio_Success(t *testing.T) { bot := client.New("test:token", client.WithHTTPClient(m)) params := &SendAudioParams{ - ChatID: ChatIDFromInt(123), - Audio: &InputFile{PathOrID: "file_id_test"}, + Audio: &InputFile{PathOrID: "file_id_test"}, } _, err := SendAudio(context.Background(), bot, params) require.NoError(t, err) @@ -1949,8 +1927,7 @@ func Test_SendAudio_APIError(t *testing.T) { bot := client.New("test:token", client.WithHTTPClient(m)) params := &SendAudioParams{ - ChatID: ChatIDFromInt(123), - Audio: &InputFile{PathOrID: "file_id_test"}, + Audio: &InputFile{PathOrID: "file_id_test"}, } _, err := SendAudio(context.Background(), bot, params) require.Error(t, err) @@ -1966,8 +1943,7 @@ func Test_SendAudio_NetworkError(t *testing.T) { bot := client.New("test:token", client.WithHTTPClient(m)) params := &SendAudioParams{ - ChatID: ChatIDFromInt(123), - Audio: &InputFile{PathOrID: "file_id_test"}, + Audio: &InputFile{PathOrID: "file_id_test"}, } _, err := SendAudio(context.Background(), bot, params) require.Error(t, err) @@ -1981,8 +1957,7 @@ func Test_SendAudio_ParseError(t *testing.T) { bot := client.New("test:token", client.WithHTTPClient(m)) params := &SendAudioParams{ - ChatID: ChatIDFromInt(123), - Audio: &InputFile{PathOrID: "file_id_test"}, + Audio: &InputFile{PathOrID: "file_id_test"}, } _, err := SendAudio(context.Background(), bot, params) require.Error(t, err) @@ -1999,8 +1974,7 @@ func Test_SendAudio_ContextCanceled(t *testing.T) { bot := client.New("test:token", client.WithHTTPClient(m)) params := &SendAudioParams{ - ChatID: ChatIDFromInt(123), - Audio: &InputFile{PathOrID: "file_id_test"}, + Audio: &InputFile{PathOrID: "file_id_test"}, } _, err := SendAudio(ctx, bot, params) require.Error(t, err) @@ -2039,8 +2013,7 @@ func Test_SendAudio_Forbidden(t *testing.T) { bot := client.New("test:token", client.WithHTTPClient(m)) params := &SendAudioParams{ - ChatID: ChatIDFromInt(123), - Audio: &InputFile{PathOrID: "file_id_test"}, + Audio: &InputFile{PathOrID: "file_id_test"}, } _, err := SendAudio(context.Background(), bot, params) require.Error(t, err) @@ -2060,8 +2033,7 @@ func Test_SendAudio_ServerError(t *testing.T) { bot := client.New("test:token", client.WithHTTPClient(m)) params := &SendAudioParams{ - ChatID: ChatIDFromInt(123), - Audio: &InputFile{PathOrID: "file_id_test"}, + Audio: &InputFile{PathOrID: "file_id_test"}, } _, err := SendAudio(context.Background(), bot, params) require.Error(t, err) @@ -2079,7 +2051,6 @@ func Test_SendDocument_Success(t *testing.T) { bot := client.New("test:token", client.WithHTTPClient(m)) params := &SendDocumentParams{ - ChatID: ChatIDFromInt(123), Document: &InputFile{PathOrID: "file_id_test"}, } _, err := SendDocument(context.Background(), bot, params) @@ -2093,7 +2064,6 @@ func Test_SendDocument_APIError(t *testing.T) { bot := client.New("test:token", client.WithHTTPClient(m)) params := &SendDocumentParams{ - ChatID: ChatIDFromInt(123), Document: &InputFile{PathOrID: "file_id_test"}, } _, err := SendDocument(context.Background(), bot, params) @@ -2110,7 +2080,6 @@ func Test_SendDocument_NetworkError(t *testing.T) { bot := client.New("test:token", client.WithHTTPClient(m)) params := &SendDocumentParams{ - ChatID: ChatIDFromInt(123), Document: &InputFile{PathOrID: "file_id_test"}, } _, err := SendDocument(context.Background(), bot, params) @@ -2125,7 +2094,6 @@ func Test_SendDocument_ParseError(t *testing.T) { bot := client.New("test:token", client.WithHTTPClient(m)) params := &SendDocumentParams{ - ChatID: ChatIDFromInt(123), Document: &InputFile{PathOrID: "file_id_test"}, } _, err := SendDocument(context.Background(), bot, params) @@ -2143,7 +2111,6 @@ func Test_SendDocument_ContextCanceled(t *testing.T) { bot := client.New("test:token", client.WithHTTPClient(m)) params := &SendDocumentParams{ - ChatID: ChatIDFromInt(123), Document: &InputFile{PathOrID: "file_id_test"}, } _, err := SendDocument(ctx, bot, params) @@ -2183,7 +2150,6 @@ func Test_SendDocument_Forbidden(t *testing.T) { bot := client.New("test:token", client.WithHTTPClient(m)) params := &SendDocumentParams{ - ChatID: ChatIDFromInt(123), Document: &InputFile{PathOrID: "file_id_test"}, } _, err := SendDocument(context.Background(), bot, params) @@ -2204,7 +2170,6 @@ func Test_SendDocument_ServerError(t *testing.T) { bot := client.New("test:token", client.WithHTTPClient(m)) params := &SendDocumentParams{ - ChatID: ChatIDFromInt(123), Document: &InputFile{PathOrID: "file_id_test"}, } _, err := SendDocument(context.Background(), bot, params) @@ -2223,8 +2188,7 @@ func Test_SendVideo_Success(t *testing.T) { bot := client.New("test:token", client.WithHTTPClient(m)) params := &SendVideoParams{ - ChatID: ChatIDFromInt(123), - Video: &InputFile{PathOrID: "file_id_test"}, + Video: &InputFile{PathOrID: "file_id_test"}, } _, err := SendVideo(context.Background(), bot, params) require.NoError(t, err) @@ -2237,8 +2201,7 @@ func Test_SendVideo_APIError(t *testing.T) { bot := client.New("test:token", client.WithHTTPClient(m)) params := &SendVideoParams{ - ChatID: ChatIDFromInt(123), - Video: &InputFile{PathOrID: "file_id_test"}, + Video: &InputFile{PathOrID: "file_id_test"}, } _, err := SendVideo(context.Background(), bot, params) require.Error(t, err) @@ -2254,8 +2217,7 @@ func Test_SendVideo_NetworkError(t *testing.T) { bot := client.New("test:token", client.WithHTTPClient(m)) params := &SendVideoParams{ - ChatID: ChatIDFromInt(123), - Video: &InputFile{PathOrID: "file_id_test"}, + Video: &InputFile{PathOrID: "file_id_test"}, } _, err := SendVideo(context.Background(), bot, params) require.Error(t, err) @@ -2269,8 +2231,7 @@ func Test_SendVideo_ParseError(t *testing.T) { bot := client.New("test:token", client.WithHTTPClient(m)) params := &SendVideoParams{ - ChatID: ChatIDFromInt(123), - Video: &InputFile{PathOrID: "file_id_test"}, + Video: &InputFile{PathOrID: "file_id_test"}, } _, err := SendVideo(context.Background(), bot, params) require.Error(t, err) @@ -2287,8 +2248,7 @@ func Test_SendVideo_ContextCanceled(t *testing.T) { bot := client.New("test:token", client.WithHTTPClient(m)) params := &SendVideoParams{ - ChatID: ChatIDFromInt(123), - Video: &InputFile{PathOrID: "file_id_test"}, + Video: &InputFile{PathOrID: "file_id_test"}, } _, err := SendVideo(ctx, bot, params) require.Error(t, err) @@ -2327,8 +2287,7 @@ func Test_SendVideo_Forbidden(t *testing.T) { bot := client.New("test:token", client.WithHTTPClient(m)) params := &SendVideoParams{ - ChatID: ChatIDFromInt(123), - Video: &InputFile{PathOrID: "file_id_test"}, + Video: &InputFile{PathOrID: "file_id_test"}, } _, err := SendVideo(context.Background(), bot, params) require.Error(t, err) @@ -2348,8 +2307,7 @@ func Test_SendVideo_ServerError(t *testing.T) { bot := client.New("test:token", client.WithHTTPClient(m)) params := &SendVideoParams{ - ChatID: ChatIDFromInt(123), - Video: &InputFile{PathOrID: "file_id_test"}, + Video: &InputFile{PathOrID: "file_id_test"}, } _, err := SendVideo(context.Background(), bot, params) require.Error(t, err) @@ -2367,7 +2325,6 @@ func Test_SendAnimation_Success(t *testing.T) { bot := client.New("test:token", client.WithHTTPClient(m)) params := &SendAnimationParams{ - ChatID: ChatIDFromInt(123), Animation: &InputFile{PathOrID: "file_id_test"}, } _, err := SendAnimation(context.Background(), bot, params) @@ -2381,7 +2338,6 @@ func Test_SendAnimation_APIError(t *testing.T) { bot := client.New("test:token", client.WithHTTPClient(m)) params := &SendAnimationParams{ - ChatID: ChatIDFromInt(123), Animation: &InputFile{PathOrID: "file_id_test"}, } _, err := SendAnimation(context.Background(), bot, params) @@ -2398,7 +2354,6 @@ func Test_SendAnimation_NetworkError(t *testing.T) { bot := client.New("test:token", client.WithHTTPClient(m)) params := &SendAnimationParams{ - ChatID: ChatIDFromInt(123), Animation: &InputFile{PathOrID: "file_id_test"}, } _, err := SendAnimation(context.Background(), bot, params) @@ -2413,7 +2368,6 @@ func Test_SendAnimation_ParseError(t *testing.T) { bot := client.New("test:token", client.WithHTTPClient(m)) params := &SendAnimationParams{ - ChatID: ChatIDFromInt(123), Animation: &InputFile{PathOrID: "file_id_test"}, } _, err := SendAnimation(context.Background(), bot, params) @@ -2431,7 +2385,6 @@ func Test_SendAnimation_ContextCanceled(t *testing.T) { bot := client.New("test:token", client.WithHTTPClient(m)) params := &SendAnimationParams{ - ChatID: ChatIDFromInt(123), Animation: &InputFile{PathOrID: "file_id_test"}, } _, err := SendAnimation(ctx, bot, params) @@ -2471,7 +2424,6 @@ func Test_SendAnimation_Forbidden(t *testing.T) { bot := client.New("test:token", client.WithHTTPClient(m)) params := &SendAnimationParams{ - ChatID: ChatIDFromInt(123), Animation: &InputFile{PathOrID: "file_id_test"}, } _, err := SendAnimation(context.Background(), bot, params) @@ -2492,7 +2444,6 @@ func Test_SendAnimation_ServerError(t *testing.T) { bot := client.New("test:token", client.WithHTTPClient(m)) params := &SendAnimationParams{ - ChatID: ChatIDFromInt(123), Animation: &InputFile{PathOrID: "file_id_test"}, } _, err := SendAnimation(context.Background(), bot, params) @@ -2511,8 +2462,7 @@ func Test_SendVoice_Success(t *testing.T) { bot := client.New("test:token", client.WithHTTPClient(m)) params := &SendVoiceParams{ - ChatID: ChatIDFromInt(123), - Voice: &InputFile{PathOrID: "file_id_test"}, + Voice: &InputFile{PathOrID: "file_id_test"}, } _, err := SendVoice(context.Background(), bot, params) require.NoError(t, err) @@ -2525,8 +2475,7 @@ func Test_SendVoice_APIError(t *testing.T) { bot := client.New("test:token", client.WithHTTPClient(m)) params := &SendVoiceParams{ - ChatID: ChatIDFromInt(123), - Voice: &InputFile{PathOrID: "file_id_test"}, + Voice: &InputFile{PathOrID: "file_id_test"}, } _, err := SendVoice(context.Background(), bot, params) require.Error(t, err) @@ -2542,8 +2491,7 @@ func Test_SendVoice_NetworkError(t *testing.T) { bot := client.New("test:token", client.WithHTTPClient(m)) params := &SendVoiceParams{ - ChatID: ChatIDFromInt(123), - Voice: &InputFile{PathOrID: "file_id_test"}, + Voice: &InputFile{PathOrID: "file_id_test"}, } _, err := SendVoice(context.Background(), bot, params) require.Error(t, err) @@ -2557,8 +2505,7 @@ func Test_SendVoice_ParseError(t *testing.T) { bot := client.New("test:token", client.WithHTTPClient(m)) params := &SendVoiceParams{ - ChatID: ChatIDFromInt(123), - Voice: &InputFile{PathOrID: "file_id_test"}, + Voice: &InputFile{PathOrID: "file_id_test"}, } _, err := SendVoice(context.Background(), bot, params) require.Error(t, err) @@ -2575,8 +2522,7 @@ func Test_SendVoice_ContextCanceled(t *testing.T) { bot := client.New("test:token", client.WithHTTPClient(m)) params := &SendVoiceParams{ - ChatID: ChatIDFromInt(123), - Voice: &InputFile{PathOrID: "file_id_test"}, + Voice: &InputFile{PathOrID: "file_id_test"}, } _, err := SendVoice(ctx, bot, params) require.Error(t, err) @@ -2615,8 +2561,7 @@ func Test_SendVoice_Forbidden(t *testing.T) { bot := client.New("test:token", client.WithHTTPClient(m)) params := &SendVoiceParams{ - ChatID: ChatIDFromInt(123), - Voice: &InputFile{PathOrID: "file_id_test"}, + Voice: &InputFile{PathOrID: "file_id_test"}, } _, err := SendVoice(context.Background(), bot, params) require.Error(t, err) @@ -2636,8 +2581,7 @@ func Test_SendVoice_ServerError(t *testing.T) { bot := client.New("test:token", client.WithHTTPClient(m)) params := &SendVoiceParams{ - ChatID: ChatIDFromInt(123), - Voice: &InputFile{PathOrID: "file_id_test"}, + Voice: &InputFile{PathOrID: "file_id_test"}, } _, err := SendVoice(context.Background(), bot, params) require.Error(t, err) @@ -2655,7 +2599,6 @@ func Test_SendVideoNote_Success(t *testing.T) { bot := client.New("test:token", client.WithHTTPClient(m)) params := &SendVideoNoteParams{ - ChatID: ChatIDFromInt(123), VideoNote: &InputFile{PathOrID: "file_id_test"}, } _, err := SendVideoNote(context.Background(), bot, params) @@ -2669,7 +2612,6 @@ func Test_SendVideoNote_APIError(t *testing.T) { bot := client.New("test:token", client.WithHTTPClient(m)) params := &SendVideoNoteParams{ - ChatID: ChatIDFromInt(123), VideoNote: &InputFile{PathOrID: "file_id_test"}, } _, err := SendVideoNote(context.Background(), bot, params) @@ -2686,7 +2628,6 @@ func Test_SendVideoNote_NetworkError(t *testing.T) { bot := client.New("test:token", client.WithHTTPClient(m)) params := &SendVideoNoteParams{ - ChatID: ChatIDFromInt(123), VideoNote: &InputFile{PathOrID: "file_id_test"}, } _, err := SendVideoNote(context.Background(), bot, params) @@ -2701,7 +2642,6 @@ func Test_SendVideoNote_ParseError(t *testing.T) { bot := client.New("test:token", client.WithHTTPClient(m)) params := &SendVideoNoteParams{ - ChatID: ChatIDFromInt(123), VideoNote: &InputFile{PathOrID: "file_id_test"}, } _, err := SendVideoNote(context.Background(), bot, params) @@ -2719,7 +2659,6 @@ func Test_SendVideoNote_ContextCanceled(t *testing.T) { bot := client.New("test:token", client.WithHTTPClient(m)) params := &SendVideoNoteParams{ - ChatID: ChatIDFromInt(123), VideoNote: &InputFile{PathOrID: "file_id_test"}, } _, err := SendVideoNote(ctx, bot, params) @@ -2759,7 +2698,6 @@ func Test_SendVideoNote_Forbidden(t *testing.T) { bot := client.New("test:token", client.WithHTTPClient(m)) params := &SendVideoNoteParams{ - ChatID: ChatIDFromInt(123), VideoNote: &InputFile{PathOrID: "file_id_test"}, } _, err := SendVideoNote(context.Background(), bot, params) @@ -2780,7 +2718,6 @@ func Test_SendVideoNote_ServerError(t *testing.T) { bot := client.New("test:token", client.WithHTTPClient(m)) params := &SendVideoNoteParams{ - ChatID: ChatIDFromInt(123), VideoNote: &InputFile{PathOrID: "file_id_test"}, } _, err := SendVideoNote(context.Background(), bot, params) @@ -2791,6 +2728,294 @@ func Test_SendVideoNote_ServerError(t *testing.T) { require.True(t, ae.IsRetryable(), "5xx must be retryable") } +func Test_SendWidget_Success(t *testing.T) { + m := &genTestMockDoer{} + m.On("Do", mock.MatchedBy(func(r *http.Request) bool { + return strings.HasSuffix(r.URL.Path, "/sendWidget") + })).Return(genTestResp(200, `{"ok":true,"result":{}}`), nil) + + bot := client.New("test:token", client.WithHTTPClient(m)) + params := &SendWidgetParams{ + ChatID: ChatIDFromInt(123), + HTML: "test_value", + } + _, err := SendWidget(context.Background(), bot, params) + require.NoError(t, err) +} + +func Test_SendWidget_APIError(t *testing.T) { + m := &genTestMockDoer{} + m.On("Do", mock.Anything).Return( + genTestResp(200, `{"ok":false,"error_code":429,"description":"Too Many Requests","parameters":{"retry_after":1}}`), nil) + + bot := client.New("test:token", client.WithHTTPClient(m)) + params := &SendWidgetParams{ + ChatID: ChatIDFromInt(123), + HTML: "test_value", + } + _, err := SendWidget(context.Background(), bot, params) + require.Error(t, err) + var ae *client.APIError + require.ErrorAs(t, err, &ae) + require.Equal(t, 429, ae.Code) + require.True(t, ae.IsRetryable()) +} + +func Test_SendWidget_NetworkError(t *testing.T) { + m := &genTestMockDoer{} + m.On("Do", mock.Anything).Return(nil, errors.New("dial tcp: timeout")) + + bot := client.New("test:token", client.WithHTTPClient(m)) + params := &SendWidgetParams{ + ChatID: ChatIDFromInt(123), + HTML: "test_value", + } + _, err := SendWidget(context.Background(), bot, params) + require.Error(t, err) + var ne *client.NetworkError + require.ErrorAs(t, err, &ne) +} + +func Test_SendWidget_ParseError(t *testing.T) { + m := &genTestMockDoer{} + m.On("Do", mock.Anything).Return(genTestResp(200, `not json`), nil) + + bot := client.New("test:token", client.WithHTTPClient(m)) + params := &SendWidgetParams{ + ChatID: ChatIDFromInt(123), + HTML: "test_value", + } + _, err := SendWidget(context.Background(), bot, params) + require.Error(t, err) + var pe *client.ParseError + require.ErrorAs(t, err, &pe) +} + +func Test_SendWidget_ContextCanceled(t *testing.T) { + m := &genTestMockDoer{} + m.On("Do", mock.Anything).Return(nil, context.Canceled).Maybe() + + ctx, cancel := context.WithCancel(context.Background()) + cancel() + + bot := client.New("test:token", client.WithHTTPClient(m)) + params := &SendWidgetParams{ + ChatID: ChatIDFromInt(123), + HTML: "test_value", + } + _, err := SendWidget(ctx, bot, params) + require.Error(t, err) + require.ErrorIs(t, err, context.Canceled) +} + +// Test_SendWidget_MissingRequiredFields exercises Telegram's server-side +// validation: when a required field is omitted, Telegram returns 400 with +// a description like "Bad Request: is empty". The library must +// surface this as *APIError with the ErrBadRequest sentinel. +func Test_SendWidget_MissingRequiredFields(t *testing.T) { + m := &genTestMockDoer{} + m.On("Do", mock.Anything).Return( + genTestResp(200, `{"ok":false,"error_code":400,"description":"Bad Request: chat_id is empty"}`), nil) + + bot := client.New("test:token", client.WithHTTPClient(m)) + // Send a Params with all required fields zeroed — simulates a caller + // that forgot to populate them. The bot library marshals as-is and + // surfaces Telegram's 400 reply. + _, err := SendWidget(context.Background(), bot, &SendWidgetParams{}) + require.Error(t, err) + var ae *client.APIError + require.ErrorAs(t, err, &ae) + require.Equal(t, 400, ae.Code) + require.True(t, errors.Is(err, client.ErrBadRequest)) + require.False(t, ae.IsRetryable()) +} + +// Test_SendWidget_Forbidden exercises the 403 path (bot blocked by user, +// removed from chat, etc.). The library must surface the ErrForbidden +// sentinel. +func Test_SendWidget_Forbidden(t *testing.T) { + m := &genTestMockDoer{} + m.On("Do", mock.Anything).Return( + genTestResp(200, `{"ok":false,"error_code":403,"description":"Forbidden: bot was blocked by the user"}`), nil) + + bot := client.New("test:token", client.WithHTTPClient(m)) + params := &SendWidgetParams{ + ChatID: ChatIDFromInt(123), + HTML: "test_value", + } + _, err := SendWidget(context.Background(), bot, params) + require.Error(t, err) + var ae *client.APIError + require.ErrorAs(t, err, &ae) + require.Equal(t, 403, ae.Code) + require.True(t, errors.Is(err, client.ErrForbidden)) + require.False(t, ae.IsRetryable()) +} + +// Test_SendWidget_ServerError exercises the 5xx path. The library must +// classify these as retryable so RetryDoer / user retry logic kicks in. +func Test_SendWidget_ServerError(t *testing.T) { + m := &genTestMockDoer{} + m.On("Do", mock.Anything).Return( + genTestResp(200, `{"ok":false,"error_code":500,"description":"Internal server error"}`), nil) + + bot := client.New("test:token", client.WithHTTPClient(m)) + params := &SendWidgetParams{ + ChatID: ChatIDFromInt(123), + HTML: "test_value", + } + _, err := SendWidget(context.Background(), bot, params) + require.Error(t, err) + var ae *client.APIError + require.ErrorAs(t, err, &ae) + require.Equal(t, 500, ae.Code) + require.True(t, ae.IsRetryable(), "5xx must be retryable") +} + +func Test_SendSharedWidget_Success(t *testing.T) { + m := &genTestMockDoer{} + m.On("Do", mock.MatchedBy(func(r *http.Request) bool { + return strings.HasSuffix(r.URL.Path, "/sendSharedWidget") + })).Return(genTestResp(200, `{"ok":true,"result":{}}`), nil) + + bot := client.New("test:token", client.WithHTTPClient(m)) + params := &SendSharedWidgetParams{ + ChatID: ChatIDFromInt(123), + WidgetID: "test_value", + } + _, err := SendSharedWidget(context.Background(), bot, params) + require.NoError(t, err) +} + +func Test_SendSharedWidget_APIError(t *testing.T) { + m := &genTestMockDoer{} + m.On("Do", mock.Anything).Return( + genTestResp(200, `{"ok":false,"error_code":429,"description":"Too Many Requests","parameters":{"retry_after":1}}`), nil) + + bot := client.New("test:token", client.WithHTTPClient(m)) + params := &SendSharedWidgetParams{ + ChatID: ChatIDFromInt(123), + WidgetID: "test_value", + } + _, err := SendSharedWidget(context.Background(), bot, params) + require.Error(t, err) + var ae *client.APIError + require.ErrorAs(t, err, &ae) + require.Equal(t, 429, ae.Code) + require.True(t, ae.IsRetryable()) +} + +func Test_SendSharedWidget_NetworkError(t *testing.T) { + m := &genTestMockDoer{} + m.On("Do", mock.Anything).Return(nil, errors.New("dial tcp: timeout")) + + bot := client.New("test:token", client.WithHTTPClient(m)) + params := &SendSharedWidgetParams{ + ChatID: ChatIDFromInt(123), + WidgetID: "test_value", + } + _, err := SendSharedWidget(context.Background(), bot, params) + require.Error(t, err) + var ne *client.NetworkError + require.ErrorAs(t, err, &ne) +} + +func Test_SendSharedWidget_ParseError(t *testing.T) { + m := &genTestMockDoer{} + m.On("Do", mock.Anything).Return(genTestResp(200, `not json`), nil) + + bot := client.New("test:token", client.WithHTTPClient(m)) + params := &SendSharedWidgetParams{ + ChatID: ChatIDFromInt(123), + WidgetID: "test_value", + } + _, err := SendSharedWidget(context.Background(), bot, params) + require.Error(t, err) + var pe *client.ParseError + require.ErrorAs(t, err, &pe) +} + +func Test_SendSharedWidget_ContextCanceled(t *testing.T) { + m := &genTestMockDoer{} + m.On("Do", mock.Anything).Return(nil, context.Canceled).Maybe() + + ctx, cancel := context.WithCancel(context.Background()) + cancel() + + bot := client.New("test:token", client.WithHTTPClient(m)) + params := &SendSharedWidgetParams{ + ChatID: ChatIDFromInt(123), + WidgetID: "test_value", + } + _, err := SendSharedWidget(ctx, bot, params) + require.Error(t, err) + require.ErrorIs(t, err, context.Canceled) +} + +// Test_SendSharedWidget_MissingRequiredFields exercises Telegram's server-side +// validation: when a required field is omitted, Telegram returns 400 with +// a description like "Bad Request: is empty". The library must +// surface this as *APIError with the ErrBadRequest sentinel. +func Test_SendSharedWidget_MissingRequiredFields(t *testing.T) { + m := &genTestMockDoer{} + m.On("Do", mock.Anything).Return( + genTestResp(200, `{"ok":false,"error_code":400,"description":"Bad Request: chat_id is empty"}`), nil) + + bot := client.New("test:token", client.WithHTTPClient(m)) + // Send a Params with all required fields zeroed — simulates a caller + // that forgot to populate them. The bot library marshals as-is and + // surfaces Telegram's 400 reply. + _, err := SendSharedWidget(context.Background(), bot, &SendSharedWidgetParams{}) + require.Error(t, err) + var ae *client.APIError + require.ErrorAs(t, err, &ae) + require.Equal(t, 400, ae.Code) + require.True(t, errors.Is(err, client.ErrBadRequest)) + require.False(t, ae.IsRetryable()) +} + +// Test_SendSharedWidget_Forbidden exercises the 403 path (bot blocked by user, +// removed from chat, etc.). The library must surface the ErrForbidden +// sentinel. +func Test_SendSharedWidget_Forbidden(t *testing.T) { + m := &genTestMockDoer{} + m.On("Do", mock.Anything).Return( + genTestResp(200, `{"ok":false,"error_code":403,"description":"Forbidden: bot was blocked by the user"}`), nil) + + bot := client.New("test:token", client.WithHTTPClient(m)) + params := &SendSharedWidgetParams{ + ChatID: ChatIDFromInt(123), + WidgetID: "test_value", + } + _, err := SendSharedWidget(context.Background(), bot, params) + require.Error(t, err) + var ae *client.APIError + require.ErrorAs(t, err, &ae) + require.Equal(t, 403, ae.Code) + require.True(t, errors.Is(err, client.ErrForbidden)) + require.False(t, ae.IsRetryable()) +} + +// Test_SendSharedWidget_ServerError exercises the 5xx path. The library must +// classify these as retryable so RetryDoer / user retry logic kicks in. +func Test_SendSharedWidget_ServerError(t *testing.T) { + m := &genTestMockDoer{} + m.On("Do", mock.Anything).Return( + genTestResp(200, `{"ok":false,"error_code":500,"description":"Internal server error"}`), nil) + + bot := client.New("test:token", client.WithHTTPClient(m)) + params := &SendSharedWidgetParams{ + ChatID: ChatIDFromInt(123), + WidgetID: "test_value", + } + _, err := SendSharedWidget(context.Background(), bot, params) + require.Error(t, err) + var ae *client.APIError + require.ErrorAs(t, err, &ae) + require.Equal(t, 500, ae.Code) + require.True(t, ae.IsRetryable(), "5xx must be retryable") +} + func Test_SendPaidMedia_Success(t *testing.T) { m := &genTestMockDoer{} m.On("Do", mock.MatchedBy(func(r *http.Request) bool { @@ -3094,7 +3319,6 @@ func Test_SendLocation_Success(t *testing.T) { bot := client.New("test:token", client.WithHTTPClient(m)) params := &SendLocationParams{ - ChatID: ChatIDFromInt(123), Latitude: 1.0, Longitude: 1.0, } @@ -3109,7 +3333,6 @@ func Test_SendLocation_APIError(t *testing.T) { bot := client.New("test:token", client.WithHTTPClient(m)) params := &SendLocationParams{ - ChatID: ChatIDFromInt(123), Latitude: 1.0, Longitude: 1.0, } @@ -3127,7 +3350,6 @@ func Test_SendLocation_NetworkError(t *testing.T) { bot := client.New("test:token", client.WithHTTPClient(m)) params := &SendLocationParams{ - ChatID: ChatIDFromInt(123), Latitude: 1.0, Longitude: 1.0, } @@ -3143,7 +3365,6 @@ func Test_SendLocation_ParseError(t *testing.T) { bot := client.New("test:token", client.WithHTTPClient(m)) params := &SendLocationParams{ - ChatID: ChatIDFromInt(123), Latitude: 1.0, Longitude: 1.0, } @@ -3162,7 +3383,6 @@ func Test_SendLocation_ContextCanceled(t *testing.T) { bot := client.New("test:token", client.WithHTTPClient(m)) params := &SendLocationParams{ - ChatID: ChatIDFromInt(123), Latitude: 1.0, Longitude: 1.0, } @@ -3203,7 +3423,6 @@ func Test_SendLocation_Forbidden(t *testing.T) { bot := client.New("test:token", client.WithHTTPClient(m)) params := &SendLocationParams{ - ChatID: ChatIDFromInt(123), Latitude: 1.0, Longitude: 1.0, } @@ -3225,7 +3444,6 @@ func Test_SendLocation_ServerError(t *testing.T) { bot := client.New("test:token", client.WithHTTPClient(m)) params := &SendLocationParams{ - ChatID: ChatIDFromInt(123), Latitude: 1.0, Longitude: 1.0, } @@ -3245,7 +3463,6 @@ func Test_SendVenue_Success(t *testing.T) { bot := client.New("test:token", client.WithHTTPClient(m)) params := &SendVenueParams{ - ChatID: ChatIDFromInt(123), Latitude: 1.0, Longitude: 1.0, Title: "test_value", @@ -3262,7 +3479,6 @@ func Test_SendVenue_APIError(t *testing.T) { bot := client.New("test:token", client.WithHTTPClient(m)) params := &SendVenueParams{ - ChatID: ChatIDFromInt(123), Latitude: 1.0, Longitude: 1.0, Title: "test_value", @@ -3282,7 +3498,6 @@ func Test_SendVenue_NetworkError(t *testing.T) { bot := client.New("test:token", client.WithHTTPClient(m)) params := &SendVenueParams{ - ChatID: ChatIDFromInt(123), Latitude: 1.0, Longitude: 1.0, Title: "test_value", @@ -3300,7 +3515,6 @@ func Test_SendVenue_ParseError(t *testing.T) { bot := client.New("test:token", client.WithHTTPClient(m)) params := &SendVenueParams{ - ChatID: ChatIDFromInt(123), Latitude: 1.0, Longitude: 1.0, Title: "test_value", @@ -3321,7 +3535,6 @@ func Test_SendVenue_ContextCanceled(t *testing.T) { bot := client.New("test:token", client.WithHTTPClient(m)) params := &SendVenueParams{ - ChatID: ChatIDFromInt(123), Latitude: 1.0, Longitude: 1.0, Title: "test_value", @@ -3364,7 +3577,6 @@ func Test_SendVenue_Forbidden(t *testing.T) { bot := client.New("test:token", client.WithHTTPClient(m)) params := &SendVenueParams{ - ChatID: ChatIDFromInt(123), Latitude: 1.0, Longitude: 1.0, Title: "test_value", @@ -3388,7 +3600,6 @@ func Test_SendVenue_ServerError(t *testing.T) { bot := client.New("test:token", client.WithHTTPClient(m)) params := &SendVenueParams{ - ChatID: ChatIDFromInt(123), Latitude: 1.0, Longitude: 1.0, Title: "test_value", @@ -3410,7 +3621,6 @@ func Test_SendContact_Success(t *testing.T) { bot := client.New("test:token", client.WithHTTPClient(m)) params := &SendContactParams{ - ChatID: ChatIDFromInt(123), PhoneNumber: "test_value", FirstName: "test_value", } @@ -3425,7 +3635,6 @@ func Test_SendContact_APIError(t *testing.T) { bot := client.New("test:token", client.WithHTTPClient(m)) params := &SendContactParams{ - ChatID: ChatIDFromInt(123), PhoneNumber: "test_value", FirstName: "test_value", } @@ -3443,7 +3652,6 @@ func Test_SendContact_NetworkError(t *testing.T) { bot := client.New("test:token", client.WithHTTPClient(m)) params := &SendContactParams{ - ChatID: ChatIDFromInt(123), PhoneNumber: "test_value", FirstName: "test_value", } @@ -3459,7 +3667,6 @@ func Test_SendContact_ParseError(t *testing.T) { bot := client.New("test:token", client.WithHTTPClient(m)) params := &SendContactParams{ - ChatID: ChatIDFromInt(123), PhoneNumber: "test_value", FirstName: "test_value", } @@ -3478,7 +3685,6 @@ func Test_SendContact_ContextCanceled(t *testing.T) { bot := client.New("test:token", client.WithHTTPClient(m)) params := &SendContactParams{ - ChatID: ChatIDFromInt(123), PhoneNumber: "test_value", FirstName: "test_value", } @@ -3519,7 +3725,6 @@ func Test_SendContact_Forbidden(t *testing.T) { bot := client.New("test:token", client.WithHTTPClient(m)) params := &SendContactParams{ - ChatID: ChatIDFromInt(123), PhoneNumber: "test_value", FirstName: "test_value", } @@ -3541,7 +3746,6 @@ func Test_SendContact_ServerError(t *testing.T) { bot := client.New("test:token", client.WithHTTPClient(m)) params := &SendContactParams{ - ChatID: ChatIDFromInt(123), PhoneNumber: "test_value", FirstName: "test_value", } @@ -9387,6 +9591,122 @@ func Test_GetChatMember_ServerError(t *testing.T) { require.True(t, ae.IsRetryable(), "5xx must be retryable") } +func Test_GetChatShareThemeBackdrops_Success(t *testing.T) { + m := &genTestMockDoer{} + m.On("Do", mock.MatchedBy(func(r *http.Request) bool { + return strings.HasSuffix(r.URL.Path, "/getChatShareThemeBackdrops") + })).Return(genTestResp(200, `{"ok":true,"result":{}}`), nil) + + bot := client.New("test:token", client.WithHTTPClient(m)) + _, err := GetChatShareThemeBackdrops(context.Background(), bot, &GetChatShareThemeBackdropsParams{}) + require.NoError(t, err) +} + +func Test_GetChatShareThemeBackdrops_APIError(t *testing.T) { + m := &genTestMockDoer{} + m.On("Do", mock.Anything).Return( + genTestResp(200, `{"ok":false,"error_code":429,"description":"Too Many Requests","parameters":{"retry_after":1}}`), nil) + + bot := client.New("test:token", client.WithHTTPClient(m)) + _, err := GetChatShareThemeBackdrops(context.Background(), bot, &GetChatShareThemeBackdropsParams{}) + require.Error(t, err) + var ae *client.APIError + require.ErrorAs(t, err, &ae) + require.Equal(t, 429, ae.Code) + require.True(t, ae.IsRetryable()) +} + +func Test_GetChatShareThemeBackdrops_NetworkError(t *testing.T) { + m := &genTestMockDoer{} + m.On("Do", mock.Anything).Return(nil, errors.New("dial tcp: timeout")) + + bot := client.New("test:token", client.WithHTTPClient(m)) + _, err := GetChatShareThemeBackdrops(context.Background(), bot, &GetChatShareThemeBackdropsParams{}) + require.Error(t, err) + var ne *client.NetworkError + require.ErrorAs(t, err, &ne) +} + +func Test_GetChatShareThemeBackdrops_ParseError(t *testing.T) { + m := &genTestMockDoer{} + m.On("Do", mock.Anything).Return(genTestResp(200, `not json`), nil) + + bot := client.New("test:token", client.WithHTTPClient(m)) + _, err := GetChatShareThemeBackdrops(context.Background(), bot, &GetChatShareThemeBackdropsParams{}) + require.Error(t, err) + var pe *client.ParseError + require.ErrorAs(t, err, &pe) +} + +func Test_GetChatShareThemeBackdrops_ContextCanceled(t *testing.T) { + m := &genTestMockDoer{} + m.On("Do", mock.Anything).Return(nil, context.Canceled).Maybe() + + ctx, cancel := context.WithCancel(context.Background()) + cancel() + + bot := client.New("test:token", client.WithHTTPClient(m)) + _, err := GetChatShareThemeBackdrops(ctx, bot, &GetChatShareThemeBackdropsParams{}) + require.Error(t, err) + require.ErrorIs(t, err, context.Canceled) +} + +// Test_GetChatShareThemeBackdrops_MissingRequiredFields exercises Telegram's server-side +// validation: when a required field is omitted, Telegram returns 400 with +// a description like "Bad Request: is empty". The library must +// surface this as *APIError with the ErrBadRequest sentinel. +func Test_GetChatShareThemeBackdrops_MissingRequiredFields(t *testing.T) { + m := &genTestMockDoer{} + m.On("Do", mock.Anything).Return( + genTestResp(200, `{"ok":false,"error_code":400,"description":"Bad Request: chat_id is empty"}`), nil) + + bot := client.New("test:token", client.WithHTTPClient(m)) + // Send a Params with all required fields zeroed — simulates a caller + // that forgot to populate them. The bot library marshals as-is and + // surfaces Telegram's 400 reply. + _, err := GetChatShareThemeBackdrops(context.Background(), bot, &GetChatShareThemeBackdropsParams{}) + require.Error(t, err) + var ae *client.APIError + require.ErrorAs(t, err, &ae) + require.Equal(t, 400, ae.Code) + require.True(t, errors.Is(err, client.ErrBadRequest)) + require.False(t, ae.IsRetryable()) +} + +// Test_GetChatShareThemeBackdrops_Forbidden exercises the 403 path (bot blocked by user, +// removed from chat, etc.). The library must surface the ErrForbidden +// sentinel. +func Test_GetChatShareThemeBackdrops_Forbidden(t *testing.T) { + m := &genTestMockDoer{} + m.On("Do", mock.Anything).Return( + genTestResp(200, `{"ok":false,"error_code":403,"description":"Forbidden: bot was blocked by the user"}`), nil) + + bot := client.New("test:token", client.WithHTTPClient(m)) + _, err := GetChatShareThemeBackdrops(context.Background(), bot, &GetChatShareThemeBackdropsParams{}) + require.Error(t, err) + var ae *client.APIError + require.ErrorAs(t, err, &ae) + require.Equal(t, 403, ae.Code) + require.True(t, errors.Is(err, client.ErrForbidden)) + require.False(t, ae.IsRetryable()) +} + +// Test_GetChatShareThemeBackdrops_ServerError exercises the 5xx path. The library must +// classify these as retryable so RetryDoer / user retry logic kicks in. +func Test_GetChatShareThemeBackdrops_ServerError(t *testing.T) { + m := &genTestMockDoer{} + m.On("Do", mock.Anything).Return( + genTestResp(200, `{"ok":false,"error_code":500,"description":"Internal server error"}`), nil) + + bot := client.New("test:token", client.WithHTTPClient(m)) + _, err := GetChatShareThemeBackdrops(context.Background(), bot, &GetChatShareThemeBackdropsParams{}) + require.Error(t, err) + var ae *client.APIError + require.ErrorAs(t, err, &ae) + require.Equal(t, 500, ae.Code) + require.True(t, ae.IsRetryable(), "5xx must be retryable") +} + func Test_GetUserPersonalChatMessages_Success(t *testing.T) { m := &genTestMockDoer{} m.On("Do", mock.MatchedBy(func(r *http.Request) bool { @@ -11758,6 +12078,143 @@ func Test_AnswerCallbackQuery_ServerError(t *testing.T) { require.True(t, ae.IsRetryable(), "5xx must be retryable") } +func Test_AnswerWidgetQuery_Success(t *testing.T) { + m := &genTestMockDoer{} + m.On("Do", mock.MatchedBy(func(r *http.Request) bool { + return strings.HasSuffix(r.URL.Path, "/answerWidgetQuery") + })).Return(genTestResp(200, `{"ok":true,"result":true}`), nil) + + bot := client.New("test:token", client.WithHTTPClient(m)) + params := &AnswerWidgetQueryParams{ + WidgetQueryID: "test_value", + } + _, err := AnswerWidgetQuery(context.Background(), bot, params) + require.NoError(t, err) +} + +func Test_AnswerWidgetQuery_APIError(t *testing.T) { + m := &genTestMockDoer{} + m.On("Do", mock.Anything).Return( + genTestResp(200, `{"ok":false,"error_code":429,"description":"Too Many Requests","parameters":{"retry_after":1}}`), nil) + + bot := client.New("test:token", client.WithHTTPClient(m)) + params := &AnswerWidgetQueryParams{ + WidgetQueryID: "test_value", + } + _, err := AnswerWidgetQuery(context.Background(), bot, params) + require.Error(t, err) + var ae *client.APIError + require.ErrorAs(t, err, &ae) + require.Equal(t, 429, ae.Code) + require.True(t, ae.IsRetryable()) +} + +func Test_AnswerWidgetQuery_NetworkError(t *testing.T) { + m := &genTestMockDoer{} + m.On("Do", mock.Anything).Return(nil, errors.New("dial tcp: timeout")) + + bot := client.New("test:token", client.WithHTTPClient(m)) + params := &AnswerWidgetQueryParams{ + WidgetQueryID: "test_value", + } + _, err := AnswerWidgetQuery(context.Background(), bot, params) + require.Error(t, err) + var ne *client.NetworkError + require.ErrorAs(t, err, &ne) +} + +func Test_AnswerWidgetQuery_ParseError(t *testing.T) { + m := &genTestMockDoer{} + m.On("Do", mock.Anything).Return(genTestResp(200, `not json`), nil) + + bot := client.New("test:token", client.WithHTTPClient(m)) + params := &AnswerWidgetQueryParams{ + WidgetQueryID: "test_value", + } + _, err := AnswerWidgetQuery(context.Background(), bot, params) + require.Error(t, err) + var pe *client.ParseError + require.ErrorAs(t, err, &pe) +} + +func Test_AnswerWidgetQuery_ContextCanceled(t *testing.T) { + m := &genTestMockDoer{} + m.On("Do", mock.Anything).Return(nil, context.Canceled).Maybe() + + ctx, cancel := context.WithCancel(context.Background()) + cancel() + + bot := client.New("test:token", client.WithHTTPClient(m)) + params := &AnswerWidgetQueryParams{ + WidgetQueryID: "test_value", + } + _, err := AnswerWidgetQuery(ctx, bot, params) + require.Error(t, err) + require.ErrorIs(t, err, context.Canceled) +} + +// Test_AnswerWidgetQuery_MissingRequiredFields exercises Telegram's server-side +// validation: when a required field is omitted, Telegram returns 400 with +// a description like "Bad Request: is empty". The library must +// surface this as *APIError with the ErrBadRequest sentinel. +func Test_AnswerWidgetQuery_MissingRequiredFields(t *testing.T) { + m := &genTestMockDoer{} + m.On("Do", mock.Anything).Return( + genTestResp(200, `{"ok":false,"error_code":400,"description":"Bad Request: chat_id is empty"}`), nil) + + bot := client.New("test:token", client.WithHTTPClient(m)) + // Send a Params with all required fields zeroed — simulates a caller + // that forgot to populate them. The bot library marshals as-is and + // surfaces Telegram's 400 reply. + _, err := AnswerWidgetQuery(context.Background(), bot, &AnswerWidgetQueryParams{}) + require.Error(t, err) + var ae *client.APIError + require.ErrorAs(t, err, &ae) + require.Equal(t, 400, ae.Code) + require.True(t, errors.Is(err, client.ErrBadRequest)) + require.False(t, ae.IsRetryable()) +} + +// Test_AnswerWidgetQuery_Forbidden exercises the 403 path (bot blocked by user, +// removed from chat, etc.). The library must surface the ErrForbidden +// sentinel. +func Test_AnswerWidgetQuery_Forbidden(t *testing.T) { + m := &genTestMockDoer{} + m.On("Do", mock.Anything).Return( + genTestResp(200, `{"ok":false,"error_code":403,"description":"Forbidden: bot was blocked by the user"}`), nil) + + bot := client.New("test:token", client.WithHTTPClient(m)) + params := &AnswerWidgetQueryParams{ + WidgetQueryID: "test_value", + } + _, err := AnswerWidgetQuery(context.Background(), bot, params) + require.Error(t, err) + var ae *client.APIError + require.ErrorAs(t, err, &ae) + require.Equal(t, 403, ae.Code) + require.True(t, errors.Is(err, client.ErrForbidden)) + require.False(t, ae.IsRetryable()) +} + +// Test_AnswerWidgetQuery_ServerError exercises the 5xx path. The library must +// classify these as retryable so RetryDoer / user retry logic kicks in. +func Test_AnswerWidgetQuery_ServerError(t *testing.T) { + m := &genTestMockDoer{} + m.On("Do", mock.Anything).Return( + genTestResp(200, `{"ok":false,"error_code":500,"description":"Internal server error"}`), nil) + + bot := client.New("test:token", client.WithHTTPClient(m)) + params := &AnswerWidgetQueryParams{ + WidgetQueryID: "test_value", + } + _, err := AnswerWidgetQuery(context.Background(), bot, params) + require.Error(t, err) + var ae *client.APIError + require.ErrorAs(t, err, &ae) + require.Equal(t, 500, ae.Code) + require.True(t, ae.IsRetryable(), "5xx must be retryable") +} + func Test_AnswerGuestQuery_Success(t *testing.T) { m := &genTestMockDoer{} m.On("Do", mock.MatchedBy(func(r *http.Request) bool { @@ -12738,6 +13195,129 @@ func Test_SetManagedBotAccessSettings_ServerError(t *testing.T) { require.True(t, ae.IsRetryable(), "5xx must be retryable") } +func Test_SetMySettings_Success(t *testing.T) { + m := &genTestMockDoer{} + m.On("Do", mock.MatchedBy(func(r *http.Request) bool { + return strings.HasSuffix(r.URL.Path, "/setMySettings") + })).Return(genTestResp(200, `{"ok":true,"result":true}`), nil) + + bot := client.New("test:token", client.WithHTTPClient(m)) + params := &SetMySettingsParams{} + _, err := SetMySettings(context.Background(), bot, params) + require.NoError(t, err) +} + +func Test_SetMySettings_APIError(t *testing.T) { + m := &genTestMockDoer{} + m.On("Do", mock.Anything).Return( + genTestResp(200, `{"ok":false,"error_code":429,"description":"Too Many Requests","parameters":{"retry_after":1}}`), nil) + + bot := client.New("test:token", client.WithHTTPClient(m)) + params := &SetMySettingsParams{} + _, err := SetMySettings(context.Background(), bot, params) + require.Error(t, err) + var ae *client.APIError + require.ErrorAs(t, err, &ae) + require.Equal(t, 429, ae.Code) + require.True(t, ae.IsRetryable()) +} + +func Test_SetMySettings_NetworkError(t *testing.T) { + m := &genTestMockDoer{} + m.On("Do", mock.Anything).Return(nil, errors.New("dial tcp: timeout")) + + bot := client.New("test:token", client.WithHTTPClient(m)) + params := &SetMySettingsParams{} + _, err := SetMySettings(context.Background(), bot, params) + require.Error(t, err) + var ne *client.NetworkError + require.ErrorAs(t, err, &ne) +} + +func Test_SetMySettings_ParseError(t *testing.T) { + m := &genTestMockDoer{} + m.On("Do", mock.Anything).Return(genTestResp(200, `not json`), nil) + + bot := client.New("test:token", client.WithHTTPClient(m)) + params := &SetMySettingsParams{} + _, err := SetMySettings(context.Background(), bot, params) + require.Error(t, err) + var pe *client.ParseError + require.ErrorAs(t, err, &pe) +} + +func Test_SetMySettings_ContextCanceled(t *testing.T) { + m := &genTestMockDoer{} + m.On("Do", mock.Anything).Return(nil, context.Canceled).Maybe() + + ctx, cancel := context.WithCancel(context.Background()) + cancel() + + bot := client.New("test:token", client.WithHTTPClient(m)) + params := &SetMySettingsParams{} + _, err := SetMySettings(ctx, bot, params) + require.Error(t, err) + require.ErrorIs(t, err, context.Canceled) +} + +// Test_SetMySettings_MissingRequiredFields exercises Telegram's server-side +// validation: when a required field is omitted, Telegram returns 400 with +// a description like "Bad Request: is empty". The library must +// surface this as *APIError with the ErrBadRequest sentinel. +func Test_SetMySettings_MissingRequiredFields(t *testing.T) { + m := &genTestMockDoer{} + m.On("Do", mock.Anything).Return( + genTestResp(200, `{"ok":false,"error_code":400,"description":"Bad Request: chat_id is empty"}`), nil) + + bot := client.New("test:token", client.WithHTTPClient(m)) + // Send a Params with all required fields zeroed — simulates a caller + // that forgot to populate them. The bot library marshals as-is and + // surfaces Telegram's 400 reply. + _, err := SetMySettings(context.Background(), bot, &SetMySettingsParams{}) + require.Error(t, err) + var ae *client.APIError + require.ErrorAs(t, err, &ae) + require.Equal(t, 400, ae.Code) + require.True(t, errors.Is(err, client.ErrBadRequest)) + require.False(t, ae.IsRetryable()) +} + +// Test_SetMySettings_Forbidden exercises the 403 path (bot blocked by user, +// removed from chat, etc.). The library must surface the ErrForbidden +// sentinel. +func Test_SetMySettings_Forbidden(t *testing.T) { + m := &genTestMockDoer{} + m.On("Do", mock.Anything).Return( + genTestResp(200, `{"ok":false,"error_code":403,"description":"Forbidden: bot was blocked by the user"}`), nil) + + bot := client.New("test:token", client.WithHTTPClient(m)) + params := &SetMySettingsParams{} + _, err := SetMySettings(context.Background(), bot, params) + require.Error(t, err) + var ae *client.APIError + require.ErrorAs(t, err, &ae) + require.Equal(t, 403, ae.Code) + require.True(t, errors.Is(err, client.ErrForbidden)) + require.False(t, ae.IsRetryable()) +} + +// Test_SetMySettings_ServerError exercises the 5xx path. The library must +// classify these as retryable so RetryDoer / user retry logic kicks in. +func Test_SetMySettings_ServerError(t *testing.T) { + m := &genTestMockDoer{} + m.On("Do", mock.Anything).Return( + genTestResp(200, `{"ok":false,"error_code":500,"description":"Internal server error"}`), nil) + + bot := client.New("test:token", client.WithHTTPClient(m)) + params := &SetMySettingsParams{} + _, err := SetMySettings(context.Background(), bot, params) + require.Error(t, err) + var ae *client.APIError + require.ErrorAs(t, err, &ae) + require.Equal(t, 500, ae.Code) + require.True(t, ae.IsRetryable(), "5xx must be retryable") +} + func Test_SetMyCommands_Success(t *testing.T) { m := &genTestMockDoer{} m.On("Do", mock.MatchedBy(func(r *http.Request) bool { @@ -17393,6 +17973,143 @@ func Test_GetChatGifts_ServerError(t *testing.T) { require.True(t, ae.IsRetryable(), "5xx must be retryable") } +func Test_GetUniqueGift_Success(t *testing.T) { + m := &genTestMockDoer{} + m.On("Do", mock.MatchedBy(func(r *http.Request) bool { + return strings.HasSuffix(r.URL.Path, "/getUniqueGift") + })).Return(genTestResp(200, `{"ok":true,"result":{}}`), nil) + + bot := client.New("test:token", client.WithHTTPClient(m)) + params := &GetUniqueGiftParams{ + Name: "test_value", + } + _, err := GetUniqueGift(context.Background(), bot, params) + require.NoError(t, err) +} + +func Test_GetUniqueGift_APIError(t *testing.T) { + m := &genTestMockDoer{} + m.On("Do", mock.Anything).Return( + genTestResp(200, `{"ok":false,"error_code":429,"description":"Too Many Requests","parameters":{"retry_after":1}}`), nil) + + bot := client.New("test:token", client.WithHTTPClient(m)) + params := &GetUniqueGiftParams{ + Name: "test_value", + } + _, err := GetUniqueGift(context.Background(), bot, params) + require.Error(t, err) + var ae *client.APIError + require.ErrorAs(t, err, &ae) + require.Equal(t, 429, ae.Code) + require.True(t, ae.IsRetryable()) +} + +func Test_GetUniqueGift_NetworkError(t *testing.T) { + m := &genTestMockDoer{} + m.On("Do", mock.Anything).Return(nil, errors.New("dial tcp: timeout")) + + bot := client.New("test:token", client.WithHTTPClient(m)) + params := &GetUniqueGiftParams{ + Name: "test_value", + } + _, err := GetUniqueGift(context.Background(), bot, params) + require.Error(t, err) + var ne *client.NetworkError + require.ErrorAs(t, err, &ne) +} + +func Test_GetUniqueGift_ParseError(t *testing.T) { + m := &genTestMockDoer{} + m.On("Do", mock.Anything).Return(genTestResp(200, `not json`), nil) + + bot := client.New("test:token", client.WithHTTPClient(m)) + params := &GetUniqueGiftParams{ + Name: "test_value", + } + _, err := GetUniqueGift(context.Background(), bot, params) + require.Error(t, err) + var pe *client.ParseError + require.ErrorAs(t, err, &pe) +} + +func Test_GetUniqueGift_ContextCanceled(t *testing.T) { + m := &genTestMockDoer{} + m.On("Do", mock.Anything).Return(nil, context.Canceled).Maybe() + + ctx, cancel := context.WithCancel(context.Background()) + cancel() + + bot := client.New("test:token", client.WithHTTPClient(m)) + params := &GetUniqueGiftParams{ + Name: "test_value", + } + _, err := GetUniqueGift(ctx, bot, params) + require.Error(t, err) + require.ErrorIs(t, err, context.Canceled) +} + +// Test_GetUniqueGift_MissingRequiredFields exercises Telegram's server-side +// validation: when a required field is omitted, Telegram returns 400 with +// a description like "Bad Request: is empty". The library must +// surface this as *APIError with the ErrBadRequest sentinel. +func Test_GetUniqueGift_MissingRequiredFields(t *testing.T) { + m := &genTestMockDoer{} + m.On("Do", mock.Anything).Return( + genTestResp(200, `{"ok":false,"error_code":400,"description":"Bad Request: chat_id is empty"}`), nil) + + bot := client.New("test:token", client.WithHTTPClient(m)) + // Send a Params with all required fields zeroed — simulates a caller + // that forgot to populate them. The bot library marshals as-is and + // surfaces Telegram's 400 reply. + _, err := GetUniqueGift(context.Background(), bot, &GetUniqueGiftParams{}) + require.Error(t, err) + var ae *client.APIError + require.ErrorAs(t, err, &ae) + require.Equal(t, 400, ae.Code) + require.True(t, errors.Is(err, client.ErrBadRequest)) + require.False(t, ae.IsRetryable()) +} + +// Test_GetUniqueGift_Forbidden exercises the 403 path (bot blocked by user, +// removed from chat, etc.). The library must surface the ErrForbidden +// sentinel. +func Test_GetUniqueGift_Forbidden(t *testing.T) { + m := &genTestMockDoer{} + m.On("Do", mock.Anything).Return( + genTestResp(200, `{"ok":false,"error_code":403,"description":"Forbidden: bot was blocked by the user"}`), nil) + + bot := client.New("test:token", client.WithHTTPClient(m)) + params := &GetUniqueGiftParams{ + Name: "test_value", + } + _, err := GetUniqueGift(context.Background(), bot, params) + require.Error(t, err) + var ae *client.APIError + require.ErrorAs(t, err, &ae) + require.Equal(t, 403, ae.Code) + require.True(t, errors.Is(err, client.ErrForbidden)) + require.False(t, ae.IsRetryable()) +} + +// Test_GetUniqueGift_ServerError exercises the 5xx path. The library must +// classify these as retryable so RetryDoer / user retry logic kicks in. +func Test_GetUniqueGift_ServerError(t *testing.T) { + m := &genTestMockDoer{} + m.On("Do", mock.Anything).Return( + genTestResp(200, `{"ok":false,"error_code":500,"description":"Internal server error"}`), nil) + + bot := client.New("test:token", client.WithHTTPClient(m)) + params := &GetUniqueGiftParams{ + Name: "test_value", + } + _, err := GetUniqueGift(context.Background(), bot, params) + require.Error(t, err) + var ae *client.APIError + require.ErrorAs(t, err, &ae) + require.Equal(t, 500, ae.Code) + require.True(t, ae.IsRetryable(), "5xx must be retryable") +} + func Test_ConvertGiftToStars_Success(t *testing.T) { m := &genTestMockDoer{} m.On("Do", mock.MatchedBy(func(r *http.Request) bool { @@ -17832,6 +18549,150 @@ func Test_TransferGift_ServerError(t *testing.T) { require.True(t, ae.IsRetryable(), "5xx must be retryable") } +func Test_DeleteBusinessAccountGift_Success(t *testing.T) { + m := &genTestMockDoer{} + m.On("Do", mock.MatchedBy(func(r *http.Request) bool { + return strings.HasSuffix(r.URL.Path, "/deleteBusinessAccountGift") + })).Return(genTestResp(200, `{"ok":true,"result":true}`), nil) + + bot := client.New("test:token", client.WithHTTPClient(m)) + params := &DeleteBusinessAccountGiftParams{ + BusinessConnectionID: "test_value", + OwnedGiftID: "test_value", + } + _, err := DeleteBusinessAccountGift(context.Background(), bot, params) + require.NoError(t, err) +} + +func Test_DeleteBusinessAccountGift_APIError(t *testing.T) { + m := &genTestMockDoer{} + m.On("Do", mock.Anything).Return( + genTestResp(200, `{"ok":false,"error_code":429,"description":"Too Many Requests","parameters":{"retry_after":1}}`), nil) + + bot := client.New("test:token", client.WithHTTPClient(m)) + params := &DeleteBusinessAccountGiftParams{ + BusinessConnectionID: "test_value", + OwnedGiftID: "test_value", + } + _, err := DeleteBusinessAccountGift(context.Background(), bot, params) + require.Error(t, err) + var ae *client.APIError + require.ErrorAs(t, err, &ae) + require.Equal(t, 429, ae.Code) + require.True(t, ae.IsRetryable()) +} + +func Test_DeleteBusinessAccountGift_NetworkError(t *testing.T) { + m := &genTestMockDoer{} + m.On("Do", mock.Anything).Return(nil, errors.New("dial tcp: timeout")) + + bot := client.New("test:token", client.WithHTTPClient(m)) + params := &DeleteBusinessAccountGiftParams{ + BusinessConnectionID: "test_value", + OwnedGiftID: "test_value", + } + _, err := DeleteBusinessAccountGift(context.Background(), bot, params) + require.Error(t, err) + var ne *client.NetworkError + require.ErrorAs(t, err, &ne) +} + +func Test_DeleteBusinessAccountGift_ParseError(t *testing.T) { + m := &genTestMockDoer{} + m.On("Do", mock.Anything).Return(genTestResp(200, `not json`), nil) + + bot := client.New("test:token", client.WithHTTPClient(m)) + params := &DeleteBusinessAccountGiftParams{ + BusinessConnectionID: "test_value", + OwnedGiftID: "test_value", + } + _, err := DeleteBusinessAccountGift(context.Background(), bot, params) + require.Error(t, err) + var pe *client.ParseError + require.ErrorAs(t, err, &pe) +} + +func Test_DeleteBusinessAccountGift_ContextCanceled(t *testing.T) { + m := &genTestMockDoer{} + m.On("Do", mock.Anything).Return(nil, context.Canceled).Maybe() + + ctx, cancel := context.WithCancel(context.Background()) + cancel() + + bot := client.New("test:token", client.WithHTTPClient(m)) + params := &DeleteBusinessAccountGiftParams{ + BusinessConnectionID: "test_value", + OwnedGiftID: "test_value", + } + _, err := DeleteBusinessAccountGift(ctx, bot, params) + require.Error(t, err) + require.ErrorIs(t, err, context.Canceled) +} + +// Test_DeleteBusinessAccountGift_MissingRequiredFields exercises Telegram's server-side +// validation: when a required field is omitted, Telegram returns 400 with +// a description like "Bad Request: is empty". The library must +// surface this as *APIError with the ErrBadRequest sentinel. +func Test_DeleteBusinessAccountGift_MissingRequiredFields(t *testing.T) { + m := &genTestMockDoer{} + m.On("Do", mock.Anything).Return( + genTestResp(200, `{"ok":false,"error_code":400,"description":"Bad Request: chat_id is empty"}`), nil) + + bot := client.New("test:token", client.WithHTTPClient(m)) + // Send a Params with all required fields zeroed — simulates a caller + // that forgot to populate them. The bot library marshals as-is and + // surfaces Telegram's 400 reply. + _, err := DeleteBusinessAccountGift(context.Background(), bot, &DeleteBusinessAccountGiftParams{}) + require.Error(t, err) + var ae *client.APIError + require.ErrorAs(t, err, &ae) + require.Equal(t, 400, ae.Code) + require.True(t, errors.Is(err, client.ErrBadRequest)) + require.False(t, ae.IsRetryable()) +} + +// Test_DeleteBusinessAccountGift_Forbidden exercises the 403 path (bot blocked by user, +// removed from chat, etc.). The library must surface the ErrForbidden +// sentinel. +func Test_DeleteBusinessAccountGift_Forbidden(t *testing.T) { + m := &genTestMockDoer{} + m.On("Do", mock.Anything).Return( + genTestResp(200, `{"ok":false,"error_code":403,"description":"Forbidden: bot was blocked by the user"}`), nil) + + bot := client.New("test:token", client.WithHTTPClient(m)) + params := &DeleteBusinessAccountGiftParams{ + BusinessConnectionID: "test_value", + OwnedGiftID: "test_value", + } + _, err := DeleteBusinessAccountGift(context.Background(), bot, params) + require.Error(t, err) + var ae *client.APIError + require.ErrorAs(t, err, &ae) + require.Equal(t, 403, ae.Code) + require.True(t, errors.Is(err, client.ErrForbidden)) + require.False(t, ae.IsRetryable()) +} + +// Test_DeleteBusinessAccountGift_ServerError exercises the 5xx path. The library must +// classify these as retryable so RetryDoer / user retry logic kicks in. +func Test_DeleteBusinessAccountGift_ServerError(t *testing.T) { + m := &genTestMockDoer{} + m.On("Do", mock.Anything).Return( + genTestResp(200, `{"ok":false,"error_code":500,"description":"Internal server error"}`), nil) + + bot := client.New("test:token", client.WithHTTPClient(m)) + params := &DeleteBusinessAccountGiftParams{ + BusinessConnectionID: "test_value", + OwnedGiftID: "test_value", + } + _, err := DeleteBusinessAccountGift(context.Background(), bot, params) + require.Error(t, err) + var ae *client.APIError + require.ErrorAs(t, err, &ae) + require.Equal(t, 500, ae.Code) + require.True(t, ae.IsRetryable(), "5xx must be retryable") +} + func Test_PostStory_Success(t *testing.T) { m := &genTestMockDoer{} m.On("Do", mock.MatchedBy(func(r *http.Request) bool { @@ -19676,6 +20537,273 @@ func Test_EditMessageChecklist_ServerError(t *testing.T) { require.True(t, ae.IsRetryable(), "5xx must be retryable") } +func Test_EditMessageWidgetData_Success(t *testing.T) { + m := &genTestMockDoer{} + m.On("Do", mock.MatchedBy(func(r *http.Request) bool { + return strings.HasSuffix(r.URL.Path, "/editMessageWidgetData") + })).Return(genTestResp(200, `{"ok":true,"result":true}`), nil) + + bot := client.New("test:token", client.WithHTTPClient(m)) + params := &EditMessageWidgetDataParams{} + _, err := EditMessageWidgetData(context.Background(), bot, params) + require.NoError(t, err) +} + +func Test_EditMessageWidgetData_APIError(t *testing.T) { + m := &genTestMockDoer{} + m.On("Do", mock.Anything).Return( + genTestResp(200, `{"ok":false,"error_code":429,"description":"Too Many Requests","parameters":{"retry_after":1}}`), nil) + + bot := client.New("test:token", client.WithHTTPClient(m)) + params := &EditMessageWidgetDataParams{} + _, err := EditMessageWidgetData(context.Background(), bot, params) + require.Error(t, err) + var ae *client.APIError + require.ErrorAs(t, err, &ae) + require.Equal(t, 429, ae.Code) + require.True(t, ae.IsRetryable()) +} + +func Test_EditMessageWidgetData_NetworkError(t *testing.T) { + m := &genTestMockDoer{} + m.On("Do", mock.Anything).Return(nil, errors.New("dial tcp: timeout")) + + bot := client.New("test:token", client.WithHTTPClient(m)) + params := &EditMessageWidgetDataParams{} + _, err := EditMessageWidgetData(context.Background(), bot, params) + require.Error(t, err) + var ne *client.NetworkError + require.ErrorAs(t, err, &ne) +} + +func Test_EditMessageWidgetData_ParseError(t *testing.T) { + m := &genTestMockDoer{} + m.On("Do", mock.Anything).Return(genTestResp(200, `not json`), nil) + + bot := client.New("test:token", client.WithHTTPClient(m)) + params := &EditMessageWidgetDataParams{} + _, err := EditMessageWidgetData(context.Background(), bot, params) + require.Error(t, err) + var pe *client.ParseError + require.ErrorAs(t, err, &pe) +} + +func Test_EditMessageWidgetData_ContextCanceled(t *testing.T) { + m := &genTestMockDoer{} + m.On("Do", mock.Anything).Return(nil, context.Canceled).Maybe() + + ctx, cancel := context.WithCancel(context.Background()) + cancel() + + bot := client.New("test:token", client.WithHTTPClient(m)) + params := &EditMessageWidgetDataParams{} + _, err := EditMessageWidgetData(ctx, bot, params) + require.Error(t, err) + require.ErrorIs(t, err, context.Canceled) +} + +// Test_EditMessageWidgetData_MissingRequiredFields exercises Telegram's server-side +// validation: when a required field is omitted, Telegram returns 400 with +// a description like "Bad Request: is empty". The library must +// surface this as *APIError with the ErrBadRequest sentinel. +func Test_EditMessageWidgetData_MissingRequiredFields(t *testing.T) { + m := &genTestMockDoer{} + m.On("Do", mock.Anything).Return( + genTestResp(200, `{"ok":false,"error_code":400,"description":"Bad Request: chat_id is empty"}`), nil) + + bot := client.New("test:token", client.WithHTTPClient(m)) + // Send a Params with all required fields zeroed — simulates a caller + // that forgot to populate them. The bot library marshals as-is and + // surfaces Telegram's 400 reply. + _, err := EditMessageWidgetData(context.Background(), bot, &EditMessageWidgetDataParams{}) + require.Error(t, err) + var ae *client.APIError + require.ErrorAs(t, err, &ae) + require.Equal(t, 400, ae.Code) + require.True(t, errors.Is(err, client.ErrBadRequest)) + require.False(t, ae.IsRetryable()) +} + +// Test_EditMessageWidgetData_Forbidden exercises the 403 path (bot blocked by user, +// removed from chat, etc.). The library must surface the ErrForbidden +// sentinel. +func Test_EditMessageWidgetData_Forbidden(t *testing.T) { + m := &genTestMockDoer{} + m.On("Do", mock.Anything).Return( + genTestResp(200, `{"ok":false,"error_code":403,"description":"Forbidden: bot was blocked by the user"}`), nil) + + bot := client.New("test:token", client.WithHTTPClient(m)) + params := &EditMessageWidgetDataParams{} + _, err := EditMessageWidgetData(context.Background(), bot, params) + require.Error(t, err) + var ae *client.APIError + require.ErrorAs(t, err, &ae) + require.Equal(t, 403, ae.Code) + require.True(t, errors.Is(err, client.ErrForbidden)) + require.False(t, ae.IsRetryable()) +} + +// Test_EditMessageWidgetData_ServerError exercises the 5xx path. The library must +// classify these as retryable so RetryDoer / user retry logic kicks in. +func Test_EditMessageWidgetData_ServerError(t *testing.T) { + m := &genTestMockDoer{} + m.On("Do", mock.Anything).Return( + genTestResp(200, `{"ok":false,"error_code":500,"description":"Internal server error"}`), nil) + + bot := client.New("test:token", client.WithHTTPClient(m)) + params := &EditMessageWidgetDataParams{} + _, err := EditMessageWidgetData(context.Background(), bot, params) + require.Error(t, err) + var ae *client.APIError + require.ErrorAs(t, err, &ae) + require.Equal(t, 500, ae.Code) + require.True(t, ae.IsRetryable(), "5xx must be retryable") +} + +func Test_EditSharedWidgetData_Success(t *testing.T) { + m := &genTestMockDoer{} + m.On("Do", mock.MatchedBy(func(r *http.Request) bool { + return strings.HasSuffix(r.URL.Path, "/editSharedWidgetData") + })).Return(genTestResp(200, `{"ok":true,"result":true}`), nil) + + bot := client.New("test:token", client.WithHTTPClient(m)) + params := &EditSharedWidgetDataParams{ + WidgetID: "test_value", + PublicData: "test_value", + } + _, err := EditSharedWidgetData(context.Background(), bot, params) + require.NoError(t, err) +} + +func Test_EditSharedWidgetData_APIError(t *testing.T) { + m := &genTestMockDoer{} + m.On("Do", mock.Anything).Return( + genTestResp(200, `{"ok":false,"error_code":429,"description":"Too Many Requests","parameters":{"retry_after":1}}`), nil) + + bot := client.New("test:token", client.WithHTTPClient(m)) + params := &EditSharedWidgetDataParams{ + WidgetID: "test_value", + PublicData: "test_value", + } + _, err := EditSharedWidgetData(context.Background(), bot, params) + require.Error(t, err) + var ae *client.APIError + require.ErrorAs(t, err, &ae) + require.Equal(t, 429, ae.Code) + require.True(t, ae.IsRetryable()) +} + +func Test_EditSharedWidgetData_NetworkError(t *testing.T) { + m := &genTestMockDoer{} + m.On("Do", mock.Anything).Return(nil, errors.New("dial tcp: timeout")) + + bot := client.New("test:token", client.WithHTTPClient(m)) + params := &EditSharedWidgetDataParams{ + WidgetID: "test_value", + PublicData: "test_value", + } + _, err := EditSharedWidgetData(context.Background(), bot, params) + require.Error(t, err) + var ne *client.NetworkError + require.ErrorAs(t, err, &ne) +} + +func Test_EditSharedWidgetData_ParseError(t *testing.T) { + m := &genTestMockDoer{} + m.On("Do", mock.Anything).Return(genTestResp(200, `not json`), nil) + + bot := client.New("test:token", client.WithHTTPClient(m)) + params := &EditSharedWidgetDataParams{ + WidgetID: "test_value", + PublicData: "test_value", + } + _, err := EditSharedWidgetData(context.Background(), bot, params) + require.Error(t, err) + var pe *client.ParseError + require.ErrorAs(t, err, &pe) +} + +func Test_EditSharedWidgetData_ContextCanceled(t *testing.T) { + m := &genTestMockDoer{} + m.On("Do", mock.Anything).Return(nil, context.Canceled).Maybe() + + ctx, cancel := context.WithCancel(context.Background()) + cancel() + + bot := client.New("test:token", client.WithHTTPClient(m)) + params := &EditSharedWidgetDataParams{ + WidgetID: "test_value", + PublicData: "test_value", + } + _, err := EditSharedWidgetData(ctx, bot, params) + require.Error(t, err) + require.ErrorIs(t, err, context.Canceled) +} + +// Test_EditSharedWidgetData_MissingRequiredFields exercises Telegram's server-side +// validation: when a required field is omitted, Telegram returns 400 with +// a description like "Bad Request: is empty". The library must +// surface this as *APIError with the ErrBadRequest sentinel. +func Test_EditSharedWidgetData_MissingRequiredFields(t *testing.T) { + m := &genTestMockDoer{} + m.On("Do", mock.Anything).Return( + genTestResp(200, `{"ok":false,"error_code":400,"description":"Bad Request: chat_id is empty"}`), nil) + + bot := client.New("test:token", client.WithHTTPClient(m)) + // Send a Params with all required fields zeroed — simulates a caller + // that forgot to populate them. The bot library marshals as-is and + // surfaces Telegram's 400 reply. + _, err := EditSharedWidgetData(context.Background(), bot, &EditSharedWidgetDataParams{}) + require.Error(t, err) + var ae *client.APIError + require.ErrorAs(t, err, &ae) + require.Equal(t, 400, ae.Code) + require.True(t, errors.Is(err, client.ErrBadRequest)) + require.False(t, ae.IsRetryable()) +} + +// Test_EditSharedWidgetData_Forbidden exercises the 403 path (bot blocked by user, +// removed from chat, etc.). The library must surface the ErrForbidden +// sentinel. +func Test_EditSharedWidgetData_Forbidden(t *testing.T) { + m := &genTestMockDoer{} + m.On("Do", mock.Anything).Return( + genTestResp(200, `{"ok":false,"error_code":403,"description":"Forbidden: bot was blocked by the user"}`), nil) + + bot := client.New("test:token", client.WithHTTPClient(m)) + params := &EditSharedWidgetDataParams{ + WidgetID: "test_value", + PublicData: "test_value", + } + _, err := EditSharedWidgetData(context.Background(), bot, params) + require.Error(t, err) + var ae *client.APIError + require.ErrorAs(t, err, &ae) + require.Equal(t, 403, ae.Code) + require.True(t, errors.Is(err, client.ErrForbidden)) + require.False(t, ae.IsRetryable()) +} + +// Test_EditSharedWidgetData_ServerError exercises the 5xx path. The library must +// classify these as retryable so RetryDoer / user retry logic kicks in. +func Test_EditSharedWidgetData_ServerError(t *testing.T) { + m := &genTestMockDoer{} + m.On("Do", mock.Anything).Return( + genTestResp(200, `{"ok":false,"error_code":500,"description":"Internal server error"}`), nil) + + bot := client.New("test:token", client.WithHTTPClient(m)) + params := &EditSharedWidgetDataParams{ + WidgetID: "test_value", + PublicData: "test_value", + } + _, err := EditSharedWidgetData(context.Background(), bot, params) + require.Error(t, err) + var ae *client.APIError + require.ErrorAs(t, err, &ae) + require.Equal(t, 500, ae.Code) + require.True(t, ae.IsRetryable(), "5xx must be retryable") +} + func Test_EditMessageReplyMarkup_Success(t *testing.T) { m := &genTestMockDoer{} m.On("Do", mock.MatchedBy(func(r *http.Request) bool { @@ -21570,7 +22698,6 @@ func Test_SendSticker_Success(t *testing.T) { bot := client.New("test:token", client.WithHTTPClient(m)) params := &SendStickerParams{ - ChatID: ChatIDFromInt(123), Sticker: &InputFile{PathOrID: "file_id_test"}, } _, err := SendSticker(context.Background(), bot, params) @@ -21584,7 +22711,6 @@ func Test_SendSticker_APIError(t *testing.T) { bot := client.New("test:token", client.WithHTTPClient(m)) params := &SendStickerParams{ - ChatID: ChatIDFromInt(123), Sticker: &InputFile{PathOrID: "file_id_test"}, } _, err := SendSticker(context.Background(), bot, params) @@ -21601,7 +22727,6 @@ func Test_SendSticker_NetworkError(t *testing.T) { bot := client.New("test:token", client.WithHTTPClient(m)) params := &SendStickerParams{ - ChatID: ChatIDFromInt(123), Sticker: &InputFile{PathOrID: "file_id_test"}, } _, err := SendSticker(context.Background(), bot, params) @@ -21616,7 +22741,6 @@ func Test_SendSticker_ParseError(t *testing.T) { bot := client.New("test:token", client.WithHTTPClient(m)) params := &SendStickerParams{ - ChatID: ChatIDFromInt(123), Sticker: &InputFile{PathOrID: "file_id_test"}, } _, err := SendSticker(context.Background(), bot, params) @@ -21634,7 +22758,6 @@ func Test_SendSticker_ContextCanceled(t *testing.T) { bot := client.New("test:token", client.WithHTTPClient(m)) params := &SendStickerParams{ - ChatID: ChatIDFromInt(123), Sticker: &InputFile{PathOrID: "file_id_test"}, } _, err := SendSticker(ctx, bot, params) @@ -21674,7 +22797,6 @@ func Test_SendSticker_Forbidden(t *testing.T) { bot := client.New("test:token", client.WithHTTPClient(m)) params := &SendStickerParams{ - ChatID: ChatIDFromInt(123), Sticker: &InputFile{PathOrID: "file_id_test"}, } _, err := SendSticker(context.Background(), bot, params) @@ -21695,7 +22817,6 @@ func Test_SendSticker_ServerError(t *testing.T) { bot := client.New("test:token", client.WithHTTPClient(m)) params := &SendStickerParams{ - ChatID: ChatIDFromInt(123), Sticker: &InputFile{PathOrID: "file_id_test"}, } _, err := SendSticker(context.Background(), bot, params) @@ -23874,7 +24995,6 @@ func Test_SendRichMessage_Success(t *testing.T) { bot := client.New("test:token", client.WithHTTPClient(m)) params := &SendRichMessageParams{ - ChatID: ChatIDFromInt(123), RichMessage: InputRichMessage{}, } _, err := SendRichMessage(context.Background(), bot, params) @@ -23888,7 +25008,6 @@ func Test_SendRichMessage_APIError(t *testing.T) { bot := client.New("test:token", client.WithHTTPClient(m)) params := &SendRichMessageParams{ - ChatID: ChatIDFromInt(123), RichMessage: InputRichMessage{}, } _, err := SendRichMessage(context.Background(), bot, params) @@ -23905,7 +25024,6 @@ func Test_SendRichMessage_NetworkError(t *testing.T) { bot := client.New("test:token", client.WithHTTPClient(m)) params := &SendRichMessageParams{ - ChatID: ChatIDFromInt(123), RichMessage: InputRichMessage{}, } _, err := SendRichMessage(context.Background(), bot, params) @@ -23920,7 +25038,6 @@ func Test_SendRichMessage_ParseError(t *testing.T) { bot := client.New("test:token", client.WithHTTPClient(m)) params := &SendRichMessageParams{ - ChatID: ChatIDFromInt(123), RichMessage: InputRichMessage{}, } _, err := SendRichMessage(context.Background(), bot, params) @@ -23938,7 +25055,6 @@ func Test_SendRichMessage_ContextCanceled(t *testing.T) { bot := client.New("test:token", client.WithHTTPClient(m)) params := &SendRichMessageParams{ - ChatID: ChatIDFromInt(123), RichMessage: InputRichMessage{}, } _, err := SendRichMessage(ctx, bot, params) @@ -23978,7 +25094,6 @@ func Test_SendRichMessage_Forbidden(t *testing.T) { bot := client.New("test:token", client.WithHTTPClient(m)) params := &SendRichMessageParams{ - ChatID: ChatIDFromInt(123), RichMessage: InputRichMessage{}, } _, err := SendRichMessage(context.Background(), bot, params) @@ -23999,7 +25114,6 @@ func Test_SendRichMessage_ServerError(t *testing.T) { bot := client.New("test:token", client.WithHTTPClient(m)) params := &SendRichMessageParams{ - ChatID: ChatIDFromInt(123), RichMessage: InputRichMessage{}, } _, err := SendRichMessage(context.Background(), bot, params) diff --git a/api/types.gen.go b/api/types.gen.go index 570ff05..b8c7086 100644 --- a/api/types.gen.go +++ b/api/types.gen.go @@ -20,7 +20,7 @@ var _ = bytes.TrimLeft // keep import for shape-dispatching UnmarshalXxx helpers // This object represents an incoming update.At most one of the optional fields can be present in any given update. type Update struct { - // The update's unique identifier. Update identifiers start from a certain positive number and increase sequentially. This identifier becomes especially handy if you're using webhooks, since it allows you to ignore repeated updates or to restore the correct update sequence, should they get out of order. If there are no new updates for at least a week, then identifier of the next update will be chosen randomly instead of sequentially. + // The update's unique identifier. Update identifiers start from a certain positive number and increase sequentially. This identifier becomes especially handy if you're using webhooks, since it allows you to ignore repeated updates or to restore the correct update sequence, should they get out of order. If there are no new updates for at least a week, then the identifier of the next update will be chosen randomly instead of sequentially. UpdateID int64 `json:"update_id"` // Optional. New incoming message of any kind - text, photo, sticker, etc. Message *Message `json:"message,omitempty"` @@ -42,21 +42,25 @@ type Update struct { GuestMessage *Message `json:"guest_message,omitempty"` // Optional. A reaction to a message was changed by a user. The bot must be an administrator in the chat and must explicitly specify "message_reaction" in the list of allowed_updates to receive these updates. The update isn't received for reactions set by bots. MessageReaction *MessageReactionUpdated `json:"message_reaction,omitempty"` - // Optional. Reactions to a message with anonymous reactions were changed. The bot must be an administrator in the chat and must explicitly specify "message_reaction_count" in the list of allowed_updates to receive these updates. The updates are grouped and can be sent with delay up to a few minutes. + // Optional. Reactions to a message with anonymous reactions were changed. The bot must be an administrator in the chat and must explicitly specify "message_reaction_count" in the list of allowed_updates to receive these updates. The updates are grouped and can be sent with a delay of up to a few minutes. MessageReactionCount *MessageReactionCountUpdated `json:"message_reaction_count,omitempty"` // Optional. New incoming inline query InlineQuery *InlineQuery `json:"inline_query,omitempty"` - // Optional. The result of an inline query that was chosen by a user and sent to their chat partner. Please see our documentation on the feedback collecting for details on how to enable these updates for your bot. + // Optional. The result of an inline query that was chosen by a user and sent to their chat partner. Please see our documentation on the feedback collecting for details on how to enable these updates for your bot. The updates can also be enabled using the parameter inline_feedback_share_denominator of the method setMySettings. ChosenInlineResult *ChosenInlineResult `json:"chosen_inline_result,omitempty"` // Optional. New incoming callback query CallbackQuery *CallbackQuery `json:"callback_query,omitempty"` + // Optional. New incoming query from a widget in a message sent by the bot or via the bot + WidgetQuery *WidgetQuery `json:"widget_query,omitempty"` + // Optional. New incoming query from a forwarded message with a shared widget + SharedWidgetQuery *SharedWidgetQuery `json:"shared_widget_query,omitempty"` // Optional. New incoming shipping query. Only for invoices with flexible price. ShippingQuery *ShippingQuery `json:"shipping_query,omitempty"` // Optional. New incoming pre-checkout query. Contains full information about checkout. PreCheckoutQuery *PreCheckoutQuery `json:"pre_checkout_query,omitempty"` // Optional. A user purchased paid media with a non-empty payload sent by the bot in a non-channel chat PurchasedPaidMedia *PaidMediaPurchased `json:"purchased_paid_media,omitempty"` - // Optional. New poll state. Bots receive only updates about manually stopped polls and polls, which are sent by the bot. + // Optional. New poll state. Bots receive only updates about manually stopped polls and polls which are sent by the bot. Poll *Poll `json:"poll,omitempty"` // Optional. A user changed their answer in a non-anonymous poll. Bots receive new votes only in polls that were sent by the bot itself. PollAnswer *PollAnswer `json:"poll_answer,omitempty"` @@ -70,7 +74,7 @@ type Update struct { ChatBoost *ChatBoostUpdated `json:"chat_boost,omitempty"` // Optional. A boost was removed from a chat. The bot must be an administrator in the chat to receive these updates. RemovedChatBoost *ChatBoostRemoved `json:"removed_chat_boost,omitempty"` - // Optional. A new bot was created to be managed by the bot, or token or owner of a managed bot was changed + // Optional. A new bot was created to be managed by the bot, or the token or owner of a managed bot was changed ManagedBot *ManagedBotUpdated `json:"managed_bot,omitempty"` // Optional. User payment subscription has changed Subscription *BotSubscriptionUpdated `json:"subscription,omitempty"` @@ -100,9 +104,49 @@ type WebhookInfo struct { AllowedUpdates []UpdateType `json:"allowed_updates,omitempty"` } +// This object contains full information about the bot itself. +type BotFullInfo struct { + // Unique identifier for this bot. This number may have more than 32 significant bits and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a 64-bit integer or double-precision float type is safe for storing this identifier. + ID int64 `json:"id"` + // Always True + IsBot bool `json:"is_bot"` + // Bot's first name + FirstName string `json:"first_name"` + // Optional. Bot's username + Username string `json:"username,omitempty"` + // Optional. If non-empty, the list of all active usernames of the bot + ActiveUsernames []string `json:"active_usernames,omitempty"` + // True, if the bot can be added to groups + CanJoinGroups bool `json:"can_join_groups"` + // True, if privacy mode is disabled for the bot + CanReadAllGroupMessages bool `json:"can_read_all_group_messages"` + // True, if the bot supports guest queries from chats it is not a member of + SupportsGuestQueries bool `json:"supports_guest_queries"` + // True, if the bot supports inline queries + SupportsInlineQueries bool `json:"supports_inline_queries"` + // Optional. Placeholder for inline queries, which is shown in the input field after the bot's username; omitted if the default placeholder is used + InlineQueryPlaceholder string `json:"inline_query_placeholder,omitempty"` + // True, if the bot requests the location of the user with every inline query + NeedsInlineQueryLocation bool `json:"needs_inline_query_location"` + // True, if the bot can be connected to a user account to manage it + CanConnectToBusiness bool `json:"can_connect_to_business"` + // True, if the bot has a main Web App + HasMainWebApp bool `json:"has_main_web_app"` + // True, if the bot has forum topic mode enabled in private chats + HasTopicsEnabled bool `json:"has_topics_enabled"` + // True, if the bot allows users to create and delete topics in private chats + AllowsUsersToCreateTopics bool `json:"allows_users_to_create_topics"` + // True, if topics in private chats with the bot are shown in a sidebar + HasTopicSidebar bool `json:"has_topic_sidebar"` + // True, if other bots can be created to be controlled by the bot + CanManageBots bool `json:"can_manage_bots"` + // True, if the bot supports join request queries and can be assigned to process them + SupportsJoinRequestQueries bool `json:"supports_join_request_queries"` +} + // This object represents a Telegram user or bot. type User struct { - // Unique identifier for this user or bot. This number may have more than 32 significant bits and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a 64-bit integer or double-precision float type are safe for storing this identifier. + // Unique identifier for this user or bot. This number may have more than 32 significant bits and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a 64-bit integer or double-precision float type is safe for storing this identifier. ID int64 `json:"id"` // True, if this user is a bot IsBot bool `json:"is_bot"` @@ -118,31 +162,11 @@ type User struct { IsPremium *bool `json:"is_premium,omitempty"` // Optional. True, if this user added the bot to the attachment menu AddedToAttachmentMenu *bool `json:"added_to_attachment_menu,omitempty"` - // Optional. True, if the bot can be invited to groups. Returned only in getMe. - CanJoinGroups *bool `json:"can_join_groups,omitempty"` - // Optional. True, if privacy mode is disabled for the bot. Returned only in getMe. - CanReadAllGroupMessages *bool `json:"can_read_all_group_messages,omitempty"` - // Optional. True, if the bot supports guest queries from chats it is not a member of. Returned only in getMe. - SupportsGuestQueries *bool `json:"supports_guest_queries,omitempty"` - // Optional. True, if the bot supports inline queries. Returned only in getMe. - SupportsInlineQueries *bool `json:"supports_inline_queries,omitempty"` - // Optional. True, if the bot can be connected to a user account to manage it. Returned only in getMe. - CanConnectToBusiness *bool `json:"can_connect_to_business,omitempty"` - // Optional. True, if the bot has a main Web App. Returned only in getMe. - HasMainWebApp *bool `json:"has_main_web_app,omitempty"` - // Optional. True, if the bot has forum topic mode enabled in private chats. Returned only in getMe. - HasTopicsEnabled *bool `json:"has_topics_enabled,omitempty"` - // Optional. True, if the bot allows users to create and delete topics in private chats. Returned only in getMe. - AllowsUsersToCreateTopics *bool `json:"allows_users_to_create_topics,omitempty"` - // Optional. True, if other bots can be created to be controlled by the bot. Returned only in getMe. - CanManageBots *bool `json:"can_manage_bots,omitempty"` - // Optional. True, if the bot supports join request queries and can be assigned to process them. Returned only in getMe. - SupportsJoinRequestQueries *bool `json:"supports_join_request_queries,omitempty"` } // This object represents a chat. type Chat struct { - // Unique identifier for this chat. This number may have more than 32 significant bits and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a signed 64-bit integer or double-precision float type are safe for storing this identifier. + // Unique identifier for this chat. This number may have more than 32 significant bits and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a signed 64-bit integer or double-precision float type is safe for storing this identifier. ID int64 `json:"id"` // Type of the chat, can be either “private”, “group”, “supergroup” or “channel” Type ChatType `json:"type"` @@ -162,7 +186,7 @@ type Chat struct { // This object contains full information about a chat. type ChatFullInfo struct { - // Unique identifier for this chat. This number may have more than 32 significant bits and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a signed 64-bit integer or double-precision float type are safe for storing this identifier. + // Unique identifier for this chat. This number may have more than 32 significant bits and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a signed 64-bit integer or double-precision float type is safe for storing this identifier. ID int64 `json:"id"` // Type of the chat, can be either “private”, “group”, “supergroup” or “channel” Type ChatType `json:"type"` @@ -212,7 +236,7 @@ type ChatFullInfo struct { EmojiStatusExpirationDate *int64 `json:"emoji_status_expiration_date,omitempty"` // Optional. Bio of the other party in a private chat Bio string `json:"bio,omitempty"` - // Optional. True, if privacy settings of the other party in the private chat allows to use tg://user?id= links only in chats with the user + // Optional. True, if the privacy settings of the other party in the private chat allow using tg://user?id= links only in chats with the user HasPrivateForwards *bool `json:"has_private_forwards,omitempty"` // Optional. True, if the privacy settings of the other party restrict sending voice and video note messages in the private chat HasRestrictedVoiceAndVideoMessages *bool `json:"has_restricted_voice_and_video_messages,omitempty"` @@ -252,7 +276,7 @@ type ChatFullInfo struct { CanSetStickerSet *bool `json:"can_set_sticker_set,omitempty"` // Optional. For supergroups, the name of the group's custom emoji sticker set. Custom emoji from this set can be used by all users and bots in the group. CustomEmojiStickerSetName string `json:"custom_emoji_sticker_set_name,omitempty"` - // Optional. Unique identifier for the linked chat, i.e. the discussion group identifier for a channel and vice versa; for supergroups and channel chats. This identifier may be greater than 32 bits and some programming languages may have difficulty/silent defects in interpreting it. But it is smaller than 52 bits, so a signed 64 bit integer or double-precision float type are safe for storing this identifier. + // Optional. Unique identifier for the linked chat, i.e. the discussion group identifier for a channel and vice versa; for supergroups and channel chats. This identifier may be greater than 32 bits and some programming languages may have difficulty/silent defects in interpreting it. But it is smaller than 52 bits, so a signed 64-bit integer or double-precision float type is safe for storing this identifier. LinkedChatID *int64 `json:"linked_chat_id,omitempty"` // Optional. For supergroups, the location to which the supergroup is connected Location *ChatLocation `json:"location,omitempty"` @@ -268,14 +292,19 @@ type ChatFullInfo struct { GuardBot *User `json:"guard_bot,omitempty"` // Optional. The Community to which the chat belongs Community *Community `json:"community,omitempty"` + // Optional. For private chats, the TON wallet card of the user, which is shown on their profile page + TonWalletCard *TonWalletCard `json:"ton_wallet_card,omitempty"` + // Optional. For private chats, supergroups and channels, the theme of the screen for sharing a link to the user or the chat; omitted if the default theme is used + ShareTheme ChatShareTheme `json:"share_theme,omitempty"` } // UnmarshalJSON decodes ChatFullInfo by dispatching union-typed fields -// (AvailableReactions) through their concrete UnmarshalXxx helpers. +// (AvailableReactions, ShareTheme) through their concrete UnmarshalXxx helpers. func (m *ChatFullInfo) UnmarshalJSON(data []byte) error { type Alias ChatFullInfo aux := &struct { AvailableReactions json.RawMessage `json:"available_reactions,omitempty"` + ShareTheme json.RawMessage `json:"share_theme,omitempty"` *Alias }{Alias: (*Alias)(m)} if err := json.Unmarshal(data, aux); err != nil { @@ -299,6 +328,15 @@ func (m *ChatFullInfo) UnmarshalJSON(data []byte) error { } + if len(aux.ShareTheme) > 0 && string(aux.ShareTheme) != "null" { + v, err := UnmarshalChatShareTheme(aux.ShareTheme) + if err != nil { + return fmt.Errorf("decoding share_theme: %w", err) + } + m.ShareTheme = v + + } + return nil } @@ -404,11 +442,13 @@ type Message struct { VideoNote *VideoNote `json:"video_note,omitempty"` // Optional. Message is a voice message, information about the file Voice *Voice `json:"voice,omitempty"` - // Optional. Caption for the animation, audio, document, paid media, photo, video or voice + // Optional. Message is an HTML widget, information about the widget + Widget *Widget `json:"widget,omitempty"` + // Optional. Caption for the animation, audio, document, live photo, paid media, photo, video, voice, or widget Caption string `json:"caption,omitempty"` // Optional. For messages with a caption, special entities like usernames, URLs, bot commands, etc. that appear in the caption CaptionEntities []MessageEntity `json:"caption_entities,omitempty"` - // Optional. True, if the caption must be shown above the message media + // Optional. True, if the caption must be shown above the message media or the widget ShowCaptionAboveMedia *bool `json:"show_caption_above_media,omitempty"` // Optional. True, if the message media is covered by a spoiler animation HasMediaSpoiler *bool `json:"has_media_spoiler,omitempty"` @@ -436,21 +476,21 @@ type Message struct { ChatOwnerChanged *ChatOwnerChanged `json:"chat_owner_changed,omitempty"` // Optional. A chat title was changed to this value NewChatTitle string `json:"new_chat_title,omitempty"` - // Optional. A chat photo was change to this value + // Optional. A chat photo was changed to this value NewChatPhoto []PhotoSize `json:"new_chat_photo,omitempty"` // Optional. Service message: the chat photo was deleted DeleteChatPhoto *bool `json:"delete_chat_photo,omitempty"` // Optional. Service message: the group has been created GroupChatCreated *bool `json:"group_chat_created,omitempty"` - // Optional. Service message: the supergroup has been created. This field can't be received in a message coming through updates, because bot can't be a member of a supergroup when it is created. It can only be found in reply_to_message if someone replies to a very first message in a directly created supergroup. + // Optional. Service message: the supergroup has been created. This field can't be received in a message coming through updates, because a bot can't be a member of a supergroup when it is created. It can only be found in reply_to_message if someone replies to the very first message in a directly created supergroup. SupergroupChatCreated *bool `json:"supergroup_chat_created,omitempty"` - // Optional. Service message: the channel has been created. This field can't be received in a message coming through updates, because bot can't be a member of a channel when it is created. It can only be found in reply_to_message if someone replies to a very first message in a channel. + // Optional. Service message: the channel has been created. This field can't be received in a message coming through updates, because a bot can't be a member of a channel when it is created. It can only be found in reply_to_message if someone replies to the very first message in a channel. ChannelChatCreated *bool `json:"channel_chat_created,omitempty"` // Optional. Service message: auto-delete timer settings changed in the chat MessageAutoDeleteTimerChanged *MessageAutoDeleteTimerChanged `json:"message_auto_delete_timer_changed,omitempty"` - // Optional. The group has been migrated to a supergroup with the specified identifier. This number may have more than 32 significant bits and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a signed 64-bit integer or double-precision float type are safe for storing this identifier. + // Optional. The group has been migrated to a supergroup with the specified identifier. This number may have more than 32 significant bits and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a signed 64-bit integer or double-precision float type is safe for storing this identifier. MigrateToChatID *int64 `json:"migrate_to_chat_id,omitempty"` - // Optional. The supergroup has been migrated from a group with the specified identifier. This number may have more than 32 significant bits and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a signed 64-bit integer or double-precision float type are safe for storing this identifier. + // Optional. The supergroup has been migrated from a group with the specified identifier. This number may have more than 32 significant bits and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a signed 64-bit integer or double-precision float type is safe for storing this identifier. MigrateFromChatID *int64 `json:"migrate_from_chat_id,omitempty"` // Optional. Specified message was pinned. Note that the Message object in this field will not contain further reply_to_message fields even if it itself is a reply. PinnedMessage MaybeInaccessibleMessage `json:"pinned_message,omitempty"` @@ -472,7 +512,7 @@ type Message struct { GiftUpgradeSent *GiftInfo `json:"gift_upgrade_sent,omitempty"` // Optional. The domain name of the website on which the user has logged in. More about Telegram Login » ConnectedWebsite string `json:"connected_website,omitempty"` - // Optional. Service message: the user allowed the bot to write messages after adding it to the attachment or side menu, launching a Web App from a link, or accepting an explicit request from a Web App sent by the method requestWriteAccess + // Optional. Service message: the user allowed the bot to write messages after adding it to the attachment or side menu, launching a Web App from a link, or accepting an explicit request from a Web App sent by the method requestWriteAccess, or the user was invited to the private chat with the bot by the owner of the bot WriteAccessAllowed *WriteAccessAllowed `json:"write_access_allowed,omitempty"` // Optional. Telegram Passport data PassportData *PassportData `json:"passport_data,omitempty"` @@ -518,6 +558,8 @@ type Message struct { ManagedBotCreated *ManagedBotCreated `json:"managed_bot_created,omitempty"` // Optional. Service message: the price for paid messages has changed in the chat PaidMessagePriceChanged *PaidMessagePriceChanged `json:"paid_message_price_changed,omitempty"` + // Optional. Service message: the sender of the message used a link of the other user, which allows sending messages to the user without paying Telegram Stars + PaidMessagesWaived *PaidMessagesWaived `json:"paid_messages_waived,omitempty"` // Optional. Service message: answer option was added to a poll PollOptionAdded *PollOptionAdded `json:"poll_option_added,omitempty"` // Optional. Service message: answer option was deleted from a poll @@ -532,6 +574,8 @@ type Message struct { SuggestedPostPaid *SuggestedPostPaid `json:"suggested_post_paid,omitempty"` // Optional. Service message: payment for a suggested post was refunded SuggestedPostRefunded *SuggestedPostRefunded `json:"suggested_post_refunded,omitempty"` + // Optional. Service message: a transfer with a TON wallet + TonWalletTransfer *TonWalletTransfer `json:"ton_wallet_transfer,omitempty"` // Optional. Service message: video chat scheduled VideoChatScheduled *VideoChatScheduled `json:"video_chat_scheduled,omitempty"` // Optional. Service message: video chat started @@ -582,7 +626,7 @@ func (m *Message) UnmarshalJSON(data []byte) error { // This object represents a unique message identifier. type MessageId struct { - // Unique message identifier. In specific instances (e.g., message containing a video sent to a big chat), the server might automatically schedule a message instead of sending it immediately. In such cases, this field will be 0 and the relevant message will be unusable until it is actually sent. + // Unique message identifier. In specific instances (e.g., a message containing a video sent to a big chat), the server might automatically schedule a message instead of sending it immediately. In such cases, this field will be 0 and the relevant message will be unusable until it is actually sent. MessageID int64 `json:"message_id"` } @@ -637,13 +681,13 @@ func UnmarshalMaybeInaccessibleMessage(data []byte) (MaybeInaccessibleMessage, e // This object represents one special entity in a text message. For example, hashtags, usernames, URLs, etc. type MessageEntity struct { - // Type of the entity. Currently, can be “mention” (@username), “hashtag” (#hashtag or #hashtag@chatusername), “cashtag” ($USD or $USD@chatusername), “bot_command” (/start@jobs_bot), “url” (https://telegram.org), “email” (do-not-reply@telegram.org), “phone_number” (+1-212-555-0123), “bold” (bold text), “italic” (italic text), “underline” (underlined text), “strikethrough” (strikethrough text), “spoiler” (spoiler message), “blockquote” (block quotation), “expandable_blockquote” (collapsed-by-default block quotation), “code” (monowidth string), “pre” (monowidth block), “text_link” (for clickable text URLs), “text_mention” (for users without usernames), “custom_emoji” (for inline custom emoji stickers), or “date_time” (for formatted date and time). + // Type of the entity. Currently, can be “mention” (@username), “hashtag” (#hashtag or #hashtag@chatusername), “cashtag” ($USD or $USD@chatusername), “bot_command” (/start@jobs_bot), “url” (https://telegram.org), “email” (do-not-reply@telegram.org), “phone_number” (+1-212-555-0123), “bank_card_number” (bank card number), “ton_address” (address in the TON blockchain), “bold” (bold text), “italic” (italic text), “underline” (underlined text), “strikethrough” (strikethrough text), “spoiler” (spoiler message), “blockquote” (block quotation), “expandable_blockquote” (collapsed-by-default block quotation), “code” (monowidth string), “pre” (monowidth block), “text_link” (for clickable text URLs), “text_mention” (for users without usernames), “custom_emoji” (for inline custom emoji stickers), or “date_time” (for formatted date and time). Type MessageEntityType `json:"type"` // Offset in UTF-16 code units to the start of the entity Offset int64 `json:"offset"` // Length of the entity in UTF-16 code units Length int64 `json:"length"` - // Optional. For “text_link” only, URL that will be opened after user taps on the text + // Optional. For “text_link” only, URL that will be opened after the user taps on the text URL string `json:"url,omitempty"` // Optional. For “text_mention” only, the mentioned user User *User `json:"user,omitempty"` @@ -659,16 +703,50 @@ type MessageEntity struct { // This object contains information about the quoted part of a message that is replied to by the given message. type TextQuote struct { - // Text of the quoted part of a message that is replied to by the given message + // Text of the quoted part of a message that is replied to by the given message; may be empty if the quote was chosen from a rich message Text string `json:"text"` // Optional. Special entities that appear in the quote. Currently, only bold, italic, underline, strikethrough, spoiler, custom_emoji, and date_time entities are kept in quotes. Entities []MessageEntity `json:"entities,omitempty"` - // Approximate quote position in the original message in UTF-16 code units as specified by the sender + // Optional. Rich text of the quote if it was chosen from a rich message. May contain only plain text, RichTextBold, RichTextItalic, RichTextUnderline, RichTextStrikethrough, RichTextSpoiler, RichTextSubscript, RichTextSuperscript, RichTextDateTime, RichTextCustomEmoji, RichTextMathematicalExpression, and arrays of them. + RichTexts []RichText `json:"rich_texts,omitempty"` + // Approximate quote position in the original message in UTF-16 code units as specified by the sender. For quotes from rich messages, it is the position in the text formed by joining plain texts of all quotable texts of the message, separated by line feeds. Position int64 `json:"position"` // Optional. True, if the quote was chosen manually by the message sender. Otherwise, the quote was added automatically by the server. IsManual *bool `json:"is_manual,omitempty"` } +// UnmarshalJSON decodes TextQuote by dispatching union-typed fields +// (RichTexts) through their concrete UnmarshalXxx helpers. +func (m *TextQuote) UnmarshalJSON(data []byte) error { + type Alias TextQuote + aux := &struct { + RichTexts json.RawMessage `json:"rich_texts,omitempty"` + *Alias + }{Alias: (*Alias)(m)} + if err := json.Unmarshal(data, aux); err != nil { + return err + } + + if len(aux.RichTexts) > 0 && string(aux.RichTexts) != "null" { + var raws []json.RawMessage + if err := json.Unmarshal(aux.RichTexts, &raws); err != nil { + return fmt.Errorf("decoding rich_texts: %w", err) + } + decoded := make([]RichText, 0, len(raws)) + for i, r := range raws { + v, err := UnmarshalRichText(r) + if err != nil { + return fmt.Errorf("decoding rich_texts[%d]: %w", i, err) + } + decoded = append(decoded, v) + } + m.RichTexts = decoded + + } + + return nil +} + // This object contains information about a message that is being replied to, which may come from another chat or forum topic. type ExternalReplyInfo struct { // Origin of the message replied to by the given message @@ -701,6 +779,8 @@ type ExternalReplyInfo struct { VideoNote *VideoNote `json:"video_note,omitempty"` // Optional. Message is a voice message, information about the file Voice *Voice `json:"voice,omitempty"` + // Optional. Message is an HTML widget, information about the widget + Widget *Widget `json:"widget,omitempty"` // Optional. True, if the message media is covered by a spoiler animation HasMediaSpoiler *bool `json:"has_media_spoiler,omitempty"` // Optional. Message is a checklist @@ -753,7 +833,7 @@ func (m *ExternalReplyInfo) UnmarshalJSON(data []byte) error { type ReplyParameters struct { // Optional. Identifier of the message that will be replied to in the current chat, or in the chat chat_id if it is specified. Required if ephemeral_message_id isn't specified. MessageID *int64 `json:"message_id,omitempty"` - // Optional. If the message to be replied to is from a different chat, unique identifier for the chat or username of the bot, supergroup or channel in the format @username. Not supported for messages sent on behalf of a business account, messages from channel direct messages chats and ephemeral messages. + // Optional. If the message to be replied to is from a different chat, unique identifier for the chat or username of the bot, supergroup, or channel in the format @username. Not supported for messages sent on behalf of a business account, messages from channel direct messages chats and ephemeral messages. ChatID *ChatID `json:"chat_id,omitempty"` // Optional. Identifier of the incoming ephemeral message that will be replied to in the current chat. A reply to an ephemeral message must itself be an ephemeral message. An ephemeral message may only be replied to within 15 seconds of being sent. Required if message_id isn't specified. EphemeralMessageID *int64 `json:"ephemeral_message_id,omitempty"` @@ -765,7 +845,9 @@ type ReplyParameters struct { QuoteParseMode ParseMode `json:"quote_parse_mode,omitempty"` // Optional. A JSON-serialized list of special entities that appear in the quote. It can be specified instead of quote_parse_mode. QuoteEntities []MessageEntity `json:"quote_entities,omitempty"` - // Optional. Position of the quote in the original message in UTF-16 code units + // Optional. A JSON-serialized list of quoted parts of the rich message to be replied to. Must contain one element for each quoted text of the message in the order of their appearance. Each of the following is a separate quoted text: the text of a paragraph, a heading, a preformatted block, a footer, or a mathematical expression; the text and the credit of a block quotation or a pull quotation; the summary of a details block; the caption and each cell of a table; the text and the credit of a caption of a media block, a collage, a slideshow, or a map. Texts of blocks nested in lists, block quotations, details, collages, and slideshows are separate quoted texts too. The first and the last elements can contain only a part of the corresponding text; all other elements must contain the whole text. Formatting of the quoted parts must be kept, and rich texts must be nested in the same way as in the message received from the server. Mathematical expressions must be quoted entirely. Buttons in RichBlockButtons, anchors and dividers can't be quoted. Up to 32 quoted texts with a total length of up to 1024 characters can be specified. Only plain text, RichTextBold, RichTextItalic, RichTextUnderline, RichTextStrikethrough, RichTextSpoiler, RichTextSubscript, RichTextSuperscript, RichTextDateTime, RichTextCustomEmoji, RichTextMathematicalExpression, and arrays of them are kept in the quote; other rich text types are replaced with their text. If non-empty, then quote, quote_parse_mode and quote_entities are ignored. + QuoteRichTexts []RichText `json:"quote_rich_texts,omitempty"` + // Optional. Position of the quote in the original message in UTF-16 code units. For quotes from rich messages, it is the position in the text formed by joining plain texts of all quotable texts of the message, separated by line feeds. QuotePosition *int64 `json:"quote_position,omitempty"` // Optional. Identifier of the specific checklist task to be replied to ChecklistTaskID *int64 `json:"checklist_task_id,omitempty"` @@ -773,10 +855,43 @@ type ReplyParameters struct { PollOptionID string `json:"poll_option_id,omitempty"` } +// UnmarshalJSON decodes ReplyParameters by dispatching union-typed fields +// (QuoteRichTexts) through their concrete UnmarshalXxx helpers. +func (m *ReplyParameters) UnmarshalJSON(data []byte) error { + type Alias ReplyParameters + aux := &struct { + QuoteRichTexts json.RawMessage `json:"quote_rich_texts,omitempty"` + *Alias + }{Alias: (*Alias)(m)} + if err := json.Unmarshal(data, aux); err != nil { + return err + } + + if len(aux.QuoteRichTexts) > 0 && string(aux.QuoteRichTexts) != "null" { + var raws []json.RawMessage + if err := json.Unmarshal(aux.QuoteRichTexts, &raws); err != nil { + return fmt.Errorf("decoding quote_rich_texts: %w", err) + } + decoded := make([]RichText, 0, len(raws)) + for i, r := range raws { + v, err := UnmarshalRichText(r) + if err != nil { + return fmt.Errorf("decoding quote_rich_texts[%d]: %w", i, err) + } + decoded = append(decoded, v) + } + m.QuoteRichTexts = decoded + + } + + return nil +} + +// Describes the parameters of an ephemeral message to be sent. type EphemeralMessageParameters struct { - // Identifier of the user who will receive the message. It is not guaranteed that the user will receive the message, especially if they are offline. See here for more details. - ReceiverUserID int64 `json:"receiver_user_id"` - // Optional. Identifier of the callback query which triggered the message, if any + // Optional. Identifier of the user who will receive the message; required unless the message is sent as an ephemeral reply to a callback query. If omitted, then the parameter chat_id of the method is ignored. If specified together with callback_query_id, then it must be the identifier of the user who pressed the button. Must be omitted for messages sent in chats where the bot isn't a member, unless the message is a reply to an ephemeral message. It is not guaranteed that the user will receive the message, especially if they are offline. See here for more details. + ReceiverUserID *int64 `json:"receiver_user_id,omitempty"` + // Optional. Identifier of the callback query which triggered the message, if any. If specified and receiver_user_id is omitted, then the message is sent as an ephemeral reply to the callback query and will be shown only to the user who pressed the button. Ephemeral replies can't be sent to callback queries from messages in channel direct messages chats. The bot must still answer the callback query using answerCallbackQuery. CallbackQueryID string `json:"callback_query_id,omitempty"` // Optional. Pass True if the ephemeral message must be shown in place of the original message. Must be False for callback queries from ephemeral messages, which must be edited using regular editEphemeralMessage… methods. ReplaceCallbackQueryMessage *bool `json:"replace_callback_query_message,omitempty"` @@ -974,7 +1089,7 @@ type Animation struct { FileName string `json:"file_name,omitempty"` // Optional. MIME type of the file as defined by the sender MimeType string `json:"mime_type,omitempty"` - // Optional. File size in bytes. It can be bigger than 2^31 and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a signed 64-bit integer or double-precision float type are safe for storing this value. + // Optional. File size in bytes. It can be bigger than 2^31 and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a signed 64-bit integer or double-precision float type is safe for storing this value. FileSize *int64 `json:"file_size,omitempty"` } @@ -994,7 +1109,7 @@ type Audio struct { FileName string `json:"file_name,omitempty"` // Optional. MIME type of the file as defined by the sender MimeType string `json:"mime_type,omitempty"` - // Optional. File size in bytes. It can be bigger than 2^31 and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a signed 64-bit integer or double-precision float type are safe for storing this value. + // Optional. File size in bytes. It can be bigger than 2^31 and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a signed 64-bit integer or double-precision float type is safe for storing this value. FileSize *int64 `json:"file_size,omitempty"` // Optional. Thumbnail of the album cover to which the music file belongs Thumbnail *PhotoSize `json:"thumbnail,omitempty"` @@ -1012,7 +1127,7 @@ type Document struct { FileName string `json:"file_name,omitempty"` // Optional. MIME type of the file as defined by the sender MimeType string `json:"mime_type,omitempty"` - // Optional. File size in bytes. It can be bigger than 2^31 and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a signed 64-bit integer or double-precision float type are safe for storing this value. + // Optional. File size in bytes. It can be bigger than 2^31 and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a signed 64-bit integer or double-precision float type is safe for storing this value. FileSize *int64 `json:"file_size,omitempty"` } @@ -1020,9 +1135,9 @@ type Document struct { type LivePhoto struct { // Optional. Available sizes of the corresponding static photo Photo []PhotoSize `json:"photo,omitempty"` - // Identifier for the video file which can be used to download or reuse the file + // Identifier for the video file, which can be used to download or reuse the file FileID string `json:"file_id"` - // Unique identifier for the video file which is supposed to be the same over time and for different bots. Can't be used to download or reuse the file. + // Unique identifier for the video file, which is supposed to be the same over time and for different bots. Can't be used to download or reuse the file. FileUniqueID string `json:"file_unique_id"` // Video width as defined by the sender Width int64 `json:"width"` @@ -1032,7 +1147,7 @@ type LivePhoto struct { Duration int64 `json:"duration"` // Optional. MIME type of the file as defined by the sender MimeType string `json:"mime_type,omitempty"` - // Optional. File size in bytes. It can be bigger than 2^31 and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a signed 64-bit integer or double-precision float type are safe for storing this value. + // Optional. File size in bytes. It can be bigger than 2^31 and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a signed 64-bit integer or double-precision float type is safe for storing this value. FileSize *int64 `json:"file_size,omitempty"` } @@ -1056,7 +1171,7 @@ type VideoQuality struct { Height int64 `json:"height"` // Codec that was used to encode the video, for example, “h264”, “h265”, or “av01” Codec string `json:"codec"` - // Optional. File size in bytes. It can be bigger than 2^31 and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a signed 64-bit integer or double-precision float type are safe for storing this value. + // Optional. File size in bytes. It can be bigger than 2^31 and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a signed 64-bit integer or double-precision float type is safe for storing this value. FileSize *int64 `json:"file_size,omitempty"` } @@ -1084,7 +1199,7 @@ type Video struct { FileName string `json:"file_name,omitempty"` // Optional. MIME type of the file as defined by the sender MimeType string `json:"mime_type,omitempty"` - // Optional. File size in bytes. It can be bigger than 2^31 and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a signed 64-bit integer or double-precision float type are safe for storing this value. + // Optional. File size in bytes. It can be bigger than 2^31 and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a signed 64-bit integer or double-precision float type is safe for storing this value. FileSize *int64 `json:"file_size,omitempty"` } @@ -1114,10 +1229,26 @@ type Voice struct { Duration int64 `json:"duration"` // Optional. MIME type of the file as defined by the sender MimeType string `json:"mime_type,omitempty"` - // Optional. File size in bytes. It can be bigger than 2^31 and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a signed 64-bit integer or double-precision float type are safe for storing this value. + // Optional. File size in bytes. It can be bigger than 2^31 and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a signed 64-bit integer or double-precision float type is safe for storing this value. FileSize *int64 `json:"file_size,omitempty"` } +// This object describes an HTML widget. +type Widget struct { + // Optional. Unique identifier of the shared widget, which can be used to send the widget again using the method sendSharedWidget; omitted if the widget isn't shared + ID string `json:"id,omitempty"` + // Optional. Width of the widget in logical pixels; omitted if the widget must occupy the whole width of the message bubble + Width *int64 `json:"width,omitempty"` + // Optional. Height of the widget in logical pixels; omitted if the height of the widget isn't fixed + Height *int64 `json:"height,omitempty"` + // HTML code of the widget + HTML string `json:"html"` + // Optional. Public data of the widget, which is available wherever the widget is shown. All messages with a shared widget have the same public data. + PublicData string `json:"public_data,omitempty"` + // Optional. Data of the widget, which is specific to the message + ChatData string `json:"chat_data,omitempty"` +} + // Describes the paid media added to a message. type PaidMediaInfo struct { // The number of Telegram Stars that must be paid to buy access to the media @@ -1314,7 +1445,7 @@ type Contact struct { FirstName string `json:"first_name"` // Optional. Contact's last name LastName string `json:"last_name,omitempty"` - // Optional. Contact's user identifier in Telegram. This number may have more than 32 significant bits and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a 64-bit integer or double-precision float type are safe for storing this identifier. + // Optional. Contact's user identifier in Telegram. This number may have more than 32 significant bits and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a 64-bit integer or double-precision float type is safe for storing this identifier. UserID *int64 `json:"user_id,omitempty"` // Optional. Additional data about the contact in the form of a vCard Vcard string `json:"vcard,omitempty"` @@ -1596,9 +1727,9 @@ type Poll struct { Type PollType `json:"type"` // True, if the poll allows multiple answers AllowsMultipleAnswers bool `json:"allows_multiple_answers"` - // True, if the poll allows to change the chosen answer options + // True, if the poll allows changing the chosen answer options AllowsRevoting bool `json:"allows_revoting"` - // True if voting is limited to users who have been members of the chat where the poll was originally sent for more than 24 hours + // True, if voting is limited to users who have been members of the chat where the poll was originally sent for more than 24 hours MembersOnly bool `json:"members_only"` // Optional. A list of two-letter ISO 3166-1 alpha-2 country codes indicating the countries from which users can vote in the poll. The country code “FT” is used for users with anonymous numbers. If omitted, then users from any country can participate in the poll. CountryCodes []string `json:"country_codes,omitempty"` @@ -1690,7 +1821,7 @@ type Location struct { HorizontalAccuracy *float64 `json:"horizontal_accuracy,omitempty"` // Optional. Time relative to the message sending date, during which the location can be updated; in seconds. For active live locations only. LivePeriod *int64 `json:"live_period,omitempty"` - // Optional. The direction in which user is moving, in degrees; 1-360. For active live locations only. + // Optional. The direction in which the user is moving, in degrees; 1-360. For active live locations only. Heading *int64 `json:"heading,omitempty"` // Optional. The maximum distance for proximity alerts about approaching another chat member, in meters. For sent live locations only. ProximityAlertRadius *int64 `json:"proximity_alert_radius,omitempty"` @@ -1748,7 +1879,7 @@ type ManagedBotCreated struct { type ManagedBotUpdated struct { // User that created the bot User User `json:"user"` - // Information about the bot. Token of the bot can be fetched using the method getManagedBotToken. + // Information about the bot. The token of the bot can be fetched using the method getManagedBotToken. Bot User `json:"bot"` } @@ -2272,11 +2403,11 @@ type ForumTopicEdited struct { type ForumTopicReopened struct { } -// This object represents a service message about General forum topic hidden in the chat. Currently holds no information. +// This object represents a service message about the General forum topic hidden in the chat. Currently holds no information. type GeneralForumTopicHidden struct { } -// This object represents a service message about General forum topic unhidden in the chat. Currently holds no information. +// This object represents a service message about the General forum topic unhidden in the chat. Currently holds no information. type GeneralForumTopicUnhidden struct { } @@ -2306,7 +2437,7 @@ type UsersShared struct { type ChatShared struct { // Identifier of the request RequestID int64 `json:"request_id"` - // Identifier of the shared chat. This number may have more than 32 significant bits and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a 64-bit integer or double-precision float type are safe for storing this identifier. The bot may not have access to the chat and could be unable to use this identifier, unless the chat is already known to the bot by some other means. + // Identifier of the shared chat. This number may have more than 32 significant bits and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a 64-bit integer or double-precision float type is safe for storing this identifier. The bot may not have access to the chat and could be unable to use this identifier, unless the chat is already known to the bot by some other means. ChatID int64 `json:"chat_id"` // Optional. Title of the chat, if the title was requested by the bot Title string `json:"title,omitempty"` @@ -2316,7 +2447,7 @@ type ChatShared struct { Photo []PhotoSize `json:"photo,omitempty"` } -// This 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 method requestWriteAccess. +// This 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 method requestWriteAccess, or about a user being invited to the private chat with the bot by the owner of the bot. type WriteAccessAllowed struct { // Optional. True, if the access was granted after the user accepted an explicit request from a Web App sent by the method requestWriteAccess FromRequest *bool `json:"from_request,omitempty"` @@ -2324,6 +2455,8 @@ type WriteAccessAllowed struct { WebAppName string `json:"web_app_name,omitempty"` // Optional. True, if the access was granted when the bot was added to the attachment or side menu FromAttachmentMenu *bool `json:"from_attachment_menu,omitempty"` + // Optional. The owner of the bot, if the access was granted when the owner invited the user to the private chat with the bot. Bot owners can invite up to 10 users at once by pressing the link https://t.me/botinvite/. + Inviter *User `json:"inviter,omitempty"` } // This object represents a service message about a video chat scheduled in the chat. @@ -2408,6 +2541,22 @@ type SuggestedPostRefunded struct { Reason SuggestedPostRefundedReason `json:"reason"` } +// Describes 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. +type PaidMessagesWaived struct { +} + +// Describes a service message about a transfer with a TON wallet. +type TonWalletTransfer struct { + // Unique identifier of the transaction; may be empty if the transfer hasn't been sent yet + TransactionID string `json:"transaction_id"` + // Address of the transfer peer in the TON blockchain + PeerAddress string `json:"peer_address"` + // The amount of transferred cryptocurrency, in the smallest units of the cryptocurrency, as a decimal number; negative for outgoing transfers + Amount string `json:"amount"` + // Optional. Comment added to the transfer; omitted if the comment is encrypted + Comment string `json:"comment,omitempty"` +} + // This object represents a service message about the creation of a scheduled giveaway. type GiveawayCreated struct { // Optional. The number of Telegram Stars to be split between giveaway winners; for Telegram Star giveaways only @@ -2420,13 +2569,13 @@ type Giveaway struct { Chats []Chat `json:"chats"` // Point in time (Unix timestamp) when winners of the giveaway will be selected WinnersSelectionDate int64 `json:"winners_selection_date"` - // The number of users which are supposed to be selected as winners of the giveaway + // The number of users who are supposed to be selected as winners of the giveaway WinnerCount int64 `json:"winner_count"` // Optional. True, if only users who join the chats after the giveaway started should be eligible to win OnlyNewMembers *bool `json:"only_new_members,omitempty"` // Optional. True, if the list of giveaway winners will be visible to everyone HasPublicWinners *bool `json:"has_public_winners,omitempty"` - // Optional. Description of additional giveaway prize + // Optional. Description of an additional giveaway prize PrizeDescription string `json:"prize_description,omitempty"` // Optional. A list of two-letter ISO 3166-1 alpha-2 country codes indicating the countries from which eligible users for the giveaway must come. If empty, then all users can participate in the giveaway. Users with a phone number that was bought on Fragment can always participate in giveaways. CountryCodes []string `json:"country_codes,omitempty"` @@ -2460,7 +2609,7 @@ type GiveawayWinners struct { OnlyNewMembers *bool `json:"only_new_members,omitempty"` // Optional. True, if the giveaway was canceled because the payment for it was refunded WasRefunded *bool `json:"was_refunded,omitempty"` - // Optional. Description of additional giveaway prize + // Optional. Description of an additional giveaway prize PrizeDescription string `json:"prize_description,omitempty"` } @@ -2512,19 +2661,19 @@ type SuggestedPostInfo struct { type SuggestedPostParameters struct { // Optional. Proposed price for the post. If the field is omitted, then the post is unpaid. Price *SuggestedPostPrice `json:"price,omitempty"` - // Optional. Proposed send date of the post. If specified, then the date must be between 300 second and 2678400 seconds (30 days) in the future. If the field is omitted, then the post can be published at any time within 30 days at the sole discretion of the user who approves it. + // Optional. Proposed send date of the post. If specified, then the date must be between 300 seconds and 2678400 seconds (30 days) in the future. If the field is omitted, then the post can be published at any time within 30 days at the sole discretion of the user who approves it. SendDate *int64 `json:"send_date,omitempty"` } // Describes a topic of a direct messages chat. type DirectMessagesTopic struct { - // Unique identifier of the topic. This number may have more than 32 significant bits and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a 64-bit integer or double-precision float type are safe for storing this identifier. + // Unique identifier of the topic. This number may have more than 32 significant bits and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a 64-bit integer or double-precision float type is safe for storing this identifier. TopicID int64 `json:"topic_id"` // Optional. Information about the user that created the topic. Currently, it is always present. User *User `json:"user,omitempty"` } -// This object represent a user's profile pictures. +// This object represents a user's profile pictures. type UserProfilePhotos struct { // Total number of profile pictures the target user has TotalCount int64 `json:"total_count"` @@ -2547,7 +2696,7 @@ type File struct { FileID string `json:"file_id"` // Unique identifier for this file, which is supposed to be the same over time and for different bots. Can't be used to download or reuse the file. FileUniqueID string `json:"file_unique_id"` - // Optional. File size in bytes. It can be bigger than 2^31 and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a signed 64-bit integer or double-precision float type are safe for storing this value. + // Optional. File size in bytes. It can be bigger than 2^31 and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a signed 64-bit integer or double-precision float type is safe for storing this value. FileSize *int64 `json:"file_size,omitempty"` // Optional. File path. Use https://api.telegram.org/file/bot/ to get the file. FilePath string `json:"file_path,omitempty"` @@ -2571,7 +2720,7 @@ type ReplyKeyboardMarkup struct { OneTimeKeyboard *bool `json:"one_time_keyboard,omitempty"` // Optional. The placeholder to be shown in the input field when the keyboard is active; 1-64 characters InputFieldPlaceholder string `json:"input_field_placeholder,omitempty"` - // Optional. Use this parameter if you want to show the keyboard to specific users only. Targets: 1) users that are @mentioned in the text of the Message object; 2) if the bot's message is a reply to a message in the same chat and forum topic, sender of the original message.Example: A user requests to change the bot's language, bot replies to the request with a keyboard to select the new language. Other users in the group don't see the keyboard. + // Optional. Use this parameter if you want to show the keyboard to specific users only. Targets: 1) users that are @mentioned in the text of the Message object; 2) if the bot's message is a reply to a message in the same chat and forum topic, sender of the original message.Example: A user requests to change the bot's language, and the bot replies to the request with a keyboard to select the new language. Other users in the group don't see the keyboard. Selective *bool `json:"selective,omitempty"` // Optional. Pass True if the reply interface must be shown to the user, as if they had manually selected the bot's message and tapped 'Reply' ForceReply *bool `json:"force_reply,omitempty"` @@ -2589,7 +2738,7 @@ type KeyboardButton struct { RequestUsers *KeyboardButtonRequestUsers `json:"request_users,omitempty"` // Optional. If specified, pressing the button will open a list of suitable chats. Tapping on a chat will send its identifier to the bot in a “chat_shared” service message. Available in private chats only. RequestChat *KeyboardButtonRequestChat `json:"request_chat,omitempty"` - // Optional. If specified, pressing the button will ask the user to create and share a bot that will be managed by the current bot. Available for bots that enabled management of other bots in the @BotFather Mini App. Available in private chats only. + // Optional. If specified, pressing the button will ask the user to create and share a bot that will be managed by the current bot. Available for bots that enabled management of other bots in the @BotFather Mini App or using the parameter can_manage_bots of the method setMySettings. Available in private chats only. RequestManagedBot *KeyboardButtonRequestManagedBot `json:"request_managed_bot,omitempty"` // Optional. If True, the user's phone number will be sent as a contact when the button is pressed. Available in private chats only. RequestContact *bool `json:"request_contact,omitempty"` @@ -2619,7 +2768,7 @@ type KeyboardButtonRequestUsers struct { RequestPhoto *bool `json:"request_photo,omitempty"` } -// This 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 chat if appropriate. More about requesting chats ». +// This 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 the requested rights in the chat if appropriate. More about requesting chats ». type KeyboardButtonRequestChat struct { // Signed 32-bit identifier of the request, which will be received back in the ChatShared object. Must be unique within the message. RequestID int64 `json:"request_id"` @@ -2651,11 +2800,11 @@ type KeyboardButtonRequestManagedBot struct { RequestID int64 `json:"request_id"` // Optional. Suggested name for the bot SuggestedName string `json:"suggested_name,omitempty"` - // Optional. Suggested username for the bot + // Optional. Suggested username for the bot. The username must end with “bot”. If the user creating the bot has a Telegram Premium subscription, then the username can also end with “agent”, “ai”, “app”, “game”, or “gay”; in this case, the username will be assigned to the bot as a secondary username, and a regular username ending with “bot” will be assigned to the bot automatically. SuggestedUsername string `json:"suggested_username,omitempty"` } -// This object represents type of a poll, which is allowed to be created and sent when the corresponding button is pressed. +// This object represents the type of a poll, which is allowed to be created and sent when the corresponding button is pressed. type KeyboardButtonPollType struct { // Optional. If quiz is passed, the user will be allowed to create only polls in the quiz mode. If regular is passed, only regular polls will be allowed. Otherwise, the user will be allowed to create a poll of any type. Type string `json:"type,omitempty"` @@ -2663,9 +2812,9 @@ type KeyboardButtonPollType struct { // Upon 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 bot. An exception is made for one-time keyboards that are hidden immediately after the user presses a button (see ReplyKeyboardMarkup). Not supported in channels and for messages sent on behalf of a business account. type ReplyKeyboardRemove struct { - // Requests clients to remove the custom keyboard (user will not be able to summon this keyboard; if you want to hide the keyboard from sight but keep it accessible, use one_time_keyboard in ReplyKeyboardMarkup) + // Requests clients to remove the custom keyboard (the user will not be able to summon this keyboard; if you want to hide the keyboard from sight but keep it accessible, use one_time_keyboard in ReplyKeyboardMarkup) RemoveKeyboard bool `json:"remove_keyboard"` - // Optional. Use this parameter if you want to remove the keyboard for specific users only. Targets: 1) users that are @mentioned in the text of the Message object; 2) if the bot's message is a reply to a message in the same chat and forum topic, sender of the original message.Example: A user votes in a poll, bot returns confirmation message in reply to the vote and removes the keyboard for that user, while still showing the keyboard with poll options to users who haven't voted yet. + // Optional. Use this parameter if you want to remove the keyboard for specific users only. Targets: 1) users that are @mentioned in the text of the Message object; 2) if the bot's message is a reply to a message in the same chat and forum topic, sender of the original message.Example: A user votes in a poll, and the bot returns a confirmation message in reply to the vote and removes the keyboard for that user, while still showing the keyboard with poll options to users who haven't voted yet. Selective *bool `json:"selective,omitempty"` } @@ -2689,7 +2838,7 @@ type InlineKeyboardButton struct { URL string `json:"url,omitempty"` // Optional. Data to be sent in a callback query to the bot when the button is pressed, 1-64 bytes CallbackData string `json:"callback_data,omitempty"` - // Optional. Description of the Web App that will be launched when the user presses the button. The Web App will be able to send an arbitrary message on behalf of the user using the method answerWebAppQuery. Available only in private chats between a user and the bot. Not supported for messages sent on behalf of a business account. + // Optional. Description of the Web App that will be launched when the user presses the button. The Web App will be able to send an arbitrary message on behalf of the user using the method answerWebAppQuery. Available only in private chats between a user and the bot. Not supported for messages sent on behalf of a business account and ephemeral messages. WebApp *WebAppInfo `json:"web_app,omitempty"` // Optional. An HTTPS URL used to automatically authorize the user. Can be used as a replacement for the Telegram Login Widget. Not supported for ephemeral messages. LoginURL *LoginUrl `json:"login_url,omitempty"` @@ -2703,7 +2852,7 @@ type InlineKeyboardButton struct { CopyText *CopyTextButton `json:"copy_text,omitempty"` // Optional. Description of the game that will be launched when the user presses the button.NOTE: This type of button must always be the first button in the first row. CallbackGame *CallbackGame `json:"callback_game,omitempty"` - // Optional. Specify True, to send a Pay button. Substrings “” and “XTR” in the buttons's text will be replaced with a Telegram Star icon.NOTE: This type of button must always be the first button in the first row and can only be used in invoice messages. + // Optional. Specify True to send a Pay button. Substrings “” and “XTR” in the button's text will be replaced with a Telegram Star icon.NOTE: This type of button must always be the first button in the first row and can only be used in invoice messages. Pay *bool `json:"pay,omitempty"` // Optional. If set, then the button is disabled and does nothing Disabled *DisabledButton `json:"disabled,omitempty"` @@ -2746,7 +2895,7 @@ type CopyTextButton struct { type DisabledButton struct { } -// This 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 the button was attached to a message sent via the bot (in inline mode), the field inline_message_id will be present. Exactly one of the fields data or game_short_name will be present. +// This object represents an incoming callback query from a callback button in an inline keyboard or in a rich message. If the button that originated the query belongs to a message sent by the bot, the field message will be present, unless the field inline_message_id is used instead as specified by the parameter callback_query_mode of the method setMySettings. If the button belongs to a message sent via the bot (in inline mode), the field inline_message_id will be present. Exactly one of the fields data or game_short_name will be present. // NOTE: After the user presses a callback button, Telegram clients will display a progress bar until you call answerCallbackQuery. It is, therefore, necessary to react by calling answerCallbackQuery even if no notification to the user is needed (e.g., without specifying any of the optional parameters). type CallbackQuery struct { // Unique identifier for this query @@ -2755,11 +2904,11 @@ type CallbackQuery struct { From User `json:"from"` // Optional. Message sent by the bot with the callback button that originated the query Message MaybeInaccessibleMessage `json:"message,omitempty"` - // Optional. Identifier of the message sent via the bot in inline mode, that originated the query + // Optional. Identifier of the message sent via the bot in inline mode, that originated the query. Can also be present for messages sent by the bot, depending on the parameter callback_query_mode of the method setMySettings. InlineMessageID string `json:"inline_message_id,omitempty"` // Global identifier, uniquely corresponding to the chat to which the message with the callback button was sent. Useful for high scores in games. ChatInstance string `json:"chat_instance"` - // Optional. Data associated with the callback button. Be aware that the message originated the query can contain no callback buttons with this data. + // Optional. Data associated with the callback button. Be aware that the message that originated the query can contain no callback buttons with this data. Data string `json:"data,omitempty"` // Optional. Short name of a Game to be returned, serves as the unique identifier for the game GameShortName string `json:"game_short_name,omitempty"` @@ -2789,7 +2938,225 @@ func (m *CallbackQuery) UnmarshalJSON(data []byte) error { return nil } -// Upon 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 create user-friendly step-by-step interfaces without having to sacrifice privacy mode. Not supported in channels and for messages sent on behalf of a user account. +// WidgetQueryType is a union type. The following concrete variants implement +// it: +// - WidgetQueryTypeData +// - WidgetQueryTypeSignData +// - WidgetQueryTypeSentTransaction +// +// This object describes the type of a query from a widget. Currently, it can be one of +type WidgetQueryType interface{ isWidgetQueryType() } + +// isWidgetQueryType is the marker method that makes WidgetQueryTypeData implement WidgetQueryType. +func (*WidgetQueryTypeData) isWidgetQueryType() {} + +// isWidgetQueryType is the marker method that makes WidgetQueryTypeSignData implement WidgetQueryType. +func (*WidgetQueryTypeSignData) isWidgetQueryType() {} + +// isWidgetQueryType is the marker method that makes WidgetQueryTypeSentTransaction implement WidgetQueryType. +func (*WidgetQueryTypeSentTransaction) isWidgetQueryType() {} + +// UnmarshalWidgetQueryType decodes a WidgetQueryType from JSON by inspecting the +// "type" field and dispatching to the correct concrete type. +func UnmarshalWidgetQueryType(data []byte) (WidgetQueryType, error) { + var probe struct { + V string `json:"type"` + } + if err := json.Unmarshal(data, &probe); err != nil { + return nil, err + } + var v WidgetQueryType + switch probe.V { + case "data": + v = &WidgetQueryTypeData{} + case "sent_transaction": + v = &WidgetQueryTypeSentTransaction{} + case "sign_data": + v = &WidgetQueryTypeSignData{} + default: + return nil, fmt.Errorf("WidgetQueryType: unknown type %q", probe.V) + } + if err := json.Unmarshal(data, v); err != nil { + return nil, err + } + return v, nil +} + +// The query contains data for the bot. +type WidgetQueryTypeData struct { + // Type of the query, always “data” + Type WidgetQueryTypeKind `json:"type"` + // Optional. TON wallet card of the user who sent the query, if it was sent to the bot along with the query + WalletCard *TonWalletCard `json:"wallet_card,omitempty"` +} + +// MarshalJSON encodes WidgetQueryTypeData with the discriminator field +// "type" forced to "data". +// The hardcoded value frees callers from setting Type by hand — +// any user-supplied value on the struct literal is overridden so a typo +// can't slip through to Telegram. +func (v *WidgetQueryTypeData) MarshalJSON() ([]byte, error) { + type alias WidgetQueryTypeData + return json.Marshal(&struct { + Type string `json:"type"` + *alias + }{ + Type: "data", + alias: (*alias)(v), + }) +} + +// The query contains data signed by a TON wallet of the user who sent the query. The data is signed for the domain bot, where is the identifier of the bot. +type WidgetQueryTypeSignData struct { + // Type of the query, always “sign_data” + Type WidgetQueryTypeKind `json:"type"` + // The wallet that signed the data + Wallet WidgetQueryWallet `json:"wallet"` + // JSON-serialized signed data + SignData string `json:"sign_data"` +} + +// MarshalJSON encodes WidgetQueryTypeSignData with the discriminator field +// "type" forced to "sign_data". +// The hardcoded value frees callers from setting Type by hand — +// any user-supplied value on the struct literal is overridden so a typo +// can't slip through to Telegram. +func (v *WidgetQueryTypeSignData) MarshalJSON() ([]byte, error) { + type alias WidgetQueryTypeSignData + return json.Marshal(&struct { + Type string `json:"type"` + *alias + }{ + Type: "sign_data", + alias: (*alias)(v), + }) +} + +// The query notifies the bot about a transaction sent from a TON wallet of the user who sent the query. +type WidgetQueryTypeSentTransaction struct { + // Type of the query, always “sent_transaction” + Type WidgetQueryTypeKind `json:"type"` + // The wallet from which the transaction was sent + Wallet WidgetQueryWallet `json:"wallet"` + // Value of msg_hash of the transaction + MsgHash string `json:"msg_hash"` +} + +// MarshalJSON encodes WidgetQueryTypeSentTransaction with the discriminator field +// "type" forced to "sent_transaction". +// The hardcoded value frees callers from setting Type by hand — +// any user-supplied value on the struct literal is overridden so a typo +// can't slip through to Telegram. +func (v *WidgetQueryTypeSentTransaction) MarshalJSON() ([]byte, error) { + type alias WidgetQueryTypeSentTransaction + return json.Marshal(&struct { + Type string `json:"type"` + *alias + }{ + Type: "sent_transaction", + alias: (*alias)(v), + }) +} + +// This object describes a TON wallet of the user, which is used in a query from a widget. +type WidgetQueryWallet struct { + // Address of the wallet + Address string `json:"address"` + // Balance of the wallet, in the smallest units of the cryptocurrency, as a decimal number + Amount string `json:"amount"` + // Optional. Hex-encoded public key of the wallet; omitted if unknown + PublicKey string `json:"public_key,omitempty"` + // Optional. Base64-encoded serialized StateInit of the wallet contract; omitted if and only if public_key is omitted + StateInit string `json:"state_init,omitempty"` +} + +// This 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 widgets. +type WidgetQuery struct { + // Unique identifier for this query + ID string `json:"id"` + // Sender + From User `json:"from"` + // Optional. Chat with the message containing the widget; omitted if the widget is in an inline message + Chat *Chat `json:"chat,omitempty"` + // Optional. Identifier of the message containing the widget; omitted if the widget is in an inline message + MessageID *int64 `json:"message_id,omitempty"` + // Optional. Identifier of the inline message containing the widget + InlineMessageID string `json:"inline_message_id,omitempty"` + // Global identifier, uniquely corresponding to the chat to which the message with the widget was sent + ChatInstance string `json:"chat_instance"` + // Optional. For widgets in inline messages, type of the chat to which the message was sent. Can be either “sender” for a private chat with the inline query sender, “private”, “group”, “supergroup”, or “channel”. + ChatType InlineQueryChatType `json:"chat_type,omitempty"` + // Type of the query + Type WidgetQueryType `json:"type"` + // Data of the query, 1-64 bytes + Data string `json:"data"` + // Optional. Unique identifier of the shared widget, which sent the query; omitted if the widget isn't shared + WidgetID string `json:"widget_id,omitempty"` +} + +// UnmarshalJSON decodes WidgetQuery by dispatching union-typed fields +// (Type) through their concrete UnmarshalXxx helpers. +func (m *WidgetQuery) UnmarshalJSON(data []byte) error { + type Alias WidgetQuery + aux := &struct { + Type json.RawMessage `json:"type,omitempty"` + *Alias + }{Alias: (*Alias)(m)} + if err := json.Unmarshal(data, aux); err != nil { + return err + } + + if len(aux.Type) > 0 && string(aux.Type) != "null" { + v, err := UnmarshalWidgetQueryType(aux.Type) + if err != nil { + return fmt.Errorf("decoding type: %w", err) + } + m.Type = v + + } + + return nil +} + +// This 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 all its widgets. +type SharedWidgetQuery struct { + // Unique identifier for this query + ID string `json:"id"` + // Sender + From User `json:"from"` + // Type of the query + Type WidgetQueryType `json:"type"` + // Data of the query, 1-64 bytes + Data string `json:"data"` + // Unique identifier of the shared widget, which sent the query + WidgetID string `json:"widget_id"` +} + +// UnmarshalJSON decodes SharedWidgetQuery by dispatching union-typed fields +// (Type) through their concrete UnmarshalXxx helpers. +func (m *SharedWidgetQuery) UnmarshalJSON(data []byte) error { + type Alias SharedWidgetQuery + aux := &struct { + Type json.RawMessage `json:"type,omitempty"` + *Alias + }{Alias: (*Alias)(m)} + if err := json.Unmarshal(data, aux); err != nil { + return err + } + + if len(aux.Type) > 0 && string(aux.Type) != "null" { + v, err := UnmarshalWidgetQueryType(aux.Type) + if err != nil { + return fmt.Errorf("decoding type: %w", err) + } + m.Type = v + + } + + return nil +} + +// Upon 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 create user-friendly step-by-step interfaces without having to sacrifice privacy mode. Not supported in channels and for messages sent on behalf of a business account. // Example: A poll bot for groups runs in privacy mode (only receives commands, replies to its messages and mentions). There could be two ways to create a new poll: // The last option is definitely more attractive. And if you use ForceReply in your bot's questions, it will receive the user's answers even if it only receives replies, commands and mentions - without any extra work for the user. type ForceReply struct { @@ -2803,7 +3170,7 @@ type ForceReply struct { // Represents a community (a group of chats). type Community struct { - // Unique identifier for this community. This number may have more than 32 significant bits and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a signed 64-bit integer or double-precision float type are safe for storing this identifier. + // Unique identifier for this community. This number may have more than 32 significant bits and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a signed 64-bit integer or double-precision float type is safe for storing this identifier. ID int64 `json:"id"` // Name of the community Name string `json:"name"` @@ -2835,7 +3202,7 @@ type ChatInviteLink struct { IsRevoked bool `json:"is_revoked"` // Optional. Invite link name Name string `json:"name,omitempty"` - // Optional. Point in time (Unix timestamp) when the link will expire or has been expired + // Optional. Point in time (Unix timestamp) when the link will expire or has expired ExpireDate *int64 `json:"expire_date,omitempty"` // Optional. The maximum number of users that can be members of the chat simultaneously after joining the chat via this invite link; 1-99999 MemberLimit *int64 `json:"member_limit,omitempty"` @@ -3149,7 +3516,7 @@ type ChatMemberRestricted struct { CanSendVoiceNotes bool `json:"can_send_voice_notes"` // True, if the user is allowed to send polls and checklists CanSendPolls bool `json:"can_send_polls"` - // True, if the user is allowed to send animations, games, stickers and use inline bots + // True, if the user is allowed to send animations, games, stickers, widgets and use inline bots CanSendOtherMessages bool `json:"can_send_other_messages"` // True, if the user is allowed to add web page previews to their messages CanAddWebPagePreviews bool `json:"can_add_web_page_previews"` @@ -3241,7 +3608,7 @@ type ChatJoinRequest struct { Chat Chat `json:"chat"` // User that sent the join request From User `json:"from"` - // Identifier of a private chat with the user who sent the join request. This number may have more than 32 significant bits and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a 64-bit integer or double-precision float type are safe for storing this identifier. The bot can use this identifier for 5 minutes to send messages until the join request is processed, assuming no other administrator contacted the user. + // Identifier of a private chat with the user who sent the join request. This number may have more than 32 significant bits and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a 64-bit integer or double-precision float type is safe for storing this identifier. The bot can use this identifier for 5 minutes to send messages until the join request is processed, assuming no other administrator contacted the user. UserChatID int64 `json:"user_chat_id"` // Date the request was sent in Unix time Date int64 `json:"date"` @@ -3271,7 +3638,7 @@ type ChatPermissions struct { CanSendVoiceNotes *bool `json:"can_send_voice_notes,omitempty"` // Optional. True, if the user is allowed to send polls and checklists CanSendPolls *bool `json:"can_send_polls,omitempty"` - // Optional. True, if the user is allowed to send animations, games, stickers and use inline bots + // Optional. True, if the user is allowed to send animations, games, stickers, widgets and use inline bots CanSendOtherMessages *bool `json:"can_send_other_messages,omitempty"` // Optional. True, if the user is allowed to add web page previews to their messages CanAddWebPagePreviews *bool `json:"can_add_web_page_previews,omitempty"` @@ -3333,9 +3700,9 @@ type BusinessOpeningHours struct { OpeningHours []BusinessOpeningHoursInterval `json:"opening_hours"` } -// This object describes the rating of a user based on their Telegram Star spendings. +// This object describes the rating of a user based on their Telegram Star spending. type UserRating struct { - // Current level of the user, indicating their reliability when purchasing digital goods and services. A higher level suggests a more trustworthy customer; a negative level is likely reason for concern. + // Current level of the user, indicating their reliability when purchasing digital goods and services. A higher level suggests a more trustworthy customer; a negative level is likely a reason for concern. Level int64 `json:"level"` // Numerical value of the user's rating; the higher the rating, the better Rating int64 `json:"rating"` @@ -3345,22 +3712,290 @@ type UserRating struct { NextLevelRating *int64 `json:"next_level_rating,omitempty"` } -// Describes the position of a clickable area within a story. -type StoryAreaPosition struct { - // The abscissa of the area's center, as a percentage of the media width +// Describes the position of a rectangle area on a story media or a TON wallet card. +type AreaPosition struct { + // The abscissa of the area's center, as a percentage of the media or the card width XPercentage float64 `json:"x_percentage"` - // The ordinate of the area's center, as a percentage of the media height + // The ordinate of the area's center, as a percentage of the media or the card height YPercentage float64 `json:"y_percentage"` - // The width of the area's rectangle, as a percentage of the media width + // The width of the area's rectangle, as a percentage of the media or the card width WidthPercentage float64 `json:"width_percentage"` - // The height of the area's rectangle, as a percentage of the media height + // The height of the area's rectangle, as a percentage of the media or the card height HeightPercentage float64 `json:"height_percentage"` // The clockwise rotation angle of the rectangle, in degrees; 0-360 RotationAngle float64 `json:"rotation_angle"` - // The radius of the rectangle corner rounding, as a percentage of the media width + // The radius of the rectangle corner rounding, as a percentage of the media or the card width CornerRadiusPercentage float64 `json:"corner_radius_percentage"` } +// This object represents an NFT in the TON blockchain. +type TonNft struct { + // Address of the NFT + Address string `json:"address"` + // Optional. Address of the collection to which the NFT belongs; omitted if unknown + CollectionAddress string `json:"collection_address,omitempty"` + // Index of the NFT among all NFTs from the collection as a decimal number + Index string `json:"index"` + // Name of the NFT + Name string `json:"name"` + // Description of the NFT + Description string `json:"description"` + // Optional. Attributes of the NFT + Attributes []TonNftAttribute `json:"attributes,omitempty"` + // Optional. The unique gift corresponding to the NFT + Gift *UniqueGift `json:"gift,omitempty"` +} + +// This object represents an attribute of an NFT in the TON blockchain. +type TonNftAttribute struct { + // Trait type of the attribute + TraitType string `json:"trait_type"` + // Value of the attribute + Value string `json:"value"` +} + +// This object describes a sticker on a TON wallet card. +type TonWalletCardSticker struct { + // Position of the sticker on the card + Position AreaPosition `json:"position"` + // The NFT shown as the sticker + Nft TonNft `json:"nft"` +} + +// This object describes a TON wallet card, which is shown on the profile page of a user to everyone. +type TonWalletCard struct { + // Address of the wallet + Address string `json:"address"` + // Balance of the wallet, in the smallest units of the cryptocurrency, as a decimal number + Amount string `json:"amount"` + // Stickers placed on the card + Stickers []TonWalletCardSticker `json:"stickers"` + // Optional. Address of the NFT of one of the stickers, whose colors must be used for the card background; omitted if the default background must be used + BackgroundNftAddress string `json:"background_nft_address,omitempty"` +} + +// EmojiType is a union type. The following concrete variants implement +// it: +// - EmojiTypeEmoji +// - EmojiTypeCustomEmoji +// +// This object describes an emoji. Currently, it can be one of +type EmojiType interface{ isEmojiType() } + +// isEmojiType is the marker method that makes EmojiTypeEmoji implement EmojiType. +func (*EmojiTypeEmoji) isEmojiType() {} + +// isEmojiType is the marker method that makes EmojiTypeCustomEmoji implement EmojiType. +func (*EmojiTypeCustomEmoji) isEmojiType() {} + +// UnmarshalEmojiType decodes a EmojiType from JSON by inspecting the +// "type" field and dispatching to the correct concrete type. +func UnmarshalEmojiType(data []byte) (EmojiType, error) { + var probe struct { + V string `json:"type"` + } + if err := json.Unmarshal(data, &probe); err != nil { + return nil, err + } + var v EmojiType + switch probe.V { + case "custom_emoji": + v = &EmojiTypeCustomEmoji{} + case "emoji": + v = &EmojiTypeEmoji{} + default: + return nil, fmt.Errorf("EmojiType: unknown type %q", probe.V) + } + if err := json.Unmarshal(data, v); err != nil { + return nil, err + } + return v, nil +} + +// A regular emoji. +type EmojiTypeEmoji struct { + // Type of the emoji, always “emoji” + Type EmojiTypeKind `json:"type"` + // The emoji + Emoji string `json:"emoji"` +} + +// MarshalJSON encodes EmojiTypeEmoji with the discriminator field +// "type" forced to "emoji". +// The hardcoded value frees callers from setting Type by hand — +// any user-supplied value on the struct literal is overridden so a typo +// can't slip through to Telegram. +func (v *EmojiTypeEmoji) MarshalJSON() ([]byte, error) { + type alias EmojiTypeEmoji + return json.Marshal(&struct { + Type string `json:"type"` + *alias + }{ + Type: "emoji", + alias: (*alias)(v), + }) +} + +// A custom emoji. +type EmojiTypeCustomEmoji struct { + // Type of the emoji, always “custom_emoji” + Type EmojiTypeKind `json:"type"` + // Identifier of the custom emoji. Use getCustomEmojiStickers to get full information about the sticker. + CustomEmojiID string `json:"custom_emoji_id"` +} + +// MarshalJSON encodes EmojiTypeCustomEmoji with the discriminator field +// "type" forced to "custom_emoji". +// The hardcoded value frees callers from setting Type by hand — +// any user-supplied value on the struct literal is overridden so a typo +// can't slip through to Telegram. +func (v *EmojiTypeCustomEmoji) MarshalJSON() ([]byte, error) { + type alias EmojiTypeCustomEmoji + return json.Marshal(&struct { + Type string `json:"type"` + *alias + }{ + Type: "custom_emoji", + alias: (*alias)(v), + }) +} + +// ChatShareTheme is a union type. The following concrete variants implement +// it: +// - ChatShareThemeEmoji +// - ChatShareThemeUniqueGift +// +// This object describes the theme of the screen for sharing a link to a user or a chat. Currently, it can be one of +type ChatShareTheme interface{ isChatShareTheme() } + +// isChatShareTheme is the marker method that makes ChatShareThemeEmoji implement ChatShareTheme. +func (*ChatShareThemeEmoji) isChatShareTheme() {} + +// isChatShareTheme is the marker method that makes ChatShareThemeUniqueGift implement ChatShareTheme. +func (*ChatShareThemeUniqueGift) isChatShareTheme() {} + +// UnmarshalChatShareTheme decodes a ChatShareTheme from JSON by inspecting the +// "type" field and dispatching to the correct concrete type. +func UnmarshalChatShareTheme(data []byte) (ChatShareTheme, error) { + var probe struct { + V string `json:"type"` + } + if err := json.Unmarshal(data, &probe); err != nil { + return nil, err + } + var v ChatShareTheme + switch probe.V { + case "emoji": + v = &ChatShareThemeEmoji{} + case "unique_gift": + v = &ChatShareThemeUniqueGift{} + default: + return nil, fmt.Errorf("ChatShareTheme: unknown type %q", probe.V) + } + if err := json.Unmarshal(data, v); err != nil { + return nil, err + } + return v, nil +} + +// The theme with emoji placed on a background. +type ChatShareThemeEmoji struct { + // Type of the theme, always “emoji” + Type ChatShareThemeType `json:"type"` + // The emoji; 0-6 regular or custom emoji + Emojis []EmojiType `json:"emojis"` + // Optional. Identifier of the backdrop used as the background; omitted if the default background is used. Use getChatShareThemeBackdrops to get details about the backdrop. + BackgroundBackdropID *int64 `json:"background_backdrop_id,omitempty"` +} + +// MarshalJSON encodes ChatShareThemeEmoji with the discriminator field +// "type" forced to "emoji". +// The hardcoded value frees callers from setting Type by hand — +// any user-supplied value on the struct literal is overridden so a typo +// can't slip through to Telegram. +func (v *ChatShareThemeEmoji) MarshalJSON() ([]byte, error) { + type alias ChatShareThemeEmoji + return json.Marshal(&struct { + Type string `json:"type"` + *alias + }{ + Type: "emoji", + alias: (*alias)(v), + }) +} + +// UnmarshalJSON decodes ChatShareThemeEmoji by dispatching union-typed fields +// (Emojis) through their concrete UnmarshalXxx helpers. +func (m *ChatShareThemeEmoji) UnmarshalJSON(data []byte) error { + type Alias ChatShareThemeEmoji + aux := &struct { + Emojis json.RawMessage `json:"emojis,omitempty"` + *Alias + }{Alias: (*Alias)(m)} + if err := json.Unmarshal(data, aux); err != nil { + return err + } + + if len(aux.Emojis) > 0 && string(aux.Emojis) != "null" { + var raws []json.RawMessage + if err := json.Unmarshal(aux.Emojis, &raws); err != nil { + return fmt.Errorf("decoding emojis: %w", err) + } + decoded := make([]EmojiType, 0, len(raws)) + for i, r := range raws { + v, err := UnmarshalEmojiType(r) + if err != nil { + return fmt.Errorf("decoding emojis[%d]: %w", i, err) + } + decoded = append(decoded, v) + } + m.Emojis = decoded + + } + + return nil +} + +// The theme based on a unique gift owned by the user or the chat. +type ChatShareThemeUniqueGift struct { + // Type of the theme, always “unique_gift” + Type ChatShareThemeType `json:"type"` + // The gift + Gift UniqueGift `json:"gift"` +} + +// MarshalJSON encodes ChatShareThemeUniqueGift with the discriminator field +// "type" forced to "unique_gift". +// The hardcoded value frees callers from setting Type by hand — +// any user-supplied value on the struct literal is overridden so a typo +// can't slip through to Telegram. +func (v *ChatShareThemeUniqueGift) MarshalJSON() ([]byte, error) { + type alias ChatShareThemeUniqueGift + return json.Marshal(&struct { + Type string `json:"type"` + *alias + }{ + Type: "unique_gift", + alias: (*alias)(v), + }) +} + +// This 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. +type ChatShareThemeBackdrops struct { + // The list of backdrops + Backdrops []ChatShareThemeBackdrop `json:"backdrops"` +} + +// This 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. +type ChatShareThemeBackdrop struct { + // Unique identifier of the backdrop + ID int64 `json:"id"` + // Name of the backdrop + Name string `json:"name"` + // Colors of the backdrop + Colors UniqueGiftBackdropColors `json:"colors"` +} + // Describes the physical address of a location. type LocationAddress struct { // The two-letter ISO 3166-1 alpha-2 country code of the country where the location is located @@ -3465,7 +4100,7 @@ type StoryAreaTypeSuggestedReaction struct { ReactionType ReactionType `json:"reaction_type"` // Optional. Pass True if the reaction area has a dark background IsDark *bool `json:"is_dark,omitempty"` - // Optional. Pass True if reaction area corner is flipped + // Optional. Pass True if the reaction area corner is flipped IsFlipped *bool `json:"is_flipped,omitempty"` } @@ -3537,7 +4172,7 @@ func (v *StoryAreaTypeLink) MarshalJSON() ([]byte, error) { type StoryAreaTypeWeather struct { // Type of the area, always “weather” Type StoryAreaTypeKind `json:"type"` - // Temperature, in degree Celsius + // Temperature, in degrees Celsius Temperature float64 `json:"temperature"` // Emoji representing the weather Emoji string `json:"emoji"` @@ -3588,7 +4223,7 @@ func (v *StoryAreaTypeUniqueGift) MarshalJSON() ([]byte, error) { // Describes a clickable area on a story media. type StoryArea struct { // Position of the area - Position StoryAreaPosition `json:"position"` + Position AreaPosition `json:"position"` // Type of the area Type StoryAreaType `json:"type"` } @@ -3905,7 +4540,7 @@ type Gift struct { PublisherChat *Chat `json:"publisher_chat,omitempty"` } -// This object represent a list of gifts. +// This object represents a list of gifts. type Gifts struct { // The list of gifts Gifts []Gift `json:"gifts"` @@ -3929,7 +4564,7 @@ type UniqueGiftSymbol struct { Name string `json:"name"` // The sticker that represents the unique gift Sticker Sticker `json:"sticker"` - // The number of unique gifts that receive this model for every 1000 gifts upgraded + // The number of unique gifts that receive this symbol for every 1000 gifts upgraded RarityPerMille int64 `json:"rarity_per_mille"` } @@ -3987,7 +4622,7 @@ type UniqueGift struct { Symbol UniqueGiftSymbol `json:"symbol"` // Backdrop of the gift Backdrop UniqueGiftBackdrop `json:"backdrop"` - // Optional. True, if the original regular gift was exclusively purchaseable by Telegram Premium subscribers + // Optional. True, if the original regular gift was exclusively purchasable by Telegram Premium subscribers IsPremium *bool `json:"is_premium,omitempty"` // Optional. True, if the gift was used to craft another gift and isn't available anymore IsBurned *bool `json:"is_burned,omitempty"` @@ -4690,7 +5325,7 @@ func (v *ChatBoostSourcePremium) MarshalJSON() ([]byte, error) { type ChatBoostSourceGiftCode struct { // Source of the boost, always “gift_code” Source ChatBoostSourceKind `json:"source"` - // User for which the gift code was created + // User for whom the gift code was created User User `json:"user"` } @@ -4876,7 +5511,7 @@ type BusinessConnection struct { ID string `json:"id"` // Business account user that created the business connection User User `json:"user"` - // Identifier of a private chat with the user who created the business connection. This number may have more than 32 significant bits and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a 64-bit integer or double-precision float type are safe for storing this identifier. + // Identifier of a private chat with the user who created the business connection. This number may have more than 32 significant bits and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a 64-bit integer or double-precision float type is safe for storing this identifier. UserChatID int64 `json:"user_chat_id"` // Date the connection was established in Unix time Date int64 `json:"date"` @@ -4990,7 +5625,7 @@ type InputMediaAnimation struct { Type InputMediaType `json:"type"` // File to send. Pass a file_id to send a file that exists on the Telegram servers (recommended), pass an HTTP URL for Telegram to get a file from the Internet, or pass “attach://” to upload a new one using multipart/form-data under name. More information on Sending Files » Media string `json:"media"` - // Optional. Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass “attach://” if the thumbnail was uploaded using multipart/form-data under . More information on Sending Files » + // Optional. Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can only be uploaded as a new file, so you can pass “attach://” if the thumbnail was uploaded using multipart/form-data under . More information on Sending Files » Thumbnail string `json:"thumbnail,omitempty"` // Optional. Caption of the animation to be sent, 0-1024 characters after entities parsing Caption string `json:"caption,omitempty"` @@ -5032,7 +5667,7 @@ type InputMediaAudio struct { Type InputMediaType `json:"type"` // File to send. Pass a file_id to send a file that exists on the Telegram servers (recommended), pass an HTTP URL for Telegram to get a file from the Internet, or pass “attach://” to upload a new one using multipart/form-data under name. More information on Sending Files » Media string `json:"media"` - // Optional. Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass “attach://” if the thumbnail was uploaded using multipart/form-data under . More information on Sending Files » + // Optional. Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can only be uploaded as a new file, so you can pass “attach://” if the thumbnail was uploaded using multipart/form-data under . More information on Sending Files » Thumbnail string `json:"thumbnail,omitempty"` // Optional. Caption of the audio to be sent, 0-1024 characters after entities parsing Caption string `json:"caption,omitempty"` @@ -5070,7 +5705,7 @@ type InputMediaDocument struct { Type InputMediaType `json:"type"` // File to send. Pass a file_id to send a file that exists on the Telegram servers (recommended), pass an HTTP URL for Telegram to get a file from the Internet, or pass “attach://” to upload a new one using multipart/form-data under name. More information on Sending Files » Media string `json:"media"` - // Optional. Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass “attach://” if the thumbnail was uploaded using multipart/form-data under . More information on Sending Files » + // Optional. Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can only be uploaded as a new file, so you can pass “attach://” if the thumbnail was uploaded using multipart/form-data under . More information on Sending Files » Thumbnail string `json:"thumbnail,omitempty"` // Optional. Caption of the document to be sent, 0-1024 characters after entities parsing Caption string `json:"caption,omitempty"` @@ -5290,7 +5925,7 @@ type InputMediaVideo struct { Type InputMediaType `json:"type"` // File to send. Pass a file_id to send a file that exists on the Telegram servers (recommended), pass an HTTP URL for Telegram to get a file from the Internet, or pass “attach://” to upload a new one using multipart/form-data under name. More information on Sending Files » Media string `json:"media"` - // Optional. Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass “attach://” if the thumbnail was uploaded using multipart/form-data under . More information on Sending Files » + // Optional. Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can only be uploaded as a new file, so you can pass “attach://” if the thumbnail was uploaded using multipart/form-data under . More information on Sending Files » Thumbnail string `json:"thumbnail,omitempty"` // Optional. Cover for the video in the message. Pass a file_id to send a file that exists on the Telegram servers (recommended), pass an HTTP URL for Telegram to get a file from the Internet, or pass “attach://” to upload a new one using multipart/form-data under name. More information on Sending Files » Cover string `json:"cover,omitempty"` @@ -5336,7 +5971,7 @@ func (v *InputMediaVideo) MarshalJSON() ([]byte, error) { type InputMediaVoiceNote struct { // Type of the media, must be voice_note Type InputMediaVoiceNoteType `json:"type"` - // File to send. Pass a file_id to send a file that exists on the Telegram servers (recommended), pass an HTTP URL for Telegram to get a file from the Internet, or pass "attach://" to upload a new one using multipart/form-data under name. More information on Sending Files » + // File to send. Pass a file_id to send a file that exists on the Telegram servers (recommended), pass an HTTP URL for Telegram to get a file from the Internet, or pass “attach://” to upload a new one using multipart/form-data under name. More information on Sending Files » Media string `json:"media"` // Optional. Caption of the voice message to be sent, 0-1024 characters after entities parsing Caption string `json:"caption,omitempty"` @@ -5448,7 +6083,7 @@ type InputPaidMediaVideo struct { Type InputPaidMediaType `json:"type"` // File to send. Pass a file_id to send a file that exists on the Telegram servers (recommended), pass an HTTP URL for Telegram to get a file from the Internet, or pass “attach://” to upload a new one using multipart/form-data under name. More information on Sending Files » Media string `json:"media"` - // Optional. Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass “attach://” if the thumbnail was uploaded using multipart/form-data under . More information on Sending Files » + // Optional. Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can only be uploaded as a new file, so you can pass “attach://” if the thumbnail was uploaded using multipart/form-data under . More information on Sending Files » Thumbnail string `json:"thumbnail,omitempty"` // Optional. Cover for the video in the message. Pass a file_id to send a file that exists on the Telegram servers (recommended), pass an HTTP URL for Telegram to get a file from the Internet, or pass “attach://” to upload a new one using multipart/form-data under name. More information on Sending Files » Cover string `json:"cover,omitempty"` @@ -5712,7 +6347,7 @@ type StickerSet struct { type MaskPosition struct { // The part of the face relative to which the mask should be placed. One of “forehead”, “eyes”, “mouth”, or “chin”. Point MaskPositionPoint `json:"point"` - // Shift by X-axis measured in widths of the mask scaled to the face size, from left to right. For example, choosing -1.0 will place mask just to the left of the default mask position. + // Shift by X-axis measured in widths of the mask scaled to the face size, from left to right. For example, choosing -1.0 will place the mask just to the left of the default mask position. XShift float64 `json:"x_shift"` // Shift by Y-axis measured in heights of the mask scaled to the face size, from top to bottom. For example, 1.0 will place the mask just below the default mask position. YShift float64 `json:"y_shift"` @@ -5730,7 +6365,7 @@ type InputSticker struct { EmojiList []string `json:"emoji_list"` // Optional. Position where the mask should be placed on faces. For “mask” stickers only. MaskPosition *MaskPosition `json:"mask_position,omitempty"` - // Optional. List of 0-20 search keywords for the sticker with total length of up to 64 characters. For “regular” and “custom_emoji” stickers only. + // Optional. List of 0-20 search keywords for the sticker with a total length of up to 64 characters. For “regular” and “custom_emoji” stickers only. Keywords []string `json:"keywords,omitempty"` } @@ -5778,9 +6413,9 @@ func (m *RichMessage) UnmarshalJSON(data []byte) error { type InputRichMessage struct { // Optional. Content of the rich message to send described as a list of blocks Blocks []InputRichBlock `json:"blocks,omitempty"` - // Optional. Content of the rich message to send described using HTML formatting. See rich message formatting options for more details. Use media field to specify the media used in the message. + // Optional. Content of the rich message to send described using HTML formatting. See rich message formatting options for more details. Use the media field to specify the media used in the message. HTML string `json:"html,omitempty"` - // Optional. Content of the rich message to send described using Markdown formatting. See rich message formatting options for more details. Use media field to specify the media used in the message. + // Optional. Content of the rich message to send described using Markdown formatting. See rich message formatting options for more details. Use the media field to specify the media used in the message. Markdown string `json:"markdown,omitempty"` // Optional. List of media that are specified in the markdown or html fields using tg://photo?id=, tg://video?id=, tg://document?id=, and tg://audio?id= links Media []InputRichMessageMedia `json:"media,omitempty"` @@ -5899,6 +6534,7 @@ func (m *RichMessageButton) UnmarshalJSON(data []byte) error { // - RichTextEmailAddress // - RichTextPhoneNumber // - RichTextBankCardNumber +// - RichTextTonAddress // - RichTextMention // - RichTextHashtag // - RichTextCashtag @@ -5965,6 +6601,9 @@ func (*RichTextPhoneNumber) isRichText() {} // isRichText is the marker method that makes RichTextBankCardNumber implement RichText. func (*RichTextBankCardNumber) isRichText() {} +// isRichText is the marker method that makes RichTextTonAddress implement RichText. +func (*RichTextTonAddress) isRichText() {} + // isRichText is the marker method that makes RichTextMention implement RichText. func (*RichTextMention) isRichText() {} @@ -6112,6 +6751,8 @@ func UnmarshalRichText(data []byte) (RichText, error) { v = &RichTextSuperscript{} case "text_mention": v = &RichTextTextMention{} + case "ton_address": + v = &RichTextTonAddress{} case "underline": v = &RichTextUnderline{} case "url": @@ -6909,6 +7550,56 @@ func (m *RichTextBankCardNumber) UnmarshalJSON(data []byte) error { return nil } +// An address in the TON blockchain. +type RichTextTonAddress struct { + // Type of the rich text, always “ton_address” + Type RichTextType `json:"type"` + // Text of the address + Text RichText `json:"text"` + // The address + Address string `json:"address"` +} + +// MarshalJSON encodes RichTextTonAddress with the discriminator field +// "type" forced to "ton_address". +// The hardcoded value frees callers from setting Type by hand — +// any user-supplied value on the struct literal is overridden so a typo +// can't slip through to Telegram. +func (v *RichTextTonAddress) MarshalJSON() ([]byte, error) { + type alias RichTextTonAddress + return json.Marshal(&struct { + Type string `json:"type"` + *alias + }{ + Type: "ton_address", + alias: (*alias)(v), + }) +} + +// UnmarshalJSON decodes RichTextTonAddress by dispatching union-typed fields +// (Text) through their concrete UnmarshalXxx helpers. +func (m *RichTextTonAddress) UnmarshalJSON(data []byte) error { + type Alias RichTextTonAddress + aux := &struct { + Text json.RawMessage `json:"text,omitempty"` + *Alias + }{Alias: (*Alias)(m)} + if err := json.Unmarshal(data, aux); err != nil { + return err + } + + if len(aux.Text) > 0 && string(aux.Text) != "null" { + v, err := UnmarshalRichText(aux.Text) + if err != nil { + return fmt.Errorf("decoding text: %w", err) + } + m.Text = v + + } + + return nil +} + // A mention by a username. type RichTextMention struct { // Type of the rich text, always “mention” @@ -7163,7 +7854,7 @@ type RichTextAnchorLink struct { Type RichTextType `json:"type"` // The link text Text RichText `json:"text"` - // The name of the anchor. If the name is empty, then the link brings back to the top of the message. + // The name of the anchor. If the name is empty, then the link brings the user back to the top of the message. AnchorName string `json:"anchor_name"` } @@ -7965,12 +8656,12 @@ func (m *RichBlockBlockQuotation) UnmarshalJSON(data []byte) error { return nil } -// A block quotation, corresponding to the HTML tag
with custom attribute "expandable". +// A block quotation, corresponding to the HTML tag
with the custom attribute "expandable". type RichBlockExpandableBlockQuotation struct { // Type of the block, always “expandable_blockquote” Type RichBlockType `json:"type"` // Content of the block - Text RichText `json:"text"` + Blocks []RichBlock `json:"blocks"` // Optional. Credit of the block Credit RichText `json:"credit,omitempty"` } @@ -7992,11 +8683,11 @@ func (v *RichBlockExpandableBlockQuotation) MarshalJSON() ([]byte, error) { } // UnmarshalJSON decodes RichBlockExpandableBlockQuotation by dispatching union-typed fields -// (Text, Credit) through their concrete UnmarshalXxx helpers. +// (Blocks, Credit) through their concrete UnmarshalXxx helpers. func (m *RichBlockExpandableBlockQuotation) UnmarshalJSON(data []byte) error { type Alias RichBlockExpandableBlockQuotation aux := &struct { - Text json.RawMessage `json:"text,omitempty"` + Blocks json.RawMessage `json:"blocks,omitempty"` Credit json.RawMessage `json:"credit,omitempty"` *Alias }{Alias: (*Alias)(m)} @@ -8004,12 +8695,20 @@ func (m *RichBlockExpandableBlockQuotation) UnmarshalJSON(data []byte) error { return err } - if len(aux.Text) > 0 && string(aux.Text) != "null" { - v, err := UnmarshalRichText(aux.Text) - if err != nil { - return fmt.Errorf("decoding text: %w", err) + if len(aux.Blocks) > 0 && string(aux.Blocks) != "null" { + var raws []json.RawMessage + if err := json.Unmarshal(aux.Blocks, &raws); err != nil { + return fmt.Errorf("decoding blocks: %w", err) } - m.Text = v + decoded := make([]RichBlock, 0, len(raws)) + for i, r := range raws { + v, err := UnmarshalRichBlock(r) + if err != nil { + return fmt.Errorf("decoding blocks[%d]: %w", i, err) + } + decoded = append(decoded, v) + } + m.Blocks = decoded } @@ -8547,7 +9246,7 @@ func (v *RichBlockVoiceNote) MarshalJSON() ([]byte, error) { }) } -// A block with a “Thinking…” placeholder, corresponding to the custom HTML tag . The block may be used only in sendRichMessageDraft, therefore it can't be received in messages. See https://t.me/addemoji/AIActions for examples of custom emoji that are recommended for usage in the block. +// A block with a “Thinking…” placeholder, corresponding to the custom HTML tag . The block may be used only in sendRichMessageDraft; therefore, it can't be received in messages. See https://t.me/addemoji/AIActions for examples of custom emoji that are recommended for usage in the block. type RichBlockThinking struct { // Type of the block, always “thinking” Type RichBlockType `json:"type"` @@ -9169,12 +9868,12 @@ func (m *InputRichBlockBlockQuotation) UnmarshalJSON(data []byte) error { return nil } -// A block quotation, corresponding to the HTML tag
with custom attribute "expandable". +// A block quotation, corresponding to the HTML tag
with the custom attribute "expandable". type InputRichBlockExpandableBlockQuotation struct { // Type of the block, always “expandable_blockquote” Type InputRichBlockType `json:"type"` // Content of the block - Text RichText `json:"text"` + Blocks []InputRichBlock `json:"blocks"` // Optional. Credit of the block Credit RichText `json:"credit,omitempty"` } @@ -9196,11 +9895,11 @@ func (v *InputRichBlockExpandableBlockQuotation) MarshalJSON() ([]byte, error) { } // UnmarshalJSON decodes InputRichBlockExpandableBlockQuotation by dispatching union-typed fields -// (Text, Credit) through their concrete UnmarshalXxx helpers. +// (Blocks, Credit) through their concrete UnmarshalXxx helpers. func (m *InputRichBlockExpandableBlockQuotation) UnmarshalJSON(data []byte) error { type Alias InputRichBlockExpandableBlockQuotation aux := &struct { - Text json.RawMessage `json:"text,omitempty"` + Blocks json.RawMessage `json:"blocks,omitempty"` Credit json.RawMessage `json:"credit,omitempty"` *Alias }{Alias: (*Alias)(m)} @@ -9208,12 +9907,20 @@ func (m *InputRichBlockExpandableBlockQuotation) UnmarshalJSON(data []byte) erro return err } - if len(aux.Text) > 0 && string(aux.Text) != "null" { - v, err := UnmarshalRichText(aux.Text) - if err != nil { - return fmt.Errorf("decoding text: %w", err) + if len(aux.Blocks) > 0 && string(aux.Blocks) != "null" { + var raws []json.RawMessage + if err := json.Unmarshal(aux.Blocks, &raws); err != nil { + return fmt.Errorf("decoding blocks: %w", err) } - m.Text = v + decoded := make([]InputRichBlock, 0, len(raws)) + for i, r := range raws { + v, err := UnmarshalInputRichBlock(r) + if err != nil { + return fmt.Errorf("decoding blocks[%d]: %w", i, err) + } + decoded = append(decoded, v) + } + m.Blocks = decoded } @@ -9745,7 +10452,7 @@ func (v *InputRichBlockVoiceNote) MarshalJSON() ([]byte, error) { }) } -// A block with a “Thinking…” placeholder, corresponding to the custom HTML tag . The block may be used only in sendRichMessageDraft, therefore it can't be received in messages. See https://t.me/addemoji/AIActions for examples of custom emoji that are recommended for usage in the block. +// A block with a “Thinking…” placeholder, corresponding to the custom HTML tag . The block may be used only in sendRichMessageDraft; therefore, it can't be received in messages. See https://t.me/addemoji/AIActions for examples of custom emoji that are recommended for usage in the block. type InputRichBlockThinking struct { // Type of the block, always “thinking” Type InputRichBlockType `json:"type"` @@ -9803,9 +10510,9 @@ type InlineQuery struct { Query string `json:"query"` // Offset of the results to be returned, can be controlled by the bot Offset string `json:"offset"` - // Optional. Type of the chat from which the inline query was sent. Can be either “sender” for a private chat with the inline query sender, “private”, “group”, “supergroup”, or “channel”. The chat type should be always known for requests sent from official clients and most third-party clients, unless the request was sent from a secret chat. + // Optional. Type of the chat from which the inline query was sent. Can be either “sender” for a private chat with the inline query sender, “private”, “group”, “supergroup”, or “channel”. The chat type should always be known for requests sent from official clients and most third-party clients, unless the request was sent from a secret chat. ChatType InlineQueryChatType `json:"chat_type,omitempty"` - // Optional. Sender location, only for bots that request user location + // Optional. Sender location, only for bots that enabled user location requests via @BotFather or using the parameter needs_inline_query_location of the method setMySettings Location *Location `json:"location,omitempty"` } @@ -9946,7 +10653,7 @@ func (v *InlineQueryResultArticle) MarshalJSON() ([]byte, error) { }) } -// Represents 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. +// Represents a link to a photo. 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 specified content instead of the photo. type InlineQueryResultPhoto struct { // Type of the result, must be photo Type InlineQueryResultType `json:"type"` @@ -9994,7 +10701,7 @@ func (v *InlineQueryResultPhoto) MarshalJSON() ([]byte, error) { }) } -// Represents 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 instead of the animation. +// Represents a link to an animated GIF file. 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 message with the specified content instead of the animation. type InlineQueryResultGif struct { // Type of the result, must be gif Type InlineQueryResultType `json:"type"` @@ -10044,7 +10751,7 @@ func (v *InlineQueryResultGif) MarshalJSON() ([]byte, error) { }) } -// Represents 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 send a message with the specified content instead of the animation. +// Represents 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 an optional caption. Alternatively, you can use input_message_content to send a message with the specified content instead of the animation. type InlineQueryResultMpeg4Gif struct { // Type of the result, must be mpeg4_gif Type InlineQueryResultType `json:"type"` @@ -10127,7 +10834,7 @@ type InlineQueryResultVideo struct { Description string `json:"description,omitempty"` // Optional. Inline keyboard attached to the message ReplyMarkup *InlineKeyboardMarkup `json:"reply_markup,omitempty"` - // Optional. Content of the message to be sent instead of the video. This field is required if InlineQueryResultVideo is used to send an HTML-page as a result (e.g., a YouTube video). + // Optional. Content of the message to be sent instead of the video. This field is required if InlineQueryResultVideo is used to send an HTML page as a result (e.g., a YouTube video). InputMessageContent InputMessageContent `json:"input_message_content,omitempty"` } @@ -10189,7 +10896,7 @@ func (v *InlineQueryResultAudio) MarshalJSON() ([]byte, error) { }) } -// Represents 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 specified content instead of the the voice message. +// Represents 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 specified content instead of the voice message. type InlineQueryResultVoice struct { // Type of the result, must be voice Type InlineQueryResultType `json:"type"` @@ -10487,7 +11194,7 @@ func (v *InlineQueryResultCachedPhoto) MarshalJSON() ([]byte, error) { }) } -// Represents 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 message with specified content instead of the animation. +// Represents 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 message with the specified content instead of the animation. type InlineQueryResultCachedGif struct { // Type of the result, must be gif Type InlineQueryResultType `json:"type"` @@ -10761,6 +11468,8 @@ func (v *InlineQueryResultCachedAudio) MarshalJSON() ([]byte, error) { // - InputVenueMessageContent // - InputContactMessageContent // - InputInvoiceMessageContent +// - InputWidgetMessageContent +// - InputSharedWidgetMessageContent // // This object represents the content of a message to be sent as a result of an inline query. Telegram clients currently support the following types: type InputMessageContent interface{ isInputMessageContent() } @@ -10783,6 +11492,12 @@ func (*InputContactMessageContent) isInputMessageContent() {} // isInputMessageContent is the marker method that makes InputInvoiceMessageContent implement InputMessageContent. func (*InputInvoiceMessageContent) isInputMessageContent() {} +// isInputMessageContent is the marker method that makes InputWidgetMessageContent implement InputMessageContent. +func (*InputWidgetMessageContent) isInputMessageContent() {} + +// isInputMessageContent is the marker method that makes InputSharedWidgetMessageContent implement InputMessageContent. +func (*InputSharedWidgetMessageContent) isInputMessageContent() {} + // Represents the content of a text message to be sent as the result of an inline query. type InputTextMessageContent struct { // Text of the message to be sent, 1-4096 characters @@ -10855,7 +11570,7 @@ type InputInvoiceMessageContent struct { Title string `json:"title"` // Product description, 1-255 characters Description string `json:"description"` - // Bot-defined invoice payload, 1-128 bytes. This will not be displayed to the user, use it for your internal processes. + // Bot-defined invoice payload, 1-128 bytes. This will not be displayed to the user; use it for your internal processes. Payload string `json:"payload"` // Optional. Payment provider token, obtained via @BotFather. Pass an empty string for payments in Telegram Stars. ProviderToken string `json:"provider_token,omitempty"` @@ -10863,9 +11578,9 @@ type InputInvoiceMessageContent struct { Currency string `json:"currency"` // Price breakdown, a JSON-serialized list of components (e.g. product price, tax, discount, delivery cost, delivery tax, bonus, etc.). Must contain exactly one item for payments in Telegram Stars. Prices []LabeledPrice `json:"prices"` - // Optional. The maximum accepted amount for tips in the smallest units of the currency (integer, not float/double). For example, for a maximum tip of US$ 1.45 pass max_tip_amount = 145. See the exp parameter in currencies.json, it shows the number of digits past the decimal point for each currency (2 for the majority of currencies). Defaults to 0. Not supported for payments in Telegram Stars. + // Optional. The maximum accepted amount for tips in the smallest units of the currency (integer, not float/double). For example, for a maximum tip of US$ 1.45 pass max_tip_amount = 145. See the exp parameter in currencies.json; it shows the number of digits past the decimal point for each currency (2 for the majority of currencies). Defaults to 0. Not supported for payments in Telegram Stars. MaxTipAmount *int64 `json:"max_tip_amount,omitempty"` - // Optional. A JSON-serialized Array of suggested amounts of tip in the smallest units of the currency (integer, not float/double). At most 4 suggested tip amounts can be specified. The suggested tip amounts must be positive, passed in a strictly increased order and must not exceed max_tip_amount. + // Optional. A JSON-serialized Array of suggested amounts of tips in the smallest units of the currency (integer, not float/double). At most 4 suggested tip amounts can be specified. The suggested tip amounts must be positive, passed in a strictly increasing order and must not exceed max_tip_amount. SuggestedTipAmounts []int64 `json:"suggested_tip_amounts,omitempty"` // Optional. A JSON-serialized object for data about the invoice, which will be shared with the payment provider. A detailed description of the required fields should be provided by the payment provider. ProviderData string `json:"provider_data,omitempty"` @@ -10893,16 +11608,58 @@ type InputInvoiceMessageContent struct { IsFlexible *bool `json:"is_flexible,omitempty"` } +// Represents 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. +type InputWidgetMessageContent struct { + // HTML code of the widget, 1-32768 bytes. The code must not exceed 4096 bytes when compressed by zlib with the maximum compression level. + HTML string `json:"html"` + // Optional. Width of the widget in logical pixels; omit if the widget must occupy the whole width of the message bubble. The width is clamped by the app to the range from 200 to the maximum width of the message bubble. + Width *int64 `json:"width,omitempty"` + // Optional. Height of the widget in logical pixels; omit if the height of the widget isn't fixed. The height is clamped by the app to the range 50-600. + Height *int64 `json:"height,omitempty"` + // Optional. Public data of the widget, 0-1024 bytes, which will be available wherever the widget is shown. If the widget is shared, then all messages with it will have the same public data. + PublicData string `json:"public_data,omitempty"` + // Optional. Data of the widget, which is specific to the message, 0-1024 bytes + ChatData string `json:"chat_data,omitempty"` + // Optional. Widget caption, 0-1024 characters after entities parsing + Caption string `json:"caption,omitempty"` + // Optional. Mode for parsing entities in the widget caption. See formatting options for more details. + ParseMode ParseMode `json:"parse_mode,omitempty"` + // Optional. List of special entities that appear in the caption, which can be specified instead of parse_mode + CaptionEntities []MessageEntity `json:"caption_entities,omitempty"` + // Optional. Pass True if the caption must be shown above the widget + ShowCaptionAboveMedia *bool `json:"show_caption_above_media,omitempty"` + // Optional. Pass True to allow the widget to send queries to the bot + AllowQueries *bool `json:"allow_queries,omitempty"` + // Optional. Pass True to create a shared widget. Each message sent from the result creates a separate shared widget, whose identifier is received by the bot only in the field widget_id of queries from the widget. To send an existing shared widget in response to an inline query, use InputSharedWidgetMessageContent instead. + IsShared *bool `json:"is_shared,omitempty"` +} + +// Represents 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. +type InputSharedWidgetMessageContent struct { + // Unique identifier of the shared widget created by the bot + WidgetID string `json:"widget_id"` + // Optional. Data of the widget, which is specific to the message, 0-1024 bytes + ChatData string `json:"chat_data,omitempty"` + // Optional. Widget caption, 0-1024 characters after entities parsing + Caption string `json:"caption,omitempty"` + // Optional. Mode for parsing entities in the widget caption. See formatting options for more details. + ParseMode ParseMode `json:"parse_mode,omitempty"` + // Optional. List of special entities that appear in the caption, which can be specified instead of parse_mode + CaptionEntities []MessageEntity `json:"caption_entities,omitempty"` + // Optional. Pass True if the caption must be shown above the widget + ShowCaptionAboveMedia *bool `json:"show_caption_above_media,omitempty"` +} + // Represents a result of an inline query that was chosen by the user and sent to their chat partner. -// Note: It is necessary to enable inline feedback via @BotFather in order to receive these objects in updates. +// Note: It is necessary to enable inline feedback via @BotFather or using the parameter inline_feedback_share_denominator of the method setMySettings in order to receive these objects in updates. type ChosenInlineResult struct { // The unique identifier for the result that was chosen ResultID string `json:"result_id"` // The user that chose the result From User `json:"from"` - // Optional. Sender location, only for bots that require user location + // Optional. Sender location, only for bots that enabled user location requests via @BotFather or using the parameter needs_inline_query_location of the method setMySettings Location *Location `json:"location,omitempty"` - // Optional. Identifier of the sent inline message. Available only if there is an inline keyboard attached to the message. Will be also received in callback queries and can be used to edit the message. + // Optional. Identifier of the sent inline message. Available only if there is an inline keyboard attached to the message. Will also be received in callback queries and can be used to edit the message. InlineMessageID string `json:"inline_message_id,omitempty"` // The query that was used to obtain the result Query string `json:"query"` @@ -10912,7 +11669,7 @@ type ChosenInlineResult struct { type LabeledPrice struct { // Portion label Label string `json:"label"` - // Price of the product in the smallest units of the currency (integer, not float/double). For example, for a price of US$ 1.45 pass amount = 145. See the exp parameter in currencies.json, it shows the number of digits past the decimal point for each currency (2 for the majority of currencies). + // Price of the product in the smallest units of the currency (integer, not float/double). For example, for a price of US$ 1.45 pass amount = 145. See the exp parameter in currencies.json; it shows the number of digits past the decimal point for each currency (2 for the majority of currencies). Amount int64 `json:"amount"` } @@ -10926,7 +11683,7 @@ type Invoice struct { StartParameter string `json:"start_parameter"` // Three-letter ISO 4217 currency code, or “XTR” for payments in Telegram Stars Currency string `json:"currency"` - // Total price in the smallest units of the currency (integer, not float/double). For example, for a price of US$ 1.45 pass amount = 145. See the exp parameter in currencies.json, it shows the number of digits past the decimal point for each currency (2 for the majority of currencies). + // Total price in the smallest units of the currency (integer, not float/double). For example, for a price of US$ 1.45, total_amount = 145. See the exp parameter in currencies.json; it shows the number of digits past the decimal point for each currency (2 for the majority of currencies). TotalAmount int64 `json:"total_amount"` } @@ -10972,7 +11729,7 @@ type ShippingOption struct { type SuccessfulPayment struct { // Three-letter ISO 4217 currency code, or “XTR” for payments in Telegram Stars Currency string `json:"currency"` - // Total price in the smallest units of the currency (integer, not float/double). For example, for a price of US$ 1.45 pass amount = 145. See the exp parameter in currencies.json, it shows the number of digits past the decimal point for each currency (2 for the majority of currencies). + // Total price in the smallest units of the currency (integer, not float/double). For example, for a price of US$ 1.45, total_amount = 145. See the exp parameter in currencies.json; it shows the number of digits past the decimal point for each currency (2 for the majority of currencies). TotalAmount int64 `json:"total_amount"` // Bot-specified invoice payload InvoicePayload string `json:"invoice_payload"` @@ -10996,7 +11753,7 @@ type SuccessfulPayment struct { type RefundedPayment struct { // Three-letter ISO 4217 currency code, or “XTR” for payments in Telegram Stars. Currently, always “XTR”. Currency RefundedPaymentCurrency `json:"currency"` - // Total refunded price in the smallest units of the currency (integer, not float/double). For example, for a price of US$ 1.45, total_amount = 145. See the exp parameter in currencies.json, it shows the number of digits past the decimal point for each currency (2 for the majority of currencies). + // Total refunded price in the smallest units of the currency (integer, not float/double). For example, for a price of US$ 1.45, total_amount = 145. See the exp parameter in currencies.json; it shows the number of digits past the decimal point for each currency (2 for the majority of currencies). TotalAmount int64 `json:"total_amount"` // Bot-specified invoice payload InvoicePayload string `json:"invoice_payload"` @@ -11014,7 +11771,7 @@ type ShippingQuery struct { From User `json:"from"` // Bot-specified invoice payload InvoicePayload string `json:"invoice_payload"` - // User specified shipping address + // User-specified shipping address ShippingAddress ShippingAddress `json:"shipping_address"` } @@ -11026,7 +11783,7 @@ type PreCheckoutQuery struct { From User `json:"from"` // Three-letter ISO 4217 currency code, or “XTR” for payments in Telegram Stars Currency string `json:"currency"` - // Total price in the smallest units of the currency (integer, not float/double). For example, for a price of US$ 1.45 pass amount = 145. See the exp parameter in currencies.json, it shows the number of digits past the decimal point for each currency (2 for the majority of currencies). + // Total price in the smallest units of the currency (integer, not float/double). For example, for a price of US$ 1.45, total_amount = 145. See the exp parameter in currencies.json; it shows the number of digits past the decimal point for each currency (2 for the majority of currencies). TotalAmount int64 `json:"total_amount"` // Bot-specified invoice payload InvoicePayload string `json:"invoice_payload"` @@ -11534,7 +12291,7 @@ type StarTransactions struct { // Describes Telegram Passport data shared with the bot by the user. type PassportData struct { - // Array with information about documents and other Telegram Passport elements that was shared with the bot + // Array with information shared with the bot about documents and other Telegram Passport elements Data []EncryptedPassportElement `json:"data"` // Encrypted credentials required to decrypt the data Credentials EncryptedCredentials `json:"credentials"` @@ -11724,7 +12481,7 @@ func (v *PassportElementErrorFrontSide) MarshalJSON() ([]byte, error) { }) } -// Represents an issue with the reverse side of a document. The error is considered resolved when the file with reverse side of the document changes. +// Represents an issue with the reverse side of a document. The error is considered resolved when the file with the reverse side of the document changes. type PassportElementErrorReverseSide struct { // Error source, must be reverse_side Source PassportElementErrorSource `json:"source"` @@ -11864,7 +12621,7 @@ func (v *PassportElementErrorTranslationFile) MarshalJSON() ([]byte, error) { }) } -// Represents an issue with the translated version of a document. The error is considered resolved when a file with the document translation change. +// Represents an issue with the translated version of a document. The error is considered resolved when a file with the document translation changes. type PassportElementErrorTranslationFiles struct { // Error source, must be translation_files Source PassportElementErrorSource `json:"source"` @@ -11920,7 +12677,7 @@ func (v *PassportElementErrorUnspecified) MarshalJSON() ([]byte, error) { }) } -// This object represents a game. Use BotFather to create and edit games, their short names will act as unique identifiers. +// This object represents a game. Use BotFather to create and edit games; their short names will act as unique identifiers. type Game struct { // Title of the game Title string `json:"title"` diff --git a/docs/reference/api.md b/docs/reference/api.md index 0d0c744..1ca143b 100644 --- a/docs/reference/api.md +++ b/docs/reference/api.md @@ -22,6 +22,7 @@ Package api contains the Telegram Bot API object types and method wrappers, gene - [func AnswerInlineQuery\(ctx context.Context, b \*client.Bot, p \*AnswerInlineQueryParams\) \(bool, error\)](<#AnswerInlineQuery>) - [func AnswerPreCheckoutQuery\(ctx context.Context, b \*client.Bot, p \*AnswerPreCheckoutQueryParams\) \(bool, error\)](<#AnswerPreCheckoutQuery>) - [func AnswerShippingQuery\(ctx context.Context, b \*client.Bot, p \*AnswerShippingQueryParams\) \(bool, error\)](<#AnswerShippingQuery>) +- [func AnswerWidgetQuery\(ctx context.Context, b \*client.Bot, p \*AnswerWidgetQueryParams\) \(bool, error\)](<#AnswerWidgetQuery>) - [func ApproveChatJoinRequest\(ctx context.Context, b \*client.Bot, p \*ApproveChatJoinRequestParams\) \(bool, error\)](<#ApproveChatJoinRequest>) - [func ApproveSuggestedPost\(ctx context.Context, b \*client.Bot, p \*ApproveSuggestedPostParams\) \(bool, error\)](<#ApproveSuggestedPost>) - [func BanChatMember\(ctx context.Context, b \*client.Bot, p \*BanChatMemberParams\) \(bool, error\)](<#BanChatMember>) @@ -35,6 +36,7 @@ Package api contains the Telegram Bot API object types and method wrappers, gene - [func DeclineChatJoinRequest\(ctx context.Context, b \*client.Bot, p \*DeclineChatJoinRequestParams\) \(bool, error\)](<#DeclineChatJoinRequest>) - [func DeclineSuggestedPost\(ctx context.Context, b \*client.Bot, p \*DeclineSuggestedPostParams\) \(bool, error\)](<#DeclineSuggestedPost>) - [func DeleteAllMessageReactions\(ctx context.Context, b \*client.Bot, p \*DeleteAllMessageReactionsParams\) \(bool, error\)](<#DeleteAllMessageReactions>) +- [func DeleteBusinessAccountGift\(ctx context.Context, b \*client.Bot, p \*DeleteBusinessAccountGiftParams\) \(bool, error\)](<#DeleteBusinessAccountGift>) - [func DeleteBusinessMessages\(ctx context.Context, b \*client.Bot, p \*DeleteBusinessMessagesParams\) \(bool, error\)](<#DeleteBusinessMessages>) - [func DeleteChatPhoto\(ctx context.Context, b \*client.Bot, p \*DeleteChatPhotoParams\) \(bool, error\)](<#DeleteChatPhoto>) - [func DeleteChatStickerSet\(ctx context.Context, b \*client.Bot, p \*DeleteChatStickerSetParams\) \(bool, error\)](<#DeleteChatStickerSet>) @@ -55,6 +57,13 @@ Package api contains the Telegram Bot API object types and method wrappers, gene - [func EditEphemeralMessageText\(ctx context.Context, b \*client.Bot, p \*EditEphemeralMessageTextParams\) \(bool, error\)](<#EditEphemeralMessageText>) - [func EditForumTopic\(ctx context.Context, b \*client.Bot, p \*EditForumTopicParams\) \(bool, error\)](<#EditForumTopic>) - [func EditGeneralForumTopic\(ctx context.Context, b \*client.Bot, p \*EditGeneralForumTopicParams\) \(bool, error\)](<#EditGeneralForumTopic>) +- [func EditMessageCaption\(ctx context.Context, b \*client.Bot, p \*EditMessageCaptionParams\) \(bool, error\)](<#EditMessageCaption>) +- [func EditMessageLiveLocation\(ctx context.Context, b \*client.Bot, p \*EditMessageLiveLocationParams\) \(bool, error\)](<#EditMessageLiveLocation>) +- [func EditMessageMedia\(ctx context.Context, b \*client.Bot, p \*EditMessageMediaParams\) \(bool, error\)](<#EditMessageMedia>) +- [func EditMessageReplyMarkup\(ctx context.Context, b \*client.Bot, p \*EditMessageReplyMarkupParams\) \(bool, error\)](<#EditMessageReplyMarkup>) +- [func EditMessageText\(ctx context.Context, b \*client.Bot, p \*EditMessageTextParams\) \(bool, error\)](<#EditMessageText>) +- [func EditMessageWidgetData\(ctx context.Context, b \*client.Bot, p \*EditMessageWidgetDataParams\) \(bool, error\)](<#EditMessageWidgetData>) +- [func EditSharedWidgetData\(ctx context.Context, b \*client.Bot, p \*EditSharedWidgetDataParams\) \(bool, error\)](<#EditSharedWidgetData>) - [func EditUserStarSubscription\(ctx context.Context, b \*client.Bot, p \*EditUserStarSubscriptionParams\) \(bool, error\)](<#EditUserStarSubscription>) - [func ExportChatInviteLink\(ctx context.Context, b \*client.Bot, p \*ExportChatInviteLinkParams\) \(string, error\)](<#ExportChatInviteLink>) - [func GetChatMemberCount\(ctx context.Context, b \*client.Bot, p \*GetChatMemberCountParams\) \(int64, error\)](<#GetChatMemberCount>) @@ -96,6 +105,7 @@ Package api contains the Telegram Bot API object types and method wrappers, gene - [func SetChatStickerSet\(ctx context.Context, b \*client.Bot, p \*SetChatStickerSetParams\) \(bool, error\)](<#SetChatStickerSet>) - [func SetChatTitle\(ctx context.Context, b \*client.Bot, p \*SetChatTitleParams\) \(bool, error\)](<#SetChatTitle>) - [func SetCustomEmojiStickerSetThumbnail\(ctx context.Context, b \*client.Bot, p \*SetCustomEmojiStickerSetThumbnailParams\) \(bool, error\)](<#SetCustomEmojiStickerSetThumbnail>) +- [func SetGameScore\(ctx context.Context, b \*client.Bot, p \*SetGameScoreParams\) \(bool, error\)](<#SetGameScore>) - [func SetManagedBotAccessSettings\(ctx context.Context, b \*client.Bot, p \*SetManagedBotAccessSettingsParams\) \(bool, error\)](<#SetManagedBotAccessSettings>) - [func SetMessageReaction\(ctx context.Context, b \*client.Bot, p \*SetMessageReactionParams\) \(bool, error\)](<#SetMessageReaction>) - [func SetMyCommands\(ctx context.Context, b \*client.Bot, p \*SetMyCommandsParams\) \(bool, error\)](<#SetMyCommands>) @@ -103,6 +113,7 @@ Package api contains the Telegram Bot API object types and method wrappers, gene - [func SetMyDescription\(ctx context.Context, b \*client.Bot, p \*SetMyDescriptionParams\) \(bool, error\)](<#SetMyDescription>) - [func SetMyName\(ctx context.Context, b \*client.Bot, p \*SetMyNameParams\) \(bool, error\)](<#SetMyName>) - [func SetMyProfilePhoto\(ctx context.Context, b \*client.Bot, p \*SetMyProfilePhotoParams\) \(bool, error\)](<#SetMyProfilePhoto>) +- [func SetMySettings\(ctx context.Context, b \*client.Bot, p \*SetMySettingsParams\) \(bool, error\)](<#SetMySettings>) - [func SetMyShortDescription\(ctx context.Context, b \*client.Bot, p \*SetMyShortDescriptionParams\) \(bool, error\)](<#SetMyShortDescription>) - [func SetPassportDataErrors\(ctx context.Context, b \*client.Bot, p \*SetPassportDataErrorsParams\) \(bool, error\)](<#SetPassportDataErrors>) - [func SetStickerEmojiList\(ctx context.Context, b \*client.Bot, p \*SetStickerEmojiListParams\) \(bool, error\)](<#SetStickerEmojiList>) @@ -113,6 +124,7 @@ Package api contains the Telegram Bot API object types and method wrappers, gene - [func SetStickerSetTitle\(ctx context.Context, b \*client.Bot, p \*SetStickerSetTitleParams\) \(bool, error\)](<#SetStickerSetTitle>) - [func SetUserEmojiStatus\(ctx context.Context, b \*client.Bot, p \*SetUserEmojiStatusParams\) \(bool, error\)](<#SetUserEmojiStatus>) - [func SetWebhook\(ctx context.Context, b \*client.Bot, p \*SetWebhookParams\) \(bool, error\)](<#SetWebhook>) +- [func StopMessageLiveLocation\(ctx context.Context, b \*client.Bot, p \*StopMessageLiveLocationParams\) \(bool, error\)](<#StopMessageLiveLocation>) - [func TransferBusinessAccountStars\(ctx context.Context, b \*client.Bot, p \*TransferBusinessAccountStarsParams\) \(bool, error\)](<#TransferBusinessAccountStars>) - [func TransferGift\(ctx context.Context, b \*client.Bot, p \*TransferGiftParams\) \(bool, error\)](<#TransferGift>) - [func UnbanChatMember\(ctx context.Context, b \*client.Bot, p \*UnbanChatMemberParams\) \(bool, error\)](<#UnbanChatMember>) @@ -136,8 +148,10 @@ Package api contains the Telegram Bot API object types and method wrappers, gene - [type AnswerPreCheckoutQueryParams](<#AnswerPreCheckoutQueryParams>) - [type AnswerShippingQueryParams](<#AnswerShippingQueryParams>) - [type AnswerWebAppQueryParams](<#AnswerWebAppQueryParams>) +- [type AnswerWidgetQueryParams](<#AnswerWidgetQueryParams>) - [type ApproveChatJoinRequestParams](<#ApproveChatJoinRequestParams>) - [type ApproveSuggestedPostParams](<#ApproveSuggestedPostParams>) +- [type AreaPosition](<#AreaPosition>) - [type Audio](<#Audio>) - [type BackgroundFill](<#BackgroundFill>) - [func UnmarshalBackgroundFill\(data \[\]byte\) \(BackgroundFill, error\)](<#UnmarshalBackgroundFill>) @@ -187,6 +201,8 @@ Package api contains the Telegram Bot API object types and method wrappers, gene - [type BotCommandScopeType](<#BotCommandScopeType>) - [type BotDescription](<#BotDescription>) - [func GetMyDescription\(ctx context.Context, b \*client.Bot, p \*GetMyDescriptionParams\) \(\*BotDescription, error\)](<#GetMyDescription>) +- [type BotFullInfo](<#BotFullInfo>) + - [func GetMe\(ctx context.Context, b \*client.Bot, p \*GetMeParams\) \(\*BotFullInfo, error\)](<#GetMe>) - [type BotName](<#BotName>) - [func GetMyName\(ctx context.Context, b \*client.Bot, p \*GetMyNameParams\) \(\*BotName, error\)](<#GetMyName>) - [type BotShortDescription](<#BotShortDescription>) @@ -204,6 +220,7 @@ Package api contains the Telegram Bot API object types and method wrappers, gene - [type CallbackGame](<#CallbackGame>) - [type CallbackQuery](<#CallbackQuery>) - [func \(m \*CallbackQuery\) UnmarshalJSON\(data \[\]byte\) error](<#CallbackQuery.UnmarshalJSON>) +- [type CallbackQueryMode](<#CallbackQueryMode>) - [type Chat](<#Chat>) - [type ChatAdministratorRights](<#ChatAdministratorRights>) - [func GetMyDefaultAdministratorRights\(ctx context.Context, b \*client.Bot, p \*GetMyDefaultAdministratorRightsParams\) \(\*ChatAdministratorRights, error\)](<#GetMyDefaultAdministratorRights>) @@ -265,6 +282,17 @@ Package api contains the Telegram Bot API object types and method wrappers, gene - [type ChatOwnerLeft](<#ChatOwnerLeft>) - [type ChatPermissions](<#ChatPermissions>) - [type ChatPhoto](<#ChatPhoto>) +- [type ChatShareTheme](<#ChatShareTheme>) + - [func UnmarshalChatShareTheme\(data \[\]byte\) \(ChatShareTheme, error\)](<#UnmarshalChatShareTheme>) +- [type ChatShareThemeBackdrop](<#ChatShareThemeBackdrop>) +- [type ChatShareThemeBackdrops](<#ChatShareThemeBackdrops>) + - [func GetChatShareThemeBackdrops\(ctx context.Context, b \*client.Bot, p \*GetChatShareThemeBackdropsParams\) \(\*ChatShareThemeBackdrops, error\)](<#GetChatShareThemeBackdrops>) +- [type ChatShareThemeEmoji](<#ChatShareThemeEmoji>) + - [func \(v \*ChatShareThemeEmoji\) MarshalJSON\(\) \(\[\]byte, error\)](<#ChatShareThemeEmoji.MarshalJSON>) + - [func \(m \*ChatShareThemeEmoji\) UnmarshalJSON\(data \[\]byte\) error](<#ChatShareThemeEmoji.UnmarshalJSON>) +- [type ChatShareThemeType](<#ChatShareThemeType>) +- [type ChatShareThemeUniqueGift](<#ChatShareThemeUniqueGift>) + - [func \(v \*ChatShareThemeUniqueGift\) MarshalJSON\(\) \(\[\]byte, error\)](<#ChatShareThemeUniqueGift.MarshalJSON>) - [type ChatShared](<#ChatShared>) - [type ChatType](<#ChatType>) - [type Checklist](<#Checklist>) @@ -292,6 +320,7 @@ Package api contains the Telegram Bot API object types and method wrappers, gene - [type DeclineChatJoinRequestParams](<#DeclineChatJoinRequestParams>) - [type DeclineSuggestedPostParams](<#DeclineSuggestedPostParams>) - [type DeleteAllMessageReactionsParams](<#DeleteAllMessageReactionsParams>) +- [type DeleteBusinessAccountGiftParams](<#DeleteBusinessAccountGiftParams>) - [type DeleteBusinessMessagesParams](<#DeleteBusinessMessagesParams>) - [type DeleteChatPhotoParams](<#DeleteChatPhotoParams>) - [type DeleteChatStickerSetParams](<#DeleteChatStickerSetParams>) @@ -331,8 +360,17 @@ Package api contains the Telegram Bot API object types and method wrappers, gene - [func \(p \*EditMessageMediaParams\) MultipartFiles\(\) \[\]client.MultipartFile](<#EditMessageMediaParams.MultipartFiles>) - [type EditMessageReplyMarkupParams](<#EditMessageReplyMarkupParams>) - [type EditMessageTextParams](<#EditMessageTextParams>) +- [type EditMessageWidgetDataParams](<#EditMessageWidgetDataParams>) +- [type EditSharedWidgetDataParams](<#EditSharedWidgetDataParams>) - [type EditStoryParams](<#EditStoryParams>) - [type EditUserStarSubscriptionParams](<#EditUserStarSubscriptionParams>) +- [type EmojiType](<#EmojiType>) + - [func UnmarshalEmojiType\(data \[\]byte\) \(EmojiType, error\)](<#UnmarshalEmojiType>) +- [type EmojiTypeCustomEmoji](<#EmojiTypeCustomEmoji>) + - [func \(v \*EmojiTypeCustomEmoji\) MarshalJSON\(\) \(\[\]byte, error\)](<#EmojiTypeCustomEmoji.MarshalJSON>) +- [type EmojiTypeEmoji](<#EmojiTypeEmoji>) + - [func \(v \*EmojiTypeEmoji\) MarshalJSON\(\) \(\[\]byte, error\)](<#EmojiTypeEmoji.MarshalJSON>) +- [type EmojiTypeKind](<#EmojiTypeKind>) - [type EncryptedCredentials](<#EncryptedCredentials>) - [type EncryptedPassportElement](<#EncryptedPassportElement>) - [type EncryptedPassportElementType](<#EncryptedPassportElementType>) @@ -368,6 +406,7 @@ Package api contains the Telegram Bot API object types and method wrappers, gene - [type GetChatMemberParams](<#GetChatMemberParams>) - [type GetChatMenuButtonParams](<#GetChatMenuButtonParams>) - [type GetChatParams](<#GetChatParams>) +- [type GetChatShareThemeBackdropsParams](<#GetChatShareThemeBackdropsParams>) - [type GetCustomEmojiStickersParams](<#GetCustomEmojiStickersParams>) - [type GetFileParams](<#GetFileParams>) - [type GetForumTopicIconStickersParams](<#GetForumTopicIconStickersParams>) @@ -383,6 +422,7 @@ Package api contains the Telegram Bot API object types and method wrappers, gene - [type GetMyStarBalanceParams](<#GetMyStarBalanceParams>) - [type GetStarTransactionsParams](<#GetStarTransactionsParams>) - [type GetStickerSetParams](<#GetStickerSetParams>) +- [type GetUniqueGiftParams](<#GetUniqueGiftParams>) - [type GetUpdatesParams](<#GetUpdatesParams>) - [type GetUserChatBoostsParams](<#GetUserChatBoostsParams>) - [type GetUserGiftsParams](<#GetUserGiftsParams>) @@ -577,6 +617,7 @@ Package api contains the Telegram Bot API object types and method wrappers, gene - [func \(m \*InputRichMessage\) UnmarshalJSON\(data \[\]byte\) error](<#InputRichMessage.UnmarshalJSON>) - [type InputRichMessageContent](<#InputRichMessageContent>) - [type InputRichMessageMedia](<#InputRichMessageMedia>) +- [type InputSharedWidgetMessageContent](<#InputSharedWidgetMessageContent>) - [type InputSticker](<#InputSticker>) - [type InputStickerFormat](<#InputStickerFormat>) - [type InputStoryContent](<#InputStoryContent>) @@ -588,6 +629,7 @@ Package api contains the Telegram Bot API object types and method wrappers, gene - [func \(v \*InputStoryContentVideo\) MarshalJSON\(\) \(\[\]byte, error\)](<#InputStoryContentVideo.MarshalJSON>) - [type InputTextMessageContent](<#InputTextMessageContent>) - [type InputVenueMessageContent](<#InputVenueMessageContent>) +- [type InputWidgetMessageContent](<#InputWidgetMessageContent>) - [type Invoice](<#Invoice>) - [type KeyboardButton](<#KeyboardButton>) - [type KeyboardButtonPollType](<#KeyboardButtonPollType>) @@ -611,7 +653,7 @@ Package api contains the Telegram Bot API object types and method wrappers, gene - [type MaybeInaccessibleMessage](<#MaybeInaccessibleMessage>) - [func UnmarshalMaybeInaccessibleMessage\(data \[\]byte\) \(MaybeInaccessibleMessage, error\)](<#UnmarshalMaybeInaccessibleMessage>) - [type MeCache](<#MeCache>) - - [func \(c \*MeCache\) Get\(ctx context.Context, b \*client.Bot\) \(\*User, error\)](<#MeCache.Get>) + - [func \(c \*MeCache\) Get\(ctx context.Context, b \*client.Bot\) \(\*BotFullInfo, error\)](<#MeCache.Get>) - [func \(c \*MeCache\) Reset\(\)](<#MeCache.Reset>) - [type MenuButton](<#MenuButton>) - [func GetChatMenuButton\(ctx context.Context, b \*client.Bot, p \*GetChatMenuButtonParams\) \(MenuButton, error\)](<#GetChatMenuButton>) @@ -643,11 +685,13 @@ Package api contains the Telegram Bot API object types and method wrappers, gene - [func SendPhoto\(ctx context.Context, b \*client.Bot, p \*SendPhotoParams\) \(\*Message, error\)](<#SendPhoto>) - [func SendPoll\(ctx context.Context, b \*client.Bot, p \*SendPollParams\) \(\*Message, error\)](<#SendPoll>) - [func SendRichMessage\(ctx context.Context, b \*client.Bot, p \*SendRichMessageParams\) \(\*Message, error\)](<#SendRichMessage>) + - [func SendSharedWidget\(ctx context.Context, b \*client.Bot, p \*SendSharedWidgetParams\) \(\*Message, error\)](<#SendSharedWidget>) - [func SendSticker\(ctx context.Context, b \*client.Bot, p \*SendStickerParams\) \(\*Message, error\)](<#SendSticker>) - [func SendVenue\(ctx context.Context, b \*client.Bot, p \*SendVenueParams\) \(\*Message, error\)](<#SendVenue>) - [func SendVideo\(ctx context.Context, b \*client.Bot, p \*SendVideoParams\) \(\*Message, error\)](<#SendVideo>) - [func SendVideoNote\(ctx context.Context, b \*client.Bot, p \*SendVideoNoteParams\) \(\*Message, error\)](<#SendVideoNote>) - [func SendVoice\(ctx context.Context, b \*client.Bot, p \*SendVoiceParams\) \(\*Message, error\)](<#SendVoice>) + - [func SendWidget\(ctx context.Context, b \*client.Bot, p \*SendWidgetParams\) \(\*Message, error\)](<#SendWidget>) - [func \(m \*Message\) GetSender\(\) \*Sender](<#Message.GetSender>) - [func \(m \*Message\) UnmarshalJSON\(data \[\]byte\) error](<#Message.UnmarshalJSON>) - [type MessageAutoDeleteTimerChanged](<#MessageAutoDeleteTimerChanged>) @@ -659,13 +703,6 @@ Package api contains the Telegram Bot API object types and method wrappers, gene - [func CopyMessages\(ctx context.Context, b \*client.Bot, p \*CopyMessagesParams\) \(\[\]MessageId, error\)](<#CopyMessages>) - [func ForwardMessages\(ctx context.Context, b \*client.Bot, p \*ForwardMessagesParams\) \(\[\]MessageId, error\)](<#ForwardMessages>) - [type MessageOrBool](<#MessageOrBool>) - - [func EditMessageCaption\(ctx context.Context, b \*client.Bot, p \*EditMessageCaptionParams\) \(\*MessageOrBool, error\)](<#EditMessageCaption>) - - [func EditMessageLiveLocation\(ctx context.Context, b \*client.Bot, p \*EditMessageLiveLocationParams\) \(\*MessageOrBool, error\)](<#EditMessageLiveLocation>) - - [func EditMessageMedia\(ctx context.Context, b \*client.Bot, p \*EditMessageMediaParams\) \(\*MessageOrBool, error\)](<#EditMessageMedia>) - - [func EditMessageReplyMarkup\(ctx context.Context, b \*client.Bot, p \*EditMessageReplyMarkupParams\) \(\*MessageOrBool, error\)](<#EditMessageReplyMarkup>) - - [func EditMessageText\(ctx context.Context, b \*client.Bot, p \*EditMessageTextParams\) \(\*MessageOrBool, error\)](<#EditMessageText>) - - [func SetGameScore\(ctx context.Context, b \*client.Bot, p \*SetGameScoreParams\) \(\*MessageOrBool, error\)](<#SetGameScore>) - - [func StopMessageLiveLocation\(ctx context.Context, b \*client.Bot, p \*StopMessageLiveLocationParams\) \(\*MessageOrBool, error\)](<#StopMessageLiveLocation>) - [func \(m \*MessageOrBool\) UnmarshalJSON\(data \[\]byte\) error](<#MessageOrBool.UnmarshalJSON>) - [type MessageOrigin](<#MessageOrigin>) - [func UnmarshalMessageOrigin\(data \[\]byte\) \(MessageOrigin, error\)](<#UnmarshalMessageOrigin>) @@ -710,6 +747,7 @@ Package api contains the Telegram Bot API object types and method wrappers, gene - [type PaidMediaVideo](<#PaidMediaVideo>) - [func \(v \*PaidMediaVideo\) MarshalJSON\(\) \(\[\]byte, error\)](<#PaidMediaVideo.MarshalJSON>) - [type PaidMessagePriceChanged](<#PaidMessagePriceChanged>) +- [type PaidMessagesWaived](<#PaidMessagesWaived>) - [type ParseMode](<#ParseMode>) - [type PassportData](<#PassportData>) - [type PassportElementError](<#PassportElementError>) @@ -787,6 +825,7 @@ Package api contains the Telegram Bot API object types and method wrappers, gene - [type ReplyKeyboardMarkup](<#ReplyKeyboardMarkup>) - [type ReplyKeyboardRemove](<#ReplyKeyboardRemove>) - [type ReplyParameters](<#ReplyParameters>) + - [func \(m \*ReplyParameters\) UnmarshalJSON\(data \[\]byte\) error](<#ReplyParameters.UnmarshalJSON>) - [type RepostStoryParams](<#RepostStoryParams>) - [type ResponseParameters](<#ResponseParameters>) - [type RestrictChatMemberParams](<#RestrictChatMemberParams>) @@ -952,6 +991,9 @@ Package api contains the Telegram Bot API object types and method wrappers, gene - [type RichTextTextMention](<#RichTextTextMention>) - [func \(v \*RichTextTextMention\) MarshalJSON\(\) \(\[\]byte, error\)](<#RichTextTextMention.MarshalJSON>) - [func \(m \*RichTextTextMention\) UnmarshalJSON\(data \[\]byte\) error](<#RichTextTextMention.UnmarshalJSON>) +- [type RichTextTonAddress](<#RichTextTonAddress>) + - [func \(v \*RichTextTonAddress\) MarshalJSON\(\) \(\[\]byte, error\)](<#RichTextTonAddress.MarshalJSON>) + - [func \(m \*RichTextTonAddress\) UnmarshalJSON\(data \[\]byte\) error](<#RichTextTonAddress.UnmarshalJSON>) - [type RichTextType](<#RichTextType>) - [type RichTextUnderline](<#RichTextUnderline>) - [func \(v \*RichTextUnderline\) MarshalJSON\(\) \(\[\]byte, error\)](<#RichTextUnderline.MarshalJSON>) @@ -1003,6 +1045,7 @@ Package api contains the Telegram Bot API object types and method wrappers, gene - [type SendPollParams](<#SendPollParams>) - [type SendRichMessageDraftParams](<#SendRichMessageDraftParams>) - [type SendRichMessageParams](<#SendRichMessageParams>) +- [type SendSharedWidgetParams](<#SendSharedWidgetParams>) - [type SendStickerParams](<#SendStickerParams>) - [func \(p \*SendStickerParams\) HasFile\(\) bool](<#SendStickerParams.HasFile>) - [func \(p \*SendStickerParams\) MultipartFields\(\) map\[string\]string](<#SendStickerParams.MultipartFields>) @@ -1020,6 +1063,7 @@ Package api contains the Telegram Bot API object types and method wrappers, gene - [func \(p \*SendVoiceParams\) HasFile\(\) bool](<#SendVoiceParams.HasFile>) - [func \(p \*SendVoiceParams\) MultipartFields\(\) map\[string\]string](<#SendVoiceParams.MultipartFields>) - [func \(p \*SendVoiceParams\) MultipartFiles\(\) \[\]client.MultipartFile](<#SendVoiceParams.MultipartFiles>) +- [type SendWidgetParams](<#SendWidgetParams>) - [type Sender](<#Sender>) - [func \(s \*Sender\) ID\(\) int64](<#Sender.ID>) - [func \(s \*Sender\) IsAnonymousAdmin\(\) bool](<#Sender.IsAnonymousAdmin>) @@ -1053,6 +1097,7 @@ Package api contains the Telegram Bot API object types and method wrappers, gene - [type SetMyDescriptionParams](<#SetMyDescriptionParams>) - [type SetMyNameParams](<#SetMyNameParams>) - [type SetMyProfilePhotoParams](<#SetMyProfilePhotoParams>) +- [type SetMySettingsParams](<#SetMySettingsParams>) - [type SetMyShortDescriptionParams](<#SetMyShortDescriptionParams>) - [type SetPassportDataErrorsParams](<#SetPassportDataErrorsParams>) - [type SetStickerEmojiListParams](<#SetStickerEmojiListParams>) @@ -1070,6 +1115,8 @@ Package api contains the Telegram Bot API object types and method wrappers, gene - [func \(p \*SetWebhookParams\) MultipartFields\(\) map\[string\]string](<#SetWebhookParams.MultipartFields>) - [func \(p \*SetWebhookParams\) MultipartFiles\(\) \[\]client.MultipartFile](<#SetWebhookParams.MultipartFiles>) - [type SharedUser](<#SharedUser>) +- [type SharedWidgetQuery](<#SharedWidgetQuery>) + - [func \(m \*SharedWidgetQuery\) UnmarshalJSON\(data \[\]byte\) error](<#SharedWidgetQuery.UnmarshalJSON>) - [type ShippingAddress](<#ShippingAddress>) - [type ShippingOption](<#ShippingOption>) - [type ShippingQuery](<#ShippingQuery>) @@ -1094,7 +1141,6 @@ Package api contains the Telegram Bot API object types and method wrappers, gene - [func RepostStory\(ctx context.Context, b \*client.Bot, p \*RepostStoryParams\) \(\*Story, error\)](<#RepostStory>) - [type StoryArea](<#StoryArea>) - [func \(m \*StoryArea\) UnmarshalJSON\(data \[\]byte\) error](<#StoryArea.UnmarshalJSON>) -- [type StoryAreaPosition](<#StoryAreaPosition>) - [type StoryAreaType](<#StoryAreaType>) - [func UnmarshalStoryAreaType\(data \[\]byte\) \(StoryAreaType, error\)](<#UnmarshalStoryAreaType>) - [type StoryAreaTypeKind](<#StoryAreaTypeKind>) @@ -1123,6 +1169,12 @@ Package api contains the Telegram Bot API object types and method wrappers, gene - [type SuggestedPostRefundedReason](<#SuggestedPostRefundedReason>) - [type SwitchInlineQueryChosenChat](<#SwitchInlineQueryChosenChat>) - [type TextQuote](<#TextQuote>) + - [func \(m \*TextQuote\) UnmarshalJSON\(data \[\]byte\) error](<#TextQuote.UnmarshalJSON>) +- [type TonNft](<#TonNft>) +- [type TonNftAttribute](<#TonNftAttribute>) +- [type TonWalletCard](<#TonWalletCard>) +- [type TonWalletCardSticker](<#TonWalletCardSticker>) +- [type TonWalletTransfer](<#TonWalletTransfer>) - [type TransactionPartner](<#TransactionPartner>) - [func UnmarshalTransactionPartner\(data \[\]byte\) \(TransactionPartner, error\)](<#UnmarshalTransactionPartner>) - [type TransactionPartnerAffiliateProgram](<#TransactionPartnerAffiliateProgram>) @@ -1149,6 +1201,7 @@ Package api contains the Telegram Bot API object types and method wrappers, gene - [type UnbanChatSenderChatParams](<#UnbanChatSenderChatParams>) - [type UnhideGeneralForumTopicParams](<#UnhideGeneralForumTopicParams>) - [type UniqueGift](<#UniqueGift>) + - [func GetUniqueGift\(ctx context.Context, b \*client.Bot, p \*GetUniqueGiftParams\) \(\*UniqueGift, error\)](<#GetUniqueGift>) - [type UniqueGiftBackdrop](<#UniqueGiftBackdrop>) - [type UniqueGiftBackdropColors](<#UniqueGiftBackdropColors>) - [type UniqueGiftColors](<#UniqueGiftColors>) @@ -1170,7 +1223,6 @@ Package api contains the Telegram Bot API object types and method wrappers, gene - [func \(p \*UploadStickerFileParams\) MultipartFields\(\) map\[string\]string](<#UploadStickerFileParams.MultipartFields>) - [func \(p \*UploadStickerFileParams\) MultipartFiles\(\) \[\]client.MultipartFile](<#UploadStickerFileParams.MultipartFiles>) - [type User](<#User>) - - [func GetMe\(ctx context.Context, b \*client.Bot, p \*GetMeParams\) \(\*User, error\)](<#GetMe>) - [type UserChatBoosts](<#UserChatBoosts>) - [func GetUserChatBoosts\(ctx context.Context, b \*client.Bot, p \*GetUserChatBoostsParams\) \(\*UserChatBoosts, error\)](<#GetUserChatBoosts>) - [type UserProfileAudios](<#UserProfileAudios>) @@ -1194,11 +1246,24 @@ Package api contains the Telegram Bot API object types and method wrappers, gene - [type WebAppInfo](<#WebAppInfo>) - [type WebhookInfo](<#WebhookInfo>) - [func GetWebhookInfo\(ctx context.Context, b \*client.Bot, p \*GetWebhookInfoParams\) \(\*WebhookInfo, error\)](<#GetWebhookInfo>) +- [type Widget](<#Widget>) +- [type WidgetQuery](<#WidgetQuery>) + - [func \(m \*WidgetQuery\) UnmarshalJSON\(data \[\]byte\) error](<#WidgetQuery.UnmarshalJSON>) +- [type WidgetQueryType](<#WidgetQueryType>) + - [func UnmarshalWidgetQueryType\(data \[\]byte\) \(WidgetQueryType, error\)](<#UnmarshalWidgetQueryType>) +- [type WidgetQueryTypeData](<#WidgetQueryTypeData>) + - [func \(v \*WidgetQueryTypeData\) MarshalJSON\(\) \(\[\]byte, error\)](<#WidgetQueryTypeData.MarshalJSON>) +- [type WidgetQueryTypeKind](<#WidgetQueryTypeKind>) +- [type WidgetQueryTypeSentTransaction](<#WidgetQueryTypeSentTransaction>) + - [func \(v \*WidgetQueryTypeSentTransaction\) MarshalJSON\(\) \(\[\]byte, error\)](<#WidgetQueryTypeSentTransaction.MarshalJSON>) +- [type WidgetQueryTypeSignData](<#WidgetQueryTypeSignData>) + - [func \(v \*WidgetQueryTypeSignData\) MarshalJSON\(\) \(\[\]byte, error\)](<#WidgetQueryTypeSignData.MarshalJSON>) +- [type WidgetQueryWallet](<#WidgetQueryWallet>) - [type WriteAccessAllowed](<#WriteAccessAllowed>) -## func [AddStickerToSet]() +## func [AddStickerToSet]() ```go func AddStickerToSet(ctx context.Context, b *client.Bot, p *AddStickerToSetParams) (bool, error) @@ -1209,7 +1274,7 @@ AddStickerToSet calls the addStickerToSet Telegram Bot API method. Use 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. -## func [AnswerCallbackQuery]() +## func [AnswerCallbackQuery]() ```go func AnswerCallbackQuery(ctx context.Context, b *client.Bot, p *AnswerCallbackQueryParams) (bool, error) @@ -1217,10 +1282,10 @@ func AnswerCallbackQuery(ctx context.Context, b *client.Bot, p *AnswerCallbackQu AnswerCallbackQuery calls the answerCallbackQuery Telegram Bot API method. -Use 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. Alternatively, the user can be redirected to the specified Game URL. For this option to work, you must first create a game for your bot via @BotFather and accept the terms. Otherwise, you may use links like t.me/your\_bot?start=XXXX that open your bot with a parameter. +Use this method to send answers to callback queries sent from inline keyboards or rich messages. 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. Alternatively, the user can be redirected to the specified Game URL. For this option to work, you must first create a game for your bot via @BotFather and accept the terms. Otherwise, you may use links like t.me/your\_bot?start=XXXX that open your bot with a parameter. -## func [AnswerChatJoinRequestQuery]() +## func [AnswerChatJoinRequestQuery]() ```go func AnswerChatJoinRequestQuery(ctx context.Context, b *client.Bot, p *AnswerChatJoinRequestQueryParams) (bool, error) @@ -1231,7 +1296,7 @@ AnswerChatJoinRequestQuery calls the answerChatJoinRequestQuery Telegram Bot API Use this method to process a received chat join request query. Returns True on success. -## func [AnswerInlineQuery]() +## func [AnswerInlineQuery]() ```go func AnswerInlineQuery(ctx context.Context, b *client.Bot, p *AnswerInlineQueryParams) (bool, error) @@ -1242,7 +1307,7 @@ AnswerInlineQuery calls the answerInlineQuery Telegram Bot API method. Use this method to send answers to an inline query. On success, True is returned.No more than 50 results per query are allowed. -## func [AnswerPreCheckoutQuery]() +## func [AnswerPreCheckoutQuery]() ```go func AnswerPreCheckoutQuery(ctx context.Context, b *client.Bot, p *AnswerPreCheckoutQueryParams) (bool, error) @@ -1253,7 +1318,7 @@ AnswerPreCheckoutQuery calls the answerPreCheckoutQuery Telegram Bot API method. Once 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 queries. On success, True is returned. Note: The Bot API must receive an answer within 10 seconds after the pre\-checkout query was sent. -## func [AnswerShippingQuery]() +## func [AnswerShippingQuery]() ```go func AnswerShippingQuery(ctx context.Context, b *client.Bot, p *AnswerShippingQueryParams) (bool, error) @@ -1263,8 +1328,19 @@ AnswerShippingQuery calls the answerShippingQuery Telegram Bot API method. If 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 success, True is returned. + +## func [AnswerWidgetQuery]() + +```go +func AnswerWidgetQuery(ctx context.Context, b *client.Bot, p *AnswerWidgetQueryParams) (bool, error) +``` + +AnswerWidgetQuery calls the answerWidgetQuery Telegram Bot API method. + +Use 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 editMessageWidgetData or editSharedWidgetData to change it. On success, True is returned. + -## func [ApproveChatJoinRequest]() +## func [ApproveChatJoinRequest]() ```go func ApproveChatJoinRequest(ctx context.Context, b *client.Bot, p *ApproveChatJoinRequestParams) (bool, error) @@ -1275,7 +1351,7 @@ ApproveChatJoinRequest calls the approveChatJoinRequest Telegram Bot API method. Use 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. -## func [ApproveSuggestedPost]() +## func [ApproveSuggestedPost]() ```go func ApproveSuggestedPost(ctx context.Context, b *client.Bot, p *ApproveSuggestedPostParams) (bool, error) @@ -1286,7 +1362,7 @@ ApproveSuggestedPost calls the approveSuggestedPost Telegram Bot API method. Use 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. -## func [BanChatMember]() +## func [BanChatMember]() ```go func BanChatMember(ctx context.Context, b *client.Bot, p *BanChatMemberParams) (bool, error) @@ -1297,7 +1373,7 @@ BanChatMember calls the banChatMember Telegram Bot API method. Use 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. The bot must be an administrator in the chat for this to work and must have the appropriate administrator rights. Returns True on success. -## func [BanChatSenderChat]() +## func [BanChatSenderChat]() ```go func BanChatSenderChat(ctx context.Context, b *client.Bot, p *BanChatSenderChatParams) (bool, error) @@ -1319,7 +1395,7 @@ Close calls the close Telegram Bot API method. Use 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. The method will return error 429 in the first 10 minutes after the bot is launched. Returns True on success. Requires no parameters. -## func [CloseForumTopic]() +## func [CloseForumTopic]() ```go func CloseForumTopic(ctx context.Context, b *client.Bot, p *CloseForumTopicParams) (bool, error) @@ -1327,10 +1403,10 @@ func CloseForumTopic(ctx context.Context, b *client.Bot, p *CloseForumTopicParam CloseForumTopic calls the closeForumTopic Telegram Bot API method. -Use 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 topic. Returns True on success. +Use 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 right, unless it is the creator of the topic. Returns True on success. -## func [CloseGeneralForumTopic]() +## func [CloseGeneralForumTopic]() ```go func CloseGeneralForumTopic(ctx context.Context, b *client.Bot, p *CloseGeneralForumTopicParams) (bool, error) @@ -1338,10 +1414,10 @@ func CloseGeneralForumTopic(ctx context.Context, b *client.Bot, p *CloseGeneralF CloseGeneralForumTopic calls the closeGeneralForumTopic Telegram Bot API method. -Use 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 success. +Use 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 right. Returns True on success. -## func [ConvertGiftToStars]() +## func [ConvertGiftToStars]() ```go func ConvertGiftToStars(ctx context.Context, b *client.Bot, p *ConvertGiftToStarsParams) (bool, error) @@ -1352,7 +1428,7 @@ ConvertGiftToStars calls the convertGiftToStars Telegram Bot API method. Converts a given regular gift to Telegram Stars. Requires the can\_convert\_gifts\_to\_stars business bot right. Returns True on success. -## func [CreateInvoiceLink]() +## func [CreateInvoiceLink]() ```go func CreateInvoiceLink(ctx context.Context, b *client.Bot, p *CreateInvoiceLinkParams) (string, error) @@ -1363,7 +1439,7 @@ CreateInvoiceLink calls the createInvoiceLink Telegram Bot API method. Use this method to create a link for an invoice. Returns the created invoice link as String on success. -## func [CreateNewStickerSet]() +## func [CreateNewStickerSet]() ```go func CreateNewStickerSet(ctx context.Context, b *client.Bot, p *CreateNewStickerSetParams) (bool, error) @@ -1374,7 +1450,7 @@ CreateNewStickerSet calls the createNewStickerSet Telegram Bot API method. Use 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. -## func [DeclineChatJoinRequest]() +## func [DeclineChatJoinRequest]() ```go func DeclineChatJoinRequest(ctx context.Context, b *client.Bot, p *DeclineChatJoinRequestParams) (bool, error) @@ -1385,7 +1461,7 @@ DeclineChatJoinRequest calls the declineChatJoinRequest Telegram Bot API method. Use 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. -## func [DeclineSuggestedPost]() +## func [DeclineSuggestedPost]() ```go func DeclineSuggestedPost(ctx context.Context, b *client.Bot, p *DeclineSuggestedPostParams) (bool, error) @@ -1396,7 +1472,7 @@ DeclineSuggestedPost calls the declineSuggestedPost Telegram Bot API method. Use 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. -## func [DeleteAllMessageReactions]() +## func [DeleteAllMessageReactions]() ```go func DeleteAllMessageReactions(ctx context.Context, b *client.Bot, p *DeleteAllMessageReactionsParams) (bool, error) @@ -1406,8 +1482,19 @@ DeleteAllMessageReactions calls the deleteAllMessageReactions Telegram Bot API m Use 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. + +## func [DeleteBusinessAccountGift]() + +```go +func DeleteBusinessAccountGift(ctx context.Context, b *client.Bot, p *DeleteBusinessAccountGiftParams) (bool, error) +``` + +DeleteBusinessAccountGift calls the deleteBusinessAccountGift Telegram Bot API method. + +Deletes 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 total\_count of the Gift is omitted\) and wasn't refunded. Returns True on success. + -## func [DeleteBusinessMessages]() +## func [DeleteBusinessMessages]() ```go func DeleteBusinessMessages(ctx context.Context, b *client.Bot, p *DeleteBusinessMessagesParams) (bool, error) @@ -1415,10 +1502,10 @@ func DeleteBusinessMessages(ctx context.Context, b *client.Bot, p *DeleteBusines DeleteBusinessMessages calls the deleteBusinessMessages Telegram Bot API method. -Delete 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 message. Returns True on success. +Deletes 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 message. Returns True on success. -## func [DeleteChatPhoto]() +## func [DeleteChatPhoto]() ```go func DeleteChatPhoto(ctx context.Context, b *client.Bot, p *DeleteChatPhotoParams) (bool, error) @@ -1429,7 +1516,7 @@ DeleteChatPhoto calls the deleteChatPhoto Telegram Bot API method. Use 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 success. -## func [DeleteChatStickerSet]() +## func [DeleteChatStickerSet]() ```go func DeleteChatStickerSet(ctx context.Context, b *client.Bot, p *DeleteChatStickerSetParams) (bool, error) @@ -1440,7 +1527,7 @@ DeleteChatStickerSet calls the deleteChatStickerSet Telegram Bot API method. Use 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 optionally returned in getChat requests to check if the bot can use this method. Returns True on success. -## func [DeleteEphemeralMessage]() +## func [DeleteEphemeralMessage]() ```go func DeleteEphemeralMessage(ctx context.Context, b *client.Bot, p *DeleteEphemeralMessageParams) (bool, error) @@ -1451,7 +1538,7 @@ DeleteEphemeralMessage calls the deleteEphemeralMessage Telegram Bot API method. Use 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. -## func [DeleteForumTopic]() +## func [DeleteForumTopic]() ```go func DeleteForumTopic(ctx context.Context, b *client.Bot, p *DeleteForumTopicParams) (bool, error) @@ -1459,10 +1546,10 @@ func DeleteForumTopic(ctx context.Context, b *client.Bot, p *DeleteForumTopicPar DeleteForumTopic calls the deleteForumTopic Telegram Bot API method. -Use this method to delete a forum topic along with all its messages in a forum supergroup chat or a private chat with a user. 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\_delete\_messages administrator rights. Returns True on success. +Use this method to delete a forum topic along with all its messages in a forum supergroup chat or a private chat with a user. 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\_delete\_messages administrator right. Returns True on success. -## func [DeleteMessage]() +## func [DeleteMessage]() ```go func DeleteMessage(ctx context.Context, b *client.Bot, p *DeleteMessageParams) (bool, error) @@ -1470,10 +1557,10 @@ func DeleteMessage(ctx context.Context, b *client.Bot, p *DeleteMessageParams) ( DeleteMessage calls the deleteMessage Telegram Bot API method. -Use this method to delete a message, including service messages, with the following limitations:\- A message can only be deleted if it was sent less than 48 hours ago.\- Service messages about a supergroup, channel, or forum topic creation can't be deleted.\- A dice message in a private chat can only be deleted if it was sent more than 24 hours ago.\- Bots can delete outgoing messages in private chats, groups, and supergroups.\- Bots can delete incoming messages in private chats.\- Bots granted can\_post\_messages permissions can delete outgoing messages in channels.\- If the bot is an administrator of a group, it can delete any message there.\- If the bot has can\_delete\_messages administrator right in a supergroup or a channel, it can delete any message there.\- If the bot has can\_manage\_direct\_messages administrator right in a channel, it can delete any message in the corresponding direct messages chat.Returns True on success. +Use this method to delete a message, including service messages, with the following limitations:\- A message can only be deleted if it was sent less than 48 hours ago.\- Service messages about a supergroup, channel, or forum topic creation can't be deleted.\- A dice message in a private chat can only be deleted if it was sent more than 24 hours ago.\- Bots can delete outgoing messages in private chats, groups, and supergroups.\- Bots can delete incoming messages in private chats.\- Bots granted can\_post\_messages permissions can delete outgoing messages in channels.\- If the bot is an administrator of a group, it can delete any message there.\- If the bot has the can\_delete\_messages administrator right in a supergroup or a channel, it can delete any message there.\- If the bot has the can\_manage\_direct\_messages administrator right in a channel, it can delete any message in the corresponding direct messages chat.Returns True on success. -## func [DeleteMessageReaction]() +## func [DeleteMessageReaction]() ```go func DeleteMessageReaction(ctx context.Context, b *client.Bot, p *DeleteMessageReactionParams) (bool, error) @@ -1484,7 +1571,7 @@ DeleteMessageReaction calls the deleteMessageReaction Telegram Bot API method. Use 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. -## func [DeleteMessages]() +## func [DeleteMessages]() ```go func DeleteMessages(ctx context.Context, b *client.Bot, p *DeleteMessagesParams) (bool, error) @@ -1495,7 +1582,7 @@ DeleteMessages calls the deleteMessages Telegram Bot API method. Use this method to delete multiple messages simultaneously. If some of the specified messages can't be found, they are skipped. Returns True on success. -## func [DeleteMyCommands]() +## func [DeleteMyCommands]() ```go func DeleteMyCommands(ctx context.Context, b *client.Bot, p *DeleteMyCommandsParams) (bool, error) @@ -1506,7 +1593,7 @@ DeleteMyCommands calls the deleteMyCommands Telegram Bot API method. Use 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. -## func [DeleteStickerFromSet]() +## func [DeleteStickerFromSet]() ```go func DeleteStickerFromSet(ctx context.Context, b *client.Bot, p *DeleteStickerFromSetParams) (bool, error) @@ -1517,7 +1604,7 @@ DeleteStickerFromSet calls the deleteStickerFromSet Telegram Bot API method. Use this method to delete a sticker from a set created by the bot. Returns True on success. -## func [DeleteStickerSet]() +## func [DeleteStickerSet]() ```go func DeleteStickerSet(ctx context.Context, b *client.Bot, p *DeleteStickerSetParams) (bool, error) @@ -1528,7 +1615,7 @@ DeleteStickerSet calls the deleteStickerSet Telegram Bot API method. Use this method to delete a sticker set that was created by the bot. Returns True on success. -## func [DeleteStory]() +## func [DeleteStory]() ```go func DeleteStory(ctx context.Context, b *client.Bot, p *DeleteStoryParams) (bool, error) @@ -1559,7 +1646,7 @@ func DownloadFileByPath(ctx context.Context, b *client.Bot, filePath string) (io DownloadFileByPath fetches a file by its file\_path \(typically obtained from a prior File response\). Useful when the caller already has a \*File and wants to skip the GetFile round\-trip. -## func [EditEphemeralMessageCaption]() +## func [EditEphemeralMessageCaption]() ```go func EditEphemeralMessageCaption(ctx context.Context, b *client.Bot, p *EditEphemeralMessageCaptionParams) (bool, error) @@ -1570,7 +1657,7 @@ EditEphemeralMessageCaption calls the editEphemeralMessageCaption Telegram Bot A Use 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. -## func [EditEphemeralMessageMedia]() +## func [EditEphemeralMessageMedia]() ```go func EditEphemeralMessageMedia(ctx context.Context, b *client.Bot, p *EditEphemeralMessageMediaParams) (bool, error) @@ -1581,7 +1668,7 @@ EditEphemeralMessageMedia calls the editEphemeralMessageMedia Telegram Bot API m Use 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. -## func [EditEphemeralMessageReplyMarkup]() +## func [EditEphemeralMessageReplyMarkup]() ```go func EditEphemeralMessageReplyMarkup(ctx context.Context, b *client.Bot, p *EditEphemeralMessageReplyMarkupParams) (bool, error) @@ -1592,7 +1679,7 @@ EditEphemeralMessageReplyMarkup calls the editEphemeralMessageReplyMarkup Telegr Use 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. -## func [EditEphemeralMessageText]() +## func [EditEphemeralMessageText]() ```go func EditEphemeralMessageText(ctx context.Context, b *client.Bot, p *EditEphemeralMessageTextParams) (bool, error) @@ -1603,7 +1690,7 @@ EditEphemeralMessageText calls the editEphemeralMessageText Telegram Bot API met Use 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. -## func [EditForumTopic]() +## func [EditForumTopic]() ```go func EditForumTopic(ctx context.Context, b *client.Bot, p *EditForumTopicParams) (bool, error) @@ -1611,10 +1698,10 @@ func EditForumTopic(ctx context.Context, b *client.Bot, p *EditForumTopicParams) EditForumTopic calls the editForumTopic Telegram Bot API method. -Use 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 can\_manage\_topics administrator rights, unless it is the creator of the topic. Returns True on success. +Use this method to edit the 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 can\_manage\_topics administrator right, unless it is the creator of the topic. Returns True on success. -## func [EditGeneralForumTopic]() +## func [EditGeneralForumTopic]() ```go func EditGeneralForumTopic(ctx context.Context, b *client.Bot, p *EditGeneralForumTopicParams) (bool, error) @@ -1622,10 +1709,87 @@ func EditGeneralForumTopic(ctx context.Context, b *client.Bot, p *EditGeneralFor EditGeneralForumTopic calls the editGeneralForumTopic Telegram Bot API method. -Use 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 success. +Use 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 right. Returns True on success. + + +## func [EditMessageCaption]() + +```go +func EditMessageCaption(ctx context.Context, b *client.Bot, p *EditMessageCaptionParams) (bool, error) +``` + +EditMessageCaption calls the editMessageCaption Telegram Bot API method. + +Use 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 bot and do not contain an inline keyboard can only be edited within 48 hours from the time they were sent. + + +## func [EditMessageLiveLocation]() + +```go +func EditMessageLiveLocation(ctx context.Context, b *client.Bot, p *EditMessageLiveLocationParams) (bool, error) +``` + +EditMessageLiveLocation calls the editMessageLiveLocation Telegram Bot API method. + +Use 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 inline message, the edited Message is returned; otherwise, True is returned. + + +## func [EditMessageMedia]() + +```go +func EditMessageMedia(ctx context.Context, b *client.Bot, p *EditMessageMediaParams) (bool, error) +``` + +EditMessageMedia calls the editMessageMedia Telegram Bot API method. + +Use this method to edit animation, audio, document, live photo, photo, or video messages, or to replace a text or a rich message with media. If a message is part of a message album, then it can be edited only to an audio for audio albums, only to a document for document albums and to a photo, a live photo, or a video otherwise. When an inline message is edited, a new file can't be uploaded; use a previously uploaded file via its file\_id or specify a URL. 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 bot and do not contain an inline keyboard can only be edited within 48 hours from the time they were sent. + + +## func [EditMessageReplyMarkup]() + +```go +func EditMessageReplyMarkup(ctx context.Context, b *client.Bot, p *EditMessageReplyMarkupParams) (bool, error) +``` + +EditMessageReplyMarkup calls the editMessageReplyMarkup Telegram Bot API method. + +Use 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 not sent by the bot and do not contain an inline keyboard can only be edited within 48 hours from the time they were sent. + + +## func [EditMessageText]() + +```go +func EditMessageText(ctx context.Context, b *client.Bot, p *EditMessageTextParams) (bool, error) +``` + +EditMessageText calls the editMessageText Telegram Bot API method. + +Use 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 sent by the bot and do not contain an inline keyboard can only be edited within 48 hours from the time they were sent. + + +## func [EditMessageWidgetData]() + +```go +func EditMessageWidgetData(ctx context.Context, b *client.Bot, p *EditMessageWidgetDataParams) (bool, error) +``` + +EditMessageWidgetData calls the editMessageWidgetData Telegram Bot API method. + +Use 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. + + +## func [EditSharedWidgetData]() + +```go +func EditSharedWidgetData(ctx context.Context, b *client.Bot, p *EditSharedWidgetDataParams) (bool, error) +``` + +EditSharedWidgetData calls the editSharedWidgetData Telegram Bot API method. + +Use 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. -## func [EditUserStarSubscription]() +## func [EditUserStarSubscription]() ```go func EditUserStarSubscription(ctx context.Context, b *client.Bot, p *EditUserStarSubscriptionParams) (bool, error) @@ -1636,7 +1800,7 @@ EditUserStarSubscription calls the editUserStarSubscription Telegram Bot API met Allows the bot to cancel or re\-enable extension of a subscription paid in Telegram Stars. Returns True on success. -## func [ExportChatInviteLink]() +## func [ExportChatInviteLink]() ```go func ExportChatInviteLink(ctx context.Context, b *client.Bot, p *ExportChatInviteLinkParams) (string, error) @@ -1647,7 +1811,7 @@ ExportChatInviteLink calls the exportChatInviteLink Telegram Bot API method. Use 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 administrator rights. Returns the new invite link as String on success. Note: Each administrator in a chat generates their own invite links. Bots can't use invite links generated by other administrators. If you want your bot to work with invite links, it will need to generate its own link using exportChatInviteLink or by calling the getChat method. If your bot needs to generate a new primary invite link replacing its previous one, use exportChatInviteLink again. -## func [GetChatMemberCount]() +## func [GetChatMemberCount]() ```go func GetChatMemberCount(ctx context.Context, b *client.Bot, p *GetChatMemberCountParams) (int64, error) @@ -1658,7 +1822,7 @@ GetChatMemberCount calls the getChatMemberCount Telegram Bot API method. Use this method to get the number of members in a chat. Returns Integer on success. -## func [GetManagedBotToken]() +## func [GetManagedBotToken]() ```go func GetManagedBotToken(ctx context.Context, b *client.Bot, p *GetManagedBotTokenParams) (string, error) @@ -1669,7 +1833,7 @@ GetManagedBotToken calls the getManagedBotToken Telegram Bot API method. Use this method to get the token of a managed bot. Returns the token as String on success. -## func [GiftPremiumSubscription]() +## func [GiftPremiumSubscription]() ```go func GiftPremiumSubscription(ctx context.Context, b *client.Bot, p *GiftPremiumSubscriptionParams) (bool, error) @@ -1680,7 +1844,7 @@ GiftPremiumSubscription calls the giftPremiumSubscription Telegram Bot API metho Gifts a Telegram Premium subscription to the given user. Returns True on success. -## func [HideGeneralForumTopic]() +## func [HideGeneralForumTopic]() ```go func HideGeneralForumTopic(ctx context.Context, b *client.Bot, p *HideGeneralForumTopicParams) (bool, error) @@ -1688,10 +1852,10 @@ func HideGeneralForumTopic(ctx context.Context, b *client.Bot, p *HideGeneralFor HideGeneralForumTopic calls the hideGeneralForumTopic Telegram Bot API method. -Use 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 automatically closed if it was open. Returns True on success. +Use 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 right. The topic will be automatically closed if it was open. Returns True on success. -## func [LeaveChat]() +## func [LeaveChat]() ```go func LeaveChat(ctx context.Context, b *client.Bot, p *LeaveChatParams) (bool, error) @@ -1710,10 +1874,10 @@ func LogOut(ctx context.Context, b *client.Bot, p *LogOutParams) (bool, error) LogOut calls the logOut Telegram Bot API method. -Use 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 successful call, you can immediately log in on a local server, but will not be able to log in back to the cloud Bot API server for 10 minutes. Returns True on success. Requires no parameters. +Use 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 successful call, you can immediately log in on a local server, but will not be able to log back in to the cloud Bot API server for 10 minutes. Returns True on success. Requires no parameters. -## func [PinChatMessage]() +## func [PinChatMessage]() ```go func PinChatMessage(ctx context.Context, b *client.Bot, p *PinChatMessageParams) (bool, error) @@ -1724,7 +1888,7 @@ PinChatMessage calls the pinChatMessage Telegram Bot API method. Use 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 the 'can\_pin\_messages' right or the 'can\_edit\_messages' right to pin messages in groups and channels respectively. Returns True on success. -## func [PromoteChatMember]() +## func [PromoteChatMember]() ```go func PromoteChatMember(ctx context.Context, b *client.Bot, p *PromoteChatMemberParams) (bool, error) @@ -1757,7 +1921,7 @@ Limit: api.Ptr(n) ``` -## func [ReadBusinessMessage]() +## func [ReadBusinessMessage]() ```go func ReadBusinessMessage(ctx context.Context, b *client.Bot, p *ReadBusinessMessageParams) (bool, error) @@ -1765,10 +1929,10 @@ func ReadBusinessMessage(ctx context.Context, b *client.Bot, p *ReadBusinessMess ReadBusinessMessage calls the readBusinessMessage Telegram Bot API method. -Marks incoming message as read on behalf of a business account. Requires the can\_read\_messages business bot right. Returns True on success. +Marks an incoming message as read on behalf of a business account. Requires the can\_read\_messages business bot right. Returns True on success. -## func [RefundStarPayment]() +## func [RefundStarPayment]() ```go func RefundStarPayment(ctx context.Context, b *client.Bot, p *RefundStarPaymentParams) (bool, error) @@ -1779,7 +1943,7 @@ RefundStarPayment calls the refundStarPayment Telegram Bot API method. Refunds a successful payment in Telegram Stars. Returns True on success. -## func [RemoveBusinessAccountProfilePhoto]() +## func [RemoveBusinessAccountProfilePhoto]() ```go func RemoveBusinessAccountProfilePhoto(ctx context.Context, b *client.Bot, p *RemoveBusinessAccountProfilePhotoParams) (bool, error) @@ -1790,7 +1954,7 @@ RemoveBusinessAccountProfilePhoto calls the removeBusinessAccountProfilePhoto Te Removes the current profile photo of a managed business account. Requires the can\_edit\_profile\_photo business bot right. Returns True on success. -## func [RemoveChatVerification]() +## func [RemoveChatVerification]() ```go func RemoveChatVerification(ctx context.Context, b *client.Bot, p *RemoveChatVerificationParams) (bool, error) @@ -1801,7 +1965,7 @@ RemoveChatVerification calls the removeChatVerification Telegram Bot API method. Removes verification from a chat that is currently verified on behalf of the organization represented by the bot. Returns True on success. -## func [RemoveMyProfilePhoto]() +## func [RemoveMyProfilePhoto]() ```go func RemoveMyProfilePhoto(ctx context.Context, b *client.Bot, p *RemoveMyProfilePhotoParams) (bool, error) @@ -1812,7 +1976,7 @@ RemoveMyProfilePhoto calls the removeMyProfilePhoto Telegram Bot API method. Removes the profile photo of the bot. Requires no parameters. Returns True on success. -## func [RemoveUserVerification]() +## func [RemoveUserVerification]() ```go func RemoveUserVerification(ctx context.Context, b *client.Bot, p *RemoveUserVerificationParams) (bool, error) @@ -1823,7 +1987,7 @@ RemoveUserVerification calls the removeUserVerification Telegram Bot API method. Removes verification from a user who is currently verified on behalf of the organization represented by the bot. Returns True on success. -## func [ReopenForumTopic]() +## func [ReopenForumTopic]() ```go func ReopenForumTopic(ctx context.Context, b *client.Bot, p *ReopenForumTopicParams) (bool, error) @@ -1831,10 +1995,10 @@ func ReopenForumTopic(ctx context.Context, b *client.Bot, p *ReopenForumTopicPar ReopenForumTopic calls the reopenForumTopic Telegram Bot API method. -Use 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 the topic. Returns True on success. +Use 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 right, unless it is the creator of the topic. Returns True on success. -## func [ReopenGeneralForumTopic]() +## func [ReopenGeneralForumTopic]() ```go func ReopenGeneralForumTopic(ctx context.Context, b *client.Bot, p *ReopenGeneralForumTopicParams) (bool, error) @@ -1842,10 +2006,10 @@ func ReopenGeneralForumTopic(ctx context.Context, b *client.Bot, p *ReopenGenera ReopenGeneralForumTopic calls the reopenGeneralForumTopic Telegram Bot API method. -Use 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 automatically unhidden if it was hidden. Returns True on success. +Use 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 right. The topic will be automatically unhidden if it was hidden. Returns True on success. -## func [ReplaceManagedBotToken]() +## func [ReplaceManagedBotToken]() ```go func ReplaceManagedBotToken(ctx context.Context, b *client.Bot, p *ReplaceManagedBotTokenParams) (string, error) @@ -1856,7 +2020,7 @@ ReplaceManagedBotToken calls the replaceManagedBotToken Telegram Bot API method. Use this method to revoke the current token of a managed bot and generate a new one. Returns the new token as String on success. -## func [ReplaceStickerInSet]() +## func [ReplaceStickerInSet]() ```go func ReplaceStickerInSet(ctx context.Context, b *client.Bot, p *ReplaceStickerInSetParams) (bool, error) @@ -1867,7 +2031,7 @@ ReplaceStickerInSet calls the replaceStickerInSet Telegram Bot API method. Use 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. -## func [RestrictChatMember]() +## func [RestrictChatMember]() ```go func RestrictChatMember(ctx context.Context, b *client.Bot, p *RestrictChatMemberParams) (bool, error) @@ -1878,7 +2042,7 @@ RestrictChatMember calls the restrictChatMember Telegram Bot API method. Use 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 restrictions from a user. Returns True on success. -## func [SendChatAction]() +## func [SendChatAction]() ```go func SendChatAction(ctx context.Context, b *client.Bot, p *SendChatActionParams) (bool, error) @@ -1889,7 +2053,7 @@ SendChatAction calls the sendChatAction Telegram Bot API method. Use 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\). Returns True on success. Example: The ImageBot needs some time to process a request and upload the image. Instead of sending a text message along the lines of “Retrieving image, please wait…”, the bot may use sendChatAction with action = upload\_photo. The user will see a “sending photo” status for the bot. We only recommend using this method when a response from the bot will take a noticeable amount of time to arrive. -## func [SendChatJoinRequestWebApp]() +## func [SendChatJoinRequestWebApp]() ```go func SendChatJoinRequestWebApp(ctx context.Context, b *client.Bot, p *SendChatJoinRequestWebAppParams) (bool, error) @@ -1900,7 +2064,7 @@ SendChatJoinRequestWebApp calls the sendChatJoinRequestWebApp Telegram Bot API m Use 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 interaction with the Mini App. Returns True on success. -## func [SendGift]() +## func [SendGift]() ```go func SendGift(ctx context.Context, b *client.Bot, p *SendGiftParams) (bool, error) @@ -1911,7 +2075,7 @@ SendGift calls the sendGift Telegram Bot API method. Sends 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. -## func [SendMessageDraft]() +## func [SendMessageDraft]() ```go func SendMessageDraft(ctx context.Context, b *client.Bot, p *SendMessageDraftParams) (bool, error) @@ -1922,7 +2086,7 @@ SendMessageDraft calls the sendMessageDraft Telegram Bot API method. Use 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 call sendMessage with the complete message to persist it in the user's chat. Returns True on success. -## func [SendRichMessageDraft]() +## func [SendRichMessageDraft]() ```go func SendRichMessageDraft(ctx context.Context, b *client.Bot, p *SendRichMessageDraftParams) (bool, error) @@ -1933,7 +2097,7 @@ SendRichMessageDraft calls the sendRichMessageDraft Telegram Bot API method. Use 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 must call sendRichMessage with the complete message to persist it in the user's chat. Returns True on success. -## func [SetBusinessAccountBio]() +## func [SetBusinessAccountBio]() ```go func SetBusinessAccountBio(ctx context.Context, b *client.Bot, p *SetBusinessAccountBioParams) (bool, error) @@ -1941,10 +2105,10 @@ func SetBusinessAccountBio(ctx context.Context, b *client.Bot, p *SetBusinessAcc SetBusinessAccountBio calls the setBusinessAccountBio Telegram Bot API method. -Changes the bio of a managed business account. Requires the can\_change\_bio business bot right. Returns True on success. +Changes the bio of a managed business account. Requires the can\_edit\_bio business bot right. Returns True on success. -## func [SetBusinessAccountGiftSettings]() +## func [SetBusinessAccountGiftSettings]() ```go func SetBusinessAccountGiftSettings(ctx context.Context, b *client.Bot, p *SetBusinessAccountGiftSettingsParams) (bool, error) @@ -1955,7 +2119,7 @@ SetBusinessAccountGiftSettings calls the setBusinessAccountGiftSettings Telegram Changes 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. -## func [SetBusinessAccountName]() +## func [SetBusinessAccountName]() ```go func SetBusinessAccountName(ctx context.Context, b *client.Bot, p *SetBusinessAccountNameParams) (bool, error) @@ -1963,10 +2127,10 @@ func SetBusinessAccountName(ctx context.Context, b *client.Bot, p *SetBusinessAc SetBusinessAccountName calls the setBusinessAccountName Telegram Bot API method. -Changes the first and last name of a managed business account. Requires the can\_change\_name business bot right. Returns True on success. +Changes the first and last name of a managed business account. Requires the can\_edit\_name business bot right. Returns True on success. -## func [SetBusinessAccountProfilePhoto]() +## func [SetBusinessAccountProfilePhoto]() ```go func SetBusinessAccountProfilePhoto(ctx context.Context, b *client.Bot, p *SetBusinessAccountProfilePhotoParams) (bool, error) @@ -1977,7 +2141,7 @@ SetBusinessAccountProfilePhoto calls the setBusinessAccountProfilePhoto Telegram Changes the profile photo of a managed business account. Requires the can\_edit\_profile\_photo business bot right. Returns True on success. -## func [SetBusinessAccountUsername]() +## func [SetBusinessAccountUsername]() ```go func SetBusinessAccountUsername(ctx context.Context, b *client.Bot, p *SetBusinessAccountUsernameParams) (bool, error) @@ -1985,10 +2149,10 @@ func SetBusinessAccountUsername(ctx context.Context, b *client.Bot, p *SetBusine SetBusinessAccountUsername calls the setBusinessAccountUsername Telegram Bot API method. -Changes the username of a managed business account. Requires the can\_change\_username business bot right. Returns True on success. +Changes the username of a managed business account. Requires the can\_edit\_username business bot right. Returns True on success. -## func [SetChatAdministratorCustomTitle]() +## func [SetChatAdministratorCustomTitle]() ```go func SetChatAdministratorCustomTitle(ctx context.Context, b *client.Bot, p *SetChatAdministratorCustomTitleParams) (bool, error) @@ -1999,7 +2163,7 @@ SetChatAdministratorCustomTitle calls the setChatAdministratorCustomTitle Telegr Use this method to set a custom title for an administrator in a supergroup promoted by the bot. Returns True on success. -## func [SetChatDescription]() +## func [SetChatDescription]() ```go func SetChatDescription(ctx context.Context, b *client.Bot, p *SetChatDescriptionParams) (bool, error) @@ -2010,7 +2174,7 @@ SetChatDescription calls the setChatDescription Telegram Bot API method. Use 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. -## func [SetChatMemberTag]() +## func [SetChatMemberTag]() ```go func SetChatMemberTag(ctx context.Context, b *client.Bot, p *SetChatMemberTagParams) (bool, error) @@ -2021,7 +2185,7 @@ SetChatMemberTag calls the setChatMemberTag Telegram Bot API method. Use 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. -## func [SetChatMenuButton]() +## func [SetChatMenuButton]() ```go func SetChatMenuButton(ctx context.Context, b *client.Bot, p *SetChatMenuButtonParams) (bool, error) @@ -2032,7 +2196,7 @@ SetChatMenuButton calls the setChatMenuButton Telegram Bot API method. Use this method to change the bot's menu button in a private chat, or the default menu button. Returns True on success. -## func [SetChatPermissions]() +## func [SetChatPermissions]() ```go func SetChatPermissions(ctx context.Context, b *client.Bot, p *SetChatPermissionsParams) (bool, error) @@ -2040,10 +2204,10 @@ func SetChatPermissions(ctx context.Context, b *client.Bot, p *SetChatPermission SetChatPermissions calls the setChatPermissions Telegram Bot API method. -Use 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 on success. +Use 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 right. Returns True on success. -## func [SetChatPhoto]() +## func [SetChatPhoto]() ```go func SetChatPhoto(ctx context.Context, b *client.Bot, p *SetChatPhotoParams) (bool, error) @@ -2054,7 +2218,7 @@ SetChatPhoto calls the setChatPhoto Telegram Bot API method. Use 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. Returns True on success. -## func [SetChatStickerSet]() +## func [SetChatStickerSet]() ```go func SetChatStickerSet(ctx context.Context, b *client.Bot, p *SetChatStickerSetParams) (bool, error) @@ -2065,7 +2229,7 @@ SetChatStickerSet calls the setChatStickerSet Telegram Bot API method. Use 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 optionally returned in getChat requests to check if the bot can use this method. Returns True on success. -## func [SetChatTitle]() +## func [SetChatTitle]() ```go func SetChatTitle(ctx context.Context, b *client.Bot, p *SetChatTitleParams) (bool, error) @@ -2076,7 +2240,7 @@ SetChatTitle calls the setChatTitle Telegram Bot API method. Use 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 success. -## func [SetCustomEmojiStickerSetThumbnail]() +## func [SetCustomEmojiStickerSetThumbnail]() ```go func SetCustomEmojiStickerSetThumbnail(ctx context.Context, b *client.Bot, p *SetCustomEmojiStickerSetThumbnailParams) (bool, error) @@ -2086,8 +2250,19 @@ SetCustomEmojiStickerSetThumbnail calls the setCustomEmojiStickerSetThumbnail Te Use this method to set the thumbnail of a custom emoji sticker set. Returns True on success. + +## func [SetGameScore]() + +```go +func SetGameScore(ctx context.Context, b *client.Bot, p *SetGameScoreParams) (bool, error) +``` + +SetGameScore calls the setGameScore Telegram Bot API method. + +Use 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 not greater than the user's current score in the chat and force is False. + -## func [SetManagedBotAccessSettings]() +## func [SetManagedBotAccessSettings]() ```go func SetManagedBotAccessSettings(ctx context.Context, b *client.Bot, p *SetManagedBotAccessSettingsParams) (bool, error) @@ -2098,7 +2273,7 @@ SetManagedBotAccessSettings calls the setManagedBotAccessSettings Telegram Bot A Use this method to change the access settings of a managed bot. Returns True on success. -## func [SetMessageReaction]() +## func [SetMessageReaction]() ```go func SetMessageReaction(ctx context.Context, b *client.Bot, p *SetMessageReactionParams) (bool, error) @@ -2109,7 +2284,7 @@ SetMessageReaction calls the setMessageReaction Telegram Bot API method. Use 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 as messages in the channel. Bots can't use paid reactions. Returns True on success. -## func [SetMyCommands]() +## func [SetMyCommands]() ```go func SetMyCommands(ctx context.Context, b *client.Bot, p *SetMyCommandsParams) (bool, error) @@ -2120,7 +2295,7 @@ SetMyCommands calls the setMyCommands Telegram Bot API method. Use this method to change the list of the bot's commands. See this manual for more details about bot commands. Returns True on success. -## func [SetMyDefaultAdministratorRights]() +## func [SetMyDefaultAdministratorRights]() ```go func SetMyDefaultAdministratorRights(ctx context.Context, b *client.Bot, p *SetMyDefaultAdministratorRightsParams) (bool, error) @@ -2131,7 +2306,7 @@ SetMyDefaultAdministratorRights calls the setMyDefaultAdministratorRights Telegr Use 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 before adding the bot. Returns True on success. -## func [SetMyDescription]() +## func [SetMyDescription]() ```go func SetMyDescription(ctx context.Context, b *client.Bot, p *SetMyDescriptionParams) (bool, error) @@ -2142,7 +2317,7 @@ SetMyDescription calls the setMyDescription Telegram Bot API method. Use 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. -## func [SetMyName]() +## func [SetMyName]() ```go func SetMyName(ctx context.Context, b *client.Bot, p *SetMyNameParams) (bool, error) @@ -2153,7 +2328,7 @@ SetMyName calls the setMyName Telegram Bot API method. Use this method to change the bot's name. Returns True on success. -## func [SetMyProfilePhoto]() +## func [SetMyProfilePhoto]() ```go func SetMyProfilePhoto(ctx context.Context, b *client.Bot, p *SetMyProfilePhotoParams) (bool, error) @@ -2163,8 +2338,19 @@ SetMyProfilePhoto calls the setMyProfilePhoto Telegram Bot API method. Changes the profile photo of the bot. Returns True on success. + +## func [SetMySettings]() + +```go +func SetMySettings(ctx context.Context, b *client.Bot, p *SetMySettingsParams) (bool, error) +``` + +SetMySettings calls the setMySettings Telegram Bot API method. + +Use this method to change the settings of the bot. Settings that aren't specified remain unchanged. Returns True on success. + -## func [SetMyShortDescription]() +## func [SetMyShortDescription]() ```go func SetMyShortDescription(ctx context.Context, b *client.Bot, p *SetMyShortDescriptionParams) (bool, error) @@ -2175,7 +2361,7 @@ SetMyShortDescription calls the setMyShortDescription Telegram Bot API method. 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. Returns True on success. -## func [SetPassportDataErrors]() +## func [SetPassportDataErrors]() ```go func SetPassportDataErrors(ctx context.Context, b *client.Bot, p *SetPassportDataErrorsParams) (bool, error) @@ -2183,10 +2369,10 @@ func SetPassportDataErrors(ctx context.Context, b *client.Bot, p *SetPassportDat SetPassportDataErrors calls the setPassportDataErrors Telegram Bot API method. -Informs 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 returned the error must change\). Returns True on success. Use this if the data submitted by the user doesn't satisfy the standards your service requires for any reason. For example, if a birthday date seems invalid, a submitted document is blurry, a scan shows evidence of tampering, etc. Supply some details in the error message to make sure the user knows how to correct the issues. +Informs a user that some of the Telegram Passport elements they provided contain 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 returned the error must change\). Returns True on success. Use this if the data submitted by the user doesn't satisfy the standards your service requires for any reason. For example, if a birthday date seems invalid, a submitted document is blurry, a scan shows evidence of tampering, etc. Supply some details in the error message to make sure the user knows how to correct the issues. -## func [SetStickerEmojiList]() +## func [SetStickerEmojiList]() ```go func SetStickerEmojiList(ctx context.Context, b *client.Bot, p *SetStickerEmojiListParams) (bool, error) @@ -2197,7 +2383,7 @@ SetStickerEmojiList calls the setStickerEmojiList Telegram Bot API method. Use 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. -## func [SetStickerKeywords]() +## func [SetStickerKeywords]() ```go func SetStickerKeywords(ctx context.Context, b *client.Bot, p *SetStickerKeywordsParams) (bool, error) @@ -2208,7 +2394,7 @@ SetStickerKeywords calls the setStickerKeywords Telegram Bot API method. Use 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. -## func [SetStickerMaskPosition]() +## func [SetStickerMaskPosition]() ```go func SetStickerMaskPosition(ctx context.Context, b *client.Bot, p *SetStickerMaskPositionParams) (bool, error) @@ -2219,7 +2405,7 @@ SetStickerMaskPosition calls the setStickerMaskPosition Telegram Bot API method. Use 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. -## func [SetStickerPositionInSet]() +## func [SetStickerPositionInSet]() ```go func SetStickerPositionInSet(ctx context.Context, b *client.Bot, p *SetStickerPositionInSetParams) (bool, error) @@ -2230,7 +2416,7 @@ SetStickerPositionInSet calls the setStickerPositionInSet Telegram Bot API metho Use this method to move a sticker in a set created by the bot to a specific position. Returns True on success. -## func [SetStickerSetThumbnail]() +## func [SetStickerSetThumbnail]() ```go func SetStickerSetThumbnail(ctx context.Context, b *client.Bot, p *SetStickerSetThumbnailParams) (bool, error) @@ -2241,7 +2427,7 @@ SetStickerSetThumbnail calls the setStickerSetThumbnail Telegram Bot API method. Use 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. -## func [SetStickerSetTitle]() +## func [SetStickerSetTitle]() ```go func SetStickerSetTitle(ctx context.Context, b *client.Bot, p *SetStickerSetTitleParams) (bool, error) @@ -2252,7 +2438,7 @@ SetStickerSetTitle calls the setStickerSetTitle Telegram Bot API method. Use this method to set the title of a created sticker set. Returns True on success. -## func [SetUserEmojiStatus]() +## func [SetUserEmojiStatus]() ```go func SetUserEmojiStatus(ctx context.Context, b *client.Bot, p *SetUserEmojiStatusParams) (bool, error) @@ -2271,10 +2457,21 @@ func SetWebhook(ctx context.Context, b *client.Bot, p *SetWebhookParams) (bool, SetWebhook calls the setWebhook Telegram Bot API method. -Use 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 Update. In case of an unsuccessful request \(a request with response HTTP status code different from 2XY\), we will repeat the request and give up after a reasonable amount of attempts. Returns True on success. If you'd like to make sure that the webhook was set by you, you can specify secret data in the parameter secret\_token. If specified, the request will contain a header “X\-Telegram\-Bot\-Api\-Secret\-Token” with the secret token as content. Notes1. You will not be able to receive updates using getUpdates for as long as an outgoing webhook is set up.2. To use a self\-signed certificate, you need to upload your public key certificate using certificate parameter. Please upload as InputFile, sending a String will not work.3. Ports currently supported for webhooks: 443, 80, 88, 8443. If you're having any trouble setting up webhooks, please check out this amazing guide to webhooks. +Use 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 Update. In case of an unsuccessful request \(a request with response HTTP status code different from 2XY\), we will repeat the request and give up after a reasonable number of attempts. Returns True on success. If you'd like to make sure that the webhook was set by you, you can specify secret data in the parameter secret\_token. If specified, the request will contain a header “X\-Telegram\-Bot\-Api\-Secret\-Token” with the secret token as content. Notes1. You will not be able to receive updates using getUpdates for as long as an outgoing webhook is set up.2. To use a self\-signed certificate, you need to upload your public key certificate using the certificate parameter. Please upload it as InputFile; sending a String will not work.3. Ports currently supported for webhooks: 443, 80, 88, 8443. If you're having any trouble setting up webhooks, please check out this amazing guide to webhooks. + + +## func [StopMessageLiveLocation]() + +```go +func StopMessageLiveLocation(ctx context.Context, b *client.Bot, p *StopMessageLiveLocationParams) (bool, error) +``` + +StopMessageLiveLocation calls the stopMessageLiveLocation Telegram Bot API method. + +Use 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. -## func [TransferBusinessAccountStars]() +## func [TransferBusinessAccountStars]() ```go func TransferBusinessAccountStars(ctx context.Context, b *client.Bot, p *TransferBusinessAccountStarsParams) (bool, error) @@ -2285,7 +2482,7 @@ TransferBusinessAccountStars calls the transferBusinessAccountStars Telegram Bot Transfers Telegram Stars from the business account balance to the bot's balance. Requires the can\_transfer\_stars business bot right. Returns True on success. -## func [TransferGift]() +## func [TransferGift]() ```go func TransferGift(ctx context.Context, b *client.Bot, p *TransferGiftParams) (bool, error) @@ -2293,10 +2490,10 @@ func TransferGift(ctx context.Context, b *client.Bot, p *TransferGiftParams) (bo TransferGift calls the transferGift Telegram Bot API method. -Transfers 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. +Transfers an owned unique gift to another user. Requires the can\_transfer\_and\_upgrade\_gifts business bot right. Requires the can\_transfer\_stars business bot right if the transfer is paid. Returns True on success. -## func [UnbanChatMember]() +## func [UnbanChatMember]() ```go func UnbanChatMember(ctx context.Context, b *client.Bot, p *UnbanChatMemberParams) (bool, error) @@ -2307,7 +2504,7 @@ UnbanChatMember calls the unbanChatMember Telegram Bot API method. Use 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 this to work. By default, this method guarantees that after the call the user is not a member of the chat, but will be able to join it. So if the user is a member of the chat they will also be removed from the chat. If you don't want this, use the parameter only\_if\_banned. Returns True on success. -## func [UnbanChatSenderChat]() +## func [UnbanChatSenderChat]() ```go func UnbanChatSenderChat(ctx context.Context, b *client.Bot, p *UnbanChatSenderChatParams) (bool, error) @@ -2318,7 +2515,7 @@ UnbanChatSenderChat calls the unbanChatSenderChat Telegram Bot API method. Use 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. -## func [UnhideGeneralForumTopic]() +## func [UnhideGeneralForumTopic]() ```go func UnhideGeneralForumTopic(ctx context.Context, b *client.Bot, p *UnhideGeneralForumTopicParams) (bool, error) @@ -2326,10 +2523,10 @@ func UnhideGeneralForumTopic(ctx context.Context, b *client.Bot, p *UnhideGenera UnhideGeneralForumTopic calls the unhideGeneralForumTopic Telegram Bot API method. -Use 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. +Use 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 right. Returns True on success. -## func [UnpinAllChatMessages]() +## func [UnpinAllChatMessages]() ```go func UnpinAllChatMessages(ctx context.Context, b *client.Bot, p *UnpinAllChatMessagesParams) (bool, error) @@ -2340,7 +2537,7 @@ UnpinAllChatMessages calls the unpinAllChatMessages Telegram Bot API method. Use 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 administrator with the 'can\_pin\_messages' right or the 'can\_edit\_messages' right to unpin all pinned messages in groups and channels respectively. Returns True on success. -## func [UnpinAllForumTopicMessages]() +## func [UnpinAllForumTopicMessages]() ```go func UnpinAllForumTopicMessages(ctx context.Context, b *client.Bot, p *UnpinAllForumTopicMessagesParams) (bool, error) @@ -2351,7 +2548,7 @@ UnpinAllForumTopicMessages calls the unpinAllForumTopicMessages Telegram Bot API Use 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 work and must have the can\_pin\_messages administrator right in the supergroup. Returns True on success. -## func [UnpinAllGeneralForumTopicMessages]() +## func [UnpinAllGeneralForumTopicMessages]() ```go func UnpinAllGeneralForumTopicMessages(ctx context.Context, b *client.Bot, p *UnpinAllGeneralForumTopicMessagesParams) (bool, error) @@ -2362,7 +2559,7 @@ UnpinAllGeneralForumTopicMessages calls the unpinAllGeneralForumTopicMessages Te Use 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. Returns True on success. -## func [UnpinChatMessage]() +## func [UnpinChatMessage]() ```go func UnpinChatMessage(ctx context.Context, b *client.Bot, p *UnpinChatMessageParams) (bool, error) @@ -2373,7 +2570,7 @@ UnpinChatMessage calls the unpinChatMessage Telegram Bot API method. Use 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 'can\_pin\_messages' right or the 'can\_edit\_messages' right to unpin messages in groups and channels respectively. Returns True on success. -## func [UpgradeGift]() +## func [UpgradeGift]() ```go func UpgradeGift(ctx context.Context, b *client.Bot, p *UpgradeGiftParams) (bool, error) @@ -2384,7 +2581,7 @@ UpgradeGift calls the upgradeGift Telegram Bot API method. Upgrades 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 success. -## func [VerifyChat]() +## func [VerifyChat]() ```go func VerifyChat(ctx context.Context, b *client.Bot, p *VerifyChatParams) (bool, error) @@ -2395,7 +2592,7 @@ VerifyChat calls the verifyChat Telegram Bot API method. Verifies a chat on behalf of the organization which is represented by the bot. Returns True on success. -## func [VerifyUser]() +## func [VerifyUser]() ```go func VerifyUser(ctx context.Context, b *client.Bot, p *VerifyUserParams) (bool, error) @@ -2406,7 +2603,7 @@ VerifyUser calls the verifyUser Telegram Bot API method. Verifies a user on behalf of the organization which is represented by the bot. Returns True on success. -## type [AcceptedGiftTypes]() +## type [AcceptedGiftTypes]() This object describes the types of gifts that can be gifted to a user or a chat. @@ -2426,7 +2623,7 @@ type AcceptedGiftTypes struct { ``` -## type [AddStickerToSetParams]() +## type [AddStickerToSetParams]() AddStickerToSetParams is the parameter set for AddStickerToSet. @@ -2444,7 +2641,7 @@ type AddStickerToSetParams struct { ``` -## type [AffiliateInfo]() +## type [AffiliateInfo]() Contains information about the affiliate that received a commission via this transaction. @@ -2464,7 +2661,7 @@ type AffiliateInfo struct { ``` -## type [Animation]() +## type [Animation]() This object represents an animation file \(GIF or H.264/MPEG\-4 AVC video without sound\). @@ -2486,17 +2683,17 @@ type Animation struct { FileName string `json:"file_name,omitempty"` // Optional. MIME type of the file as defined by the sender MimeType string `json:"mime_type,omitempty"` - // Optional. File size in bytes. It can be bigger than 2^31 and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a signed 64-bit integer or double-precision float type are safe for storing this value. + // Optional. File size in bytes. It can be bigger than 2^31 and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a signed 64-bit integer or double-precision float type is safe for storing this value. FileSize *int64 `json:"file_size,omitempty"` } ``` -## type [AnswerCallbackQueryParams]() +## type [AnswerCallbackQueryParams]() AnswerCallbackQueryParams is the parameter set for AnswerCallbackQuery. -Use 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. Alternatively, the user can be redirected to the specified Game URL. For this option to work, you must first create a game for your bot via @BotFather and accept the terms. Otherwise, you may use links like t.me/your\_bot?start=XXXX that open your bot with a parameter. +Use this method to send answers to callback queries sent from inline keyboards or rich messages. 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. Alternatively, the user can be redirected to the specified Game URL. For this option to work, you must first create a game for your bot via @BotFather and accept the terms. Otherwise, you may use links like t.me/your\_bot?start=XXXX that open your bot with a parameter. ```go type AnswerCallbackQueryParams struct { @@ -2514,7 +2711,7 @@ type AnswerCallbackQueryParams struct { ``` -## type [AnswerChatJoinRequestQueryParams]() +## type [AnswerChatJoinRequestQueryParams]() AnswerChatJoinRequestQueryParams is the parameter set for AnswerChatJoinRequestQuery. @@ -2530,7 +2727,7 @@ type AnswerChatJoinRequestQueryParams struct { ``` -## type [AnswerGuestQueryParams]() +## type [AnswerGuestQueryParams]() AnswerGuestQueryParams is the parameter set for AnswerGuestQuery. @@ -2546,7 +2743,7 @@ type AnswerGuestQueryParams struct { ``` -## type [AnswerInlineQueryParams]() +## type [AnswerInlineQueryParams]() AnswerInlineQueryParams is the parameter set for AnswerInlineQuery. @@ -2570,7 +2767,7 @@ type AnswerInlineQueryParams struct { ``` -## type [AnswerPreCheckoutQueryParams]() +## type [AnswerPreCheckoutQueryParams]() AnswerPreCheckoutQueryParams is the parameter set for AnswerPreCheckoutQuery. @@ -2582,13 +2779,13 @@ type AnswerPreCheckoutQueryParams struct { PreCheckoutQueryID string `json:"pre_checkout_query_id"` // Specify True if everything is alright (goods are available, etc.) and the bot is ready to proceed with the order. Use False if there are any problems. Ok bool `json:"ok"` - // Required if ok is False. Error message in human readable form that explains the reason for failure to proceed with the checkout (e.g. "Sorry, somebody just bought the last of our amazing black T-shirts while you were busy filling out your payment details. Please choose a different color or garment!"). Telegram will display this message to the user. + // Required if ok is False. Error message in human-readable form that explains the reason for failure to proceed with the checkout (e.g. "Sorry, somebody just bought the last of our amazing black T-shirts while you were busy filling out your payment details. Please choose a different color or garment!"). Telegram will display this message to the user. ErrorMessage string `json:"error_message,omitempty"` } ``` -## type [AnswerShippingQueryParams]() +## type [AnswerShippingQueryParams]() AnswerShippingQueryParams is the parameter set for AnswerShippingQuery. @@ -2602,13 +2799,13 @@ type AnswerShippingQueryParams struct { Ok bool `json:"ok"` // Required if ok is True. A JSON-serialized Array of available shipping options. ShippingOptions []ShippingOption `json:"shipping_options,omitempty"` - // Required if ok is False. Error message in human readable form that explains why it is impossible to complete the order (e.g. “Sorry, delivery to your desired address is unavailable”). Telegram will display this message to the user. + // Required if ok is False. Error message in human-readable form that explains why it is impossible to complete the order (e.g. “Sorry, delivery to your desired address is unavailable”). Telegram will display this message to the user. ErrorMessage string `json:"error_message,omitempty"` } ``` -## type [AnswerWebAppQueryParams]() +## type [AnswerWebAppQueryParams]() AnswerWebAppQueryParams is the parameter set for AnswerWebAppQuery. @@ -2623,8 +2820,24 @@ type AnswerWebAppQueryParams struct { } ``` + +## type [AnswerWidgetQueryParams]() + +AnswerWidgetQueryParams is the parameter set for AnswerWidgetQuery. + +Use 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 editMessageWidgetData or editSharedWidgetData to change it. On success, True is returned. + +```go +type AnswerWidgetQueryParams struct { + // Unique identifier for the query to be answered + WidgetQueryID string `json:"widget_query_id"` + // Data to be returned to the widget, 0-1024 bytes + Data string `json:"data,omitempty"` +} +``` + -## type [ApproveChatJoinRequestParams]() +## type [ApproveChatJoinRequestParams]() ApproveChatJoinRequestParams is the parameter set for ApproveChatJoinRequest. @@ -2640,7 +2853,7 @@ type ApproveChatJoinRequestParams struct { ``` -## type [ApproveSuggestedPostParams]() +## type [ApproveSuggestedPostParams]() ApproveSuggestedPostParams is the parameter set for ApproveSuggestedPost. @@ -2652,13 +2865,35 @@ type ApproveSuggestedPostParams struct { ChatID int64 `json:"chat_id"` // Identifier of a suggested post message to approve MessageID int64 `json:"message_id"` - // Point in time (Unix timestamp) when the post is expected to be published; omit if the date has already been specified when the suggested post was created. If specified, then the date must be not more than 2678400 seconds (30 days) in the future. + // Point in time (Unix timestamp) when the post is expected to be published; omit if the date has already been specified when the suggested post was created. If specified, then the date must not be more than 2678400 seconds (30 days) in the future. SendDate *int64 `json:"send_date,omitempty"` } ``` + +## type [AreaPosition]() + +Describes the position of a rectangle area on a story media or a TON wallet card. + +```go +type AreaPosition struct { + // The abscissa of the area's center, as a percentage of the media or the card width + XPercentage float64 `json:"x_percentage"` + // The ordinate of the area's center, as a percentage of the media or the card height + YPercentage float64 `json:"y_percentage"` + // The width of the area's rectangle, as a percentage of the media or the card width + WidthPercentage float64 `json:"width_percentage"` + // The height of the area's rectangle, as a percentage of the media or the card height + HeightPercentage float64 `json:"height_percentage"` + // The clockwise rotation angle of the rectangle, in degrees; 0-360 + RotationAngle float64 `json:"rotation_angle"` + // The radius of the rectangle corner rounding, as a percentage of the media or the card width + CornerRadiusPercentage float64 `json:"corner_radius_percentage"` +} +``` + -## type [Audio]() +## type [Audio]() This object represents an audio file to be treated as music by the Telegram clients. @@ -2678,7 +2913,7 @@ type Audio struct { FileName string `json:"file_name,omitempty"` // Optional. MIME type of the file as defined by the sender MimeType string `json:"mime_type,omitempty"` - // Optional. File size in bytes. It can be bigger than 2^31 and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a signed 64-bit integer or double-precision float type are safe for storing this value. + // Optional. File size in bytes. It can be bigger than 2^31 and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a signed 64-bit integer or double-precision float type is safe for storing this value. FileSize *int64 `json:"file_size,omitempty"` // Optional. Thumbnail of the album cover to which the music file belongs Thumbnail *PhotoSize `json:"thumbnail,omitempty"` @@ -2686,7 +2921,7 @@ type Audio struct { ``` -## type [BackgroundFill]() +## type [BackgroundFill]() BackgroundFill is a union type. The following concrete variants implement it: @@ -2703,7 +2938,7 @@ type BackgroundFill interface { ``` -### func [UnmarshalBackgroundFill]() +### func [UnmarshalBackgroundFill]() ```go func UnmarshalBackgroundFill(data []byte) (BackgroundFill, error) @@ -2712,7 +2947,7 @@ func UnmarshalBackgroundFill(data []byte) (BackgroundFill, error) UnmarshalBackgroundFill decodes a BackgroundFill from JSON by inspecting the "type" field and dispatching to the correct concrete type. -## type [BackgroundFillFreeformGradient]() +## type [BackgroundFillFreeformGradient]() The background is a freeform gradient that rotates after every message in the chat. @@ -2726,7 +2961,7 @@ type BackgroundFillFreeformGradient struct { ``` -### func \(\*BackgroundFillFreeformGradient\) [MarshalJSON]() +### func \(\*BackgroundFillFreeformGradient\) [MarshalJSON]() ```go func (v *BackgroundFillFreeformGradient) MarshalJSON() ([]byte, error) @@ -2735,7 +2970,7 @@ func (v *BackgroundFillFreeformGradient) MarshalJSON() ([]byte, error) MarshalJSON encodes BackgroundFillFreeformGradient with the discriminator field "type" forced to "freeform\_gradient". The hardcoded value frees callers from setting Type by hand — any user\-supplied value on the struct literal is overridden so a typo can't slip through to Telegram. -## type [BackgroundFillGradient]() +## type [BackgroundFillGradient]() The background is a gradient fill. @@ -2753,7 +2988,7 @@ type BackgroundFillGradient struct { ``` -### func \(\*BackgroundFillGradient\) [MarshalJSON]() +### func \(\*BackgroundFillGradient\) [MarshalJSON]() ```go func (v *BackgroundFillGradient) MarshalJSON() ([]byte, error) @@ -2762,7 +2997,7 @@ func (v *BackgroundFillGradient) MarshalJSON() ([]byte, error) MarshalJSON encodes BackgroundFillGradient with the discriminator field "type" forced to "gradient". The hardcoded value frees callers from setting Type by hand — any user\-supplied value on the struct literal is overridden so a typo can't slip through to Telegram. -## type [BackgroundFillSolid]() +## type [BackgroundFillSolid]() The background is filled using the selected color. @@ -2776,7 +3011,7 @@ type BackgroundFillSolid struct { ``` -### func \(\*BackgroundFillSolid\) [MarshalJSON]() +### func \(\*BackgroundFillSolid\) [MarshalJSON]() ```go func (v *BackgroundFillSolid) MarshalJSON() ([]byte, error) @@ -2804,7 +3039,7 @@ const ( ``` -## type [BackgroundType]() +## type [BackgroundType]() BackgroundType is a union type. The following concrete variants implement it: @@ -2822,7 +3057,7 @@ type BackgroundType interface { ``` -### func [UnmarshalBackgroundType]() +### func [UnmarshalBackgroundType]() ```go func UnmarshalBackgroundType(data []byte) (BackgroundType, error) @@ -2831,7 +3066,7 @@ func UnmarshalBackgroundType(data []byte) (BackgroundType, error) UnmarshalBackgroundType decodes a BackgroundType from JSON by inspecting the "type" field and dispatching to the correct concrete type. -## type [BackgroundTypeChatTheme]() +## type [BackgroundTypeChatTheme]() The background is taken directly from a built\-in chat theme. @@ -2845,7 +3080,7 @@ type BackgroundTypeChatTheme struct { ``` -### func \(\*BackgroundTypeChatTheme\) [MarshalJSON]() +### func \(\*BackgroundTypeChatTheme\) [MarshalJSON]() ```go func (v *BackgroundTypeChatTheme) MarshalJSON() ([]byte, error) @@ -2854,7 +3089,7 @@ func (v *BackgroundTypeChatTheme) MarshalJSON() ([]byte, error) MarshalJSON encodes BackgroundTypeChatTheme with the discriminator field "type" forced to "chat\_theme". The hardcoded value frees callers from setting Type by hand — any user\-supplied value on the struct literal is overridden so a typo can't slip through to Telegram. -## type [BackgroundTypeFill]() +## type [BackgroundTypeFill]() The background is automatically filled based on the selected colors. @@ -2870,7 +3105,7 @@ type BackgroundTypeFill struct { ``` -### func \(\*BackgroundTypeFill\) [MarshalJSON]() +### func \(\*BackgroundTypeFill\) [MarshalJSON]() ```go func (v *BackgroundTypeFill) MarshalJSON() ([]byte, error) @@ -2879,7 +3114,7 @@ func (v *BackgroundTypeFill) MarshalJSON() ([]byte, error) MarshalJSON encodes BackgroundTypeFill with the discriminator field "type" forced to "fill". The hardcoded value frees callers from setting Type by hand — any user\-supplied value on the struct literal is overridden so a typo can't slip through to Telegram. -### func \(\*BackgroundTypeFill\) [UnmarshalJSON]() +### func \(\*BackgroundTypeFill\) [UnmarshalJSON]() ```go func (m *BackgroundTypeFill) UnmarshalJSON(data []byte) error @@ -2908,7 +3143,7 @@ const ( ``` -## type [BackgroundTypePattern]() +## type [BackgroundTypePattern]() The 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. @@ -2930,7 +3165,7 @@ type BackgroundTypePattern struct { ``` -### func \(\*BackgroundTypePattern\) [MarshalJSON]() +### func \(\*BackgroundTypePattern\) [MarshalJSON]() ```go func (v *BackgroundTypePattern) MarshalJSON() ([]byte, error) @@ -2939,7 +3174,7 @@ func (v *BackgroundTypePattern) MarshalJSON() ([]byte, error) MarshalJSON encodes BackgroundTypePattern with the discriminator field "type" forced to "pattern". The hardcoded value frees callers from setting Type by hand — any user\-supplied value on the struct literal is overridden so a typo can't slip through to Telegram. -### func \(\*BackgroundTypePattern\) [UnmarshalJSON]() +### func \(\*BackgroundTypePattern\) [UnmarshalJSON]() ```go func (m *BackgroundTypePattern) UnmarshalJSON(data []byte) error @@ -2948,7 +3183,7 @@ func (m *BackgroundTypePattern) UnmarshalJSON(data []byte) error UnmarshalJSON decodes BackgroundTypePattern by dispatching union\-typed fields \(Fill\) through their concrete UnmarshalXxx helpers. -## type [BackgroundTypeWallpaper]() +## type [BackgroundTypeWallpaper]() The background is a wallpaper in the JPEG format. @@ -2968,7 +3203,7 @@ type BackgroundTypeWallpaper struct { ``` -### func \(\*BackgroundTypeWallpaper\) [MarshalJSON]() +### func \(\*BackgroundTypeWallpaper\) [MarshalJSON]() ```go func (v *BackgroundTypeWallpaper) MarshalJSON() ([]byte, error) @@ -2977,7 +3212,7 @@ func (v *BackgroundTypeWallpaper) MarshalJSON() ([]byte, error) MarshalJSON encodes BackgroundTypeWallpaper with the discriminator field "type" forced to "wallpaper". The hardcoded value frees callers from setting Type by hand — any user\-supplied value on the struct literal is overridden so a typo can't slip through to Telegram. -## type [BanChatMemberParams]() +## type [BanChatMemberParams]() BanChatMemberParams is the parameter set for BanChatMember. @@ -2989,7 +3224,7 @@ type BanChatMemberParams struct { ChatID ChatID `json:"chat_id"` // Unique identifier of the target user UserID int64 `json:"user_id"` - // Date when the user will be unbanned; Unix time. If user is banned for more than 366 days or less than 30 seconds from the current time they are considered to be banned forever. Applied for supergroups and channels only. + // Date when the user will be unbanned; Unix time. If the user is banned for more than 366 days or less than 30 seconds from the current time, they are considered to be banned forever. Applied for supergroups and channels only. UntilDate *int64 `json:"until_date,omitempty"` // Pass True to delete all messages from the chat for the user that is being removed. If False, the user will be able to see messages in the group that were sent before the user was removed. Always True for supergroups and channels. RevokeMessages *bool `json:"revoke_messages,omitempty"` @@ -2997,7 +3232,7 @@ type BanChatMemberParams struct { ``` -## type [BanChatSenderChatParams]() +## type [BanChatSenderChatParams]() BanChatSenderChatParams is the parameter set for BanChatSenderChat. @@ -3013,7 +3248,7 @@ type BanChatSenderChatParams struct { ``` -## type [Birthdate]() +## type [Birthdate]() Describes the birthdate of a user. @@ -3029,7 +3264,7 @@ type Birthdate struct { ``` -## type [BotAccessSettings]() +## type [BotAccessSettings]() This object describes the access settings of a bot. @@ -3043,7 +3278,7 @@ type BotAccessSettings struct { ``` -### func [GetManagedBotAccessSettings]() +### func [GetManagedBotAccessSettings]() ```go func GetManagedBotAccessSettings(ctx context.Context, b *client.Bot, p *GetManagedBotAccessSettingsParams) (*BotAccessSettings, error) @@ -3054,7 +3289,7 @@ GetManagedBotAccessSettings calls the getManagedBotAccessSettings Telegram Bot A Use this method to get the access settings of a managed bot. Returns a BotAccessSettings object on success. -## type [BotCommand]() +## type [BotCommand]() This object represents a bot command. @@ -3070,7 +3305,7 @@ type BotCommand struct { ``` -### func [GetMyCommands]() +### func [GetMyCommands]() ```go func GetMyCommands(ctx context.Context, b *client.Bot, p *GetMyCommandsParams) ([]BotCommand, error) @@ -3081,7 +3316,7 @@ GetMyCommands calls the getMyCommands Telegram Bot API method. Use 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. -## type [BotCommandScope]() +## type [BotCommandScope]() BotCommandScope is a union type. The following concrete variants implement it: @@ -3102,7 +3337,7 @@ type BotCommandScope interface { ``` -### func [UnmarshalBotCommandScope]() +### func [UnmarshalBotCommandScope]() ```go func UnmarshalBotCommandScope(data []byte) (BotCommandScope, error) @@ -3111,7 +3346,7 @@ func UnmarshalBotCommandScope(data []byte) (BotCommandScope, error) UnmarshalBotCommandScope decodes a BotCommandScope from JSON by inspecting the "type" field and dispatching to the correct concrete type. -## type [BotCommandScopeAllChatAdministrators]() +## type [BotCommandScopeAllChatAdministrators]() Represents the scope of bot commands, covering all group and supergroup chat administrators. @@ -3123,7 +3358,7 @@ type BotCommandScopeAllChatAdministrators struct { ``` -### func \(\*BotCommandScopeAllChatAdministrators\) [MarshalJSON]() +### func \(\*BotCommandScopeAllChatAdministrators\) [MarshalJSON]() ```go func (v *BotCommandScopeAllChatAdministrators) MarshalJSON() ([]byte, error) @@ -3132,7 +3367,7 @@ func (v *BotCommandScopeAllChatAdministrators) MarshalJSON() ([]byte, error) MarshalJSON encodes BotCommandScopeAllChatAdministrators with the discriminator field "type" forced to "all\_chat\_administrators". The hardcoded value frees callers from setting Type by hand — any user\-supplied value on the struct literal is overridden so a typo can't slip through to Telegram. -## type [BotCommandScopeAllGroupChats]() +## type [BotCommandScopeAllGroupChats]() Represents the scope of bot commands, covering all group and supergroup chats. @@ -3144,7 +3379,7 @@ type BotCommandScopeAllGroupChats struct { ``` -### func \(\*BotCommandScopeAllGroupChats\) [MarshalJSON]() +### func \(\*BotCommandScopeAllGroupChats\) [MarshalJSON]() ```go func (v *BotCommandScopeAllGroupChats) MarshalJSON() ([]byte, error) @@ -3153,7 +3388,7 @@ func (v *BotCommandScopeAllGroupChats) MarshalJSON() ([]byte, error) MarshalJSON encodes BotCommandScopeAllGroupChats with the discriminator field "type" forced to "all\_group\_chats". The hardcoded value frees callers from setting Type by hand — any user\-supplied value on the struct literal is overridden so a typo can't slip through to Telegram. -## type [BotCommandScopeAllPrivateChats]() +## type [BotCommandScopeAllPrivateChats]() Represents the scope of bot commands, covering all private chats. @@ -3165,7 +3400,7 @@ type BotCommandScopeAllPrivateChats struct { ``` -### func \(\*BotCommandScopeAllPrivateChats\) [MarshalJSON]() +### func \(\*BotCommandScopeAllPrivateChats\) [MarshalJSON]() ```go func (v *BotCommandScopeAllPrivateChats) MarshalJSON() ([]byte, error) @@ -3174,7 +3409,7 @@ func (v *BotCommandScopeAllPrivateChats) MarshalJSON() ([]byte, error) MarshalJSON encodes BotCommandScopeAllPrivateChats with the discriminator field "type" forced to "all\_private\_chats". The hardcoded value frees callers from setting Type by hand — any user\-supplied value on the struct literal is overridden so a typo can't slip through to Telegram. -## type [BotCommandScopeChat]() +## type [BotCommandScopeChat]() Represents the scope of bot commands, covering a specific chat. @@ -3188,7 +3423,7 @@ type BotCommandScopeChat struct { ``` -### func \(\*BotCommandScopeChat\) [MarshalJSON]() +### func \(\*BotCommandScopeChat\) [MarshalJSON]() ```go func (v *BotCommandScopeChat) MarshalJSON() ([]byte, error) @@ -3197,7 +3432,7 @@ func (v *BotCommandScopeChat) MarshalJSON() ([]byte, error) MarshalJSON encodes BotCommandScopeChat with the discriminator field "type" forced to "chat". The hardcoded value frees callers from setting Type by hand — any user\-supplied value on the struct literal is overridden so a typo can't slip through to Telegram. -## type [BotCommandScopeChatAdministrators]() +## type [BotCommandScopeChatAdministrators]() Represents the scope of bot commands, covering all administrators of a specific group or supergroup chat. @@ -3211,7 +3446,7 @@ type BotCommandScopeChatAdministrators struct { ``` -### func \(\*BotCommandScopeChatAdministrators\) [MarshalJSON]() +### func \(\*BotCommandScopeChatAdministrators\) [MarshalJSON]() ```go func (v *BotCommandScopeChatAdministrators) MarshalJSON() ([]byte, error) @@ -3220,7 +3455,7 @@ func (v *BotCommandScopeChatAdministrators) MarshalJSON() ([]byte, error) MarshalJSON encodes BotCommandScopeChatAdministrators with the discriminator field "type" forced to "chat\_administrators". The hardcoded value frees callers from setting Type by hand — any user\-supplied value on the struct literal is overridden so a typo can't slip through to Telegram. -## type [BotCommandScopeChatMember]() +## type [BotCommandScopeChatMember]() Represents the scope of bot commands, covering a specific member of a group or supergroup chat. @@ -3236,7 +3471,7 @@ type BotCommandScopeChatMember struct { ``` -### func \(\*BotCommandScopeChatMember\) [MarshalJSON]() +### func \(\*BotCommandScopeChatMember\) [MarshalJSON]() ```go func (v *BotCommandScopeChatMember) MarshalJSON() ([]byte, error) @@ -3245,7 +3480,7 @@ func (v *BotCommandScopeChatMember) MarshalJSON() ([]byte, error) MarshalJSON encodes BotCommandScopeChatMember with the discriminator field "type" forced to "chat\_member". The hardcoded value frees callers from setting Type by hand — any user\-supplied value on the struct literal is overridden so a typo can't slip through to Telegram. -## type [BotCommandScopeDefault]() +## type [BotCommandScopeDefault]() Represents the default scope of bot commands. Default commands are used if no commands with a narrower scope are specified for the user. @@ -3257,7 +3492,7 @@ type BotCommandScopeDefault struct { ``` -### func \(\*BotCommandScopeDefault\) [MarshalJSON]() +### func \(\*BotCommandScopeDefault\) [MarshalJSON]() ```go func (v *BotCommandScopeDefault) MarshalJSON() ([]byte, error) @@ -3289,7 +3524,7 @@ const ( ``` -## type [BotDescription]() +## type [BotDescription]() This object represents the bot's description. @@ -3301,7 +3536,7 @@ type BotDescription struct { ``` -### func [GetMyDescription]() +### func [GetMyDescription]() ```go func GetMyDescription(ctx context.Context, b *client.Bot, p *GetMyDescriptionParams) (*BotDescription, error) @@ -3311,8 +3546,65 @@ GetMyDescription calls the getMyDescription Telegram Bot API method. Use this method to get the current bot description for the given user language. Returns BotDescription on success. + +## type [BotFullInfo]() + +This object contains full information about the bot itself. + +```go +type BotFullInfo struct { + // Unique identifier for this bot. This number may have more than 32 significant bits and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a 64-bit integer or double-precision float type is safe for storing this identifier. + ID int64 `json:"id"` + // Always True + IsBot bool `json:"is_bot"` + // Bot's first name + FirstName string `json:"first_name"` + // Optional. Bot's username + Username string `json:"username,omitempty"` + // Optional. If non-empty, the list of all active usernames of the bot + ActiveUsernames []string `json:"active_usernames,omitempty"` + // True, if the bot can be added to groups + CanJoinGroups bool `json:"can_join_groups"` + // True, if privacy mode is disabled for the bot + CanReadAllGroupMessages bool `json:"can_read_all_group_messages"` + // True, if the bot supports guest queries from chats it is not a member of + SupportsGuestQueries bool `json:"supports_guest_queries"` + // True, if the bot supports inline queries + SupportsInlineQueries bool `json:"supports_inline_queries"` + // Optional. Placeholder for inline queries, which is shown in the input field after the bot's username; omitted if the default placeholder is used + InlineQueryPlaceholder string `json:"inline_query_placeholder,omitempty"` + // True, if the bot requests the location of the user with every inline query + NeedsInlineQueryLocation bool `json:"needs_inline_query_location"` + // True, if the bot can be connected to a user account to manage it + CanConnectToBusiness bool `json:"can_connect_to_business"` + // True, if the bot has a main Web App + HasMainWebApp bool `json:"has_main_web_app"` + // True, if the bot has forum topic mode enabled in private chats + HasTopicsEnabled bool `json:"has_topics_enabled"` + // True, if the bot allows users to create and delete topics in private chats + AllowsUsersToCreateTopics bool `json:"allows_users_to_create_topics"` + // True, if topics in private chats with the bot are shown in a sidebar + HasTopicSidebar bool `json:"has_topic_sidebar"` + // True, if other bots can be created to be controlled by the bot + CanManageBots bool `json:"can_manage_bots"` + // True, if the bot supports join request queries and can be assigned to process them + SupportsJoinRequestQueries bool `json:"supports_join_request_queries"` +} +``` + + +### func [GetMe]() + +```go +func GetMe(ctx context.Context, b *client.Bot, p *GetMeParams) (*BotFullInfo, error) +``` + +GetMe calls the getMe Telegram Bot API method. + +A simple method for testing your bot's authentication token. Requires no parameters. Returns information about the bot in the form of a BotFullInfo object. + -## type [BotName]() +## type [BotName]() This object represents the bot's name. @@ -3324,7 +3616,7 @@ type BotName struct { ``` -### func [GetMyName]() +### func [GetMyName]() ```go func GetMyName(ctx context.Context, b *client.Bot, p *GetMyNameParams) (*BotName, error) @@ -3335,7 +3627,7 @@ GetMyName calls the getMyName Telegram Bot API method. Use this method to get the current bot name for the given user language. Returns BotName on success. -## type [BotShortDescription]() +## type [BotShortDescription]() This object represents the bot's short description. @@ -3347,7 +3639,7 @@ type BotShortDescription struct { ``` -### func [GetMyShortDescription]() +### func [GetMyShortDescription]() ```go func GetMyShortDescription(ctx context.Context, b *client.Bot, p *GetMyShortDescriptionParams) (*BotShortDescription, error) @@ -3358,7 +3650,7 @@ GetMyShortDescription calls the getMyShortDescription Telegram Bot API method. Use this method to get the current bot short description for the given user language. Returns BotShortDescription on success. -## type [BotSubscriptionUpdated]() +## type [BotSubscriptionUpdated]() This object contains information about changes to a user payment subscription toward the current bot. @@ -3393,7 +3685,7 @@ const ( ``` -## type [BusinessBotRights]() +## type [BusinessBotRights]() Represents the rights of a business bot. @@ -3431,7 +3723,7 @@ type BusinessBotRights struct { ``` -## type [BusinessConnection]() +## type [BusinessConnection]() Describes the connection of the bot with a business account. @@ -3441,7 +3733,7 @@ type BusinessConnection struct { ID string `json:"id"` // Business account user that created the business connection User User `json:"user"` - // Identifier of a private chat with the user who created the business connection. This number may have more than 32 significant bits and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a 64-bit integer or double-precision float type are safe for storing this identifier. + // Identifier of a private chat with the user who created the business connection. This number may have more than 32 significant bits and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a 64-bit integer or double-precision float type is safe for storing this identifier. UserChatID int64 `json:"user_chat_id"` // Date the connection was established in Unix time Date int64 `json:"date"` @@ -3453,7 +3745,7 @@ type BusinessConnection struct { ``` -### func [GetBusinessConnection]() +### func [GetBusinessConnection]() ```go func GetBusinessConnection(ctx context.Context, b *client.Bot, p *GetBusinessConnectionParams) (*BusinessConnection, error) @@ -3464,7 +3756,7 @@ GetBusinessConnection calls the getBusinessConnection Telegram Bot API method. Use this method to get information about the connection of the bot with a business account. Returns a BusinessConnection object on success. -## type [BusinessIntro]() +## type [BusinessIntro]() Contains information about the start page settings of a Telegram Business account. @@ -3480,7 +3772,7 @@ type BusinessIntro struct { ``` -## type [BusinessLocation]() +## type [BusinessLocation]() Contains information about the location of a Telegram Business account. @@ -3494,7 +3786,7 @@ type BusinessLocation struct { ``` -## type [BusinessMessagesDeleted]() +## type [BusinessMessagesDeleted]() This object is received when messages are deleted from a connected business account. @@ -3510,7 +3802,7 @@ type BusinessMessagesDeleted struct { ``` -## type [BusinessOpeningHours]() +## type [BusinessOpeningHours]() Describes the opening hours of a business. @@ -3524,7 +3816,7 @@ type BusinessOpeningHours struct { ``` -## type [BusinessOpeningHoursInterval]() +## type [BusinessOpeningHoursInterval]() Describes an interval of time during which a business is open. @@ -3538,7 +3830,7 @@ type BusinessOpeningHoursInterval struct { ``` -## type [CallbackGame]() +## type [CallbackGame]() A placeholder, currently holds no information. Use BotFather to set up your game. @@ -3548,9 +3840,9 @@ type CallbackGame struct { ``` -## type [CallbackQuery]() +## type [CallbackQuery]() -This 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 the button was attached to a message sent via the bot \(in inline mode\), the field inline\_message\_id will be present. Exactly one of the fields data or game\_short\_name will be present. NOTE: After the user presses a callback button, Telegram clients will display a progress bar until you call answerCallbackQuery. It is, therefore, necessary to react by calling answerCallbackQuery even if no notification to the user is needed \(e.g., without specifying any of the optional parameters\). +This object represents an incoming callback query from a callback button in an inline keyboard or in a rich message. If the button that originated the query belongs to a message sent by the bot, the field message will be present, unless the field inline\_message\_id is used instead as specified by the parameter callback\_query\_mode of the method setMySettings. If the button belongs to a message sent via the bot \(in inline mode\), the field inline\_message\_id will be present. Exactly one of the fields data or game\_short\_name will be present. NOTE: After the user presses a callback button, Telegram clients will display a progress bar until you call answerCallbackQuery. It is, therefore, necessary to react by calling answerCallbackQuery even if no notification to the user is needed \(e.g., without specifying any of the optional parameters\). ```go type CallbackQuery struct { @@ -3560,11 +3852,11 @@ type CallbackQuery struct { From User `json:"from"` // Optional. Message sent by the bot with the callback button that originated the query Message MaybeInaccessibleMessage `json:"message,omitempty"` - // Optional. Identifier of the message sent via the bot in inline mode, that originated the query + // Optional. Identifier of the message sent via the bot in inline mode, that originated the query. Can also be present for messages sent by the bot, depending on the parameter callback_query_mode of the method setMySettings. InlineMessageID string `json:"inline_message_id,omitempty"` // Global identifier, uniquely corresponding to the chat to which the message with the callback button was sent. Useful for high scores in games. ChatInstance string `json:"chat_instance"` - // Optional. Data associated with the callback button. Be aware that the message originated the query can contain no callback buttons with this data. + // Optional. Data associated with the callback button. Be aware that the message that originated the query can contain no callback buttons with this data. Data string `json:"data,omitempty"` // Optional. Short name of a Game to be returned, serves as the unique identifier for the game GameShortName string `json:"game_short_name,omitempty"` @@ -3572,7 +3864,7 @@ type CallbackQuery struct { ``` -### func \(\*CallbackQuery\) [UnmarshalJSON]() +### func \(\*CallbackQuery\) [UnmarshalJSON]() ```go func (m *CallbackQuery) UnmarshalJSON(data []byte) error @@ -3580,14 +3872,33 @@ func (m *CallbackQuery) UnmarshalJSON(data []byte) error UnmarshalJSON decodes CallbackQuery by dispatching union\-typed fields \(Message\) through their concrete UnmarshalXxx helpers. + +## type [CallbackQueryMode]() + + + +```go +type CallbackQueryMode string +``` + + + +```go +const ( + CallbackQueryModeDefault CallbackQueryMode = "default" + CallbackQueryModeAuto CallbackQueryMode = "auto" + CallbackQueryModeInline CallbackQueryMode = "inline" +) +``` + -## type [Chat]() +## type [Chat]() This object represents a chat. ```go type Chat struct { - // Unique identifier for this chat. This number may have more than 32 significant bits and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a signed 64-bit integer or double-precision float type are safe for storing this identifier. + // Unique identifier for this chat. This number may have more than 32 significant bits and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a signed 64-bit integer or double-precision float type is safe for storing this identifier. ID int64 `json:"id"` // Type of the chat, can be either “private”, “group”, “supergroup” or “channel” Type ChatType `json:"type"` @@ -3607,7 +3918,7 @@ type Chat struct { ``` -## type [ChatAdministratorRights]() +## type [ChatAdministratorRights]() Represents the rights of an administrator in a chat. @@ -3653,7 +3964,7 @@ type ChatAdministratorRights struct { ``` -### func [GetMyDefaultAdministratorRights]() +### func [GetMyDefaultAdministratorRights]() ```go func GetMyDefaultAdministratorRights(ctx context.Context, b *client.Bot, p *GetMyDefaultAdministratorRightsParams) (*ChatAdministratorRights, error) @@ -3664,7 +3975,7 @@ GetMyDefaultAdministratorRights calls the getMyDefaultAdministratorRights Telegr Use this method to get the current default administrator rights of the bot. Returns ChatAdministratorRights on success. -## type [ChatBackground]() +## type [ChatBackground]() This object represents a chat background. @@ -3676,7 +3987,7 @@ type ChatBackground struct { ``` -### func \(\*ChatBackground\) [UnmarshalJSON]() +### func \(\*ChatBackground\) [UnmarshalJSON]() ```go func (m *ChatBackground) UnmarshalJSON(data []byte) error @@ -3685,7 +3996,7 @@ func (m *ChatBackground) UnmarshalJSON(data []byte) error UnmarshalJSON decodes ChatBackground by dispatching union\-typed fields \(Type\) through their concrete UnmarshalXxx helpers. -## type [ChatBoost]() +## type [ChatBoost]() This object contains information about a chat boost. @@ -3703,7 +4014,7 @@ type ChatBoost struct { ``` -### func \(\*ChatBoost\) [UnmarshalJSON]() +### func \(\*ChatBoost\) [UnmarshalJSON]() ```go func (m *ChatBoost) UnmarshalJSON(data []byte) error @@ -3712,7 +4023,7 @@ func (m *ChatBoost) UnmarshalJSON(data []byte) error UnmarshalJSON decodes ChatBoost by dispatching union\-typed fields \(Source\) through their concrete UnmarshalXxx helpers. -## type [ChatBoostAdded]() +## type [ChatBoostAdded]() This object represents a service message about a user boosting a chat. @@ -3724,7 +4035,7 @@ type ChatBoostAdded struct { ``` -## type [ChatBoostRemoved]() +## type [ChatBoostRemoved]() This object represents a boost removed from a chat. @@ -3742,7 +4053,7 @@ type ChatBoostRemoved struct { ``` -### func \(\*ChatBoostRemoved\) [UnmarshalJSON]() +### func \(\*ChatBoostRemoved\) [UnmarshalJSON]() ```go func (m *ChatBoostRemoved) UnmarshalJSON(data []byte) error @@ -3751,7 +4062,7 @@ func (m *ChatBoostRemoved) UnmarshalJSON(data []byte) error UnmarshalJSON decodes ChatBoostRemoved by dispatching union\-typed fields \(Source\) through their concrete UnmarshalXxx helpers. -## type [ChatBoostSource]() +## type [ChatBoostSource]() ChatBoostSource is a union type. The following concrete variants implement it: @@ -3768,7 +4079,7 @@ type ChatBoostSource interface { ``` -### func [UnmarshalChatBoostSource]() +### func [UnmarshalChatBoostSource]() ```go func UnmarshalChatBoostSource(data []byte) (ChatBoostSource, error) @@ -3777,7 +4088,7 @@ func UnmarshalChatBoostSource(data []byte) (ChatBoostSource, error) UnmarshalChatBoostSource decodes a ChatBoostSource from JSON by inspecting the "source" field and dispatching to the correct concrete type. -## type [ChatBoostSourceGiftCode]() +## type [ChatBoostSourceGiftCode]() The 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. @@ -3785,13 +4096,13 @@ The boost was obtained by the creation of Telegram Premium gift codes to boost a type ChatBoostSourceGiftCode struct { // Source of the boost, always “gift_code” Source ChatBoostSourceKind `json:"source"` - // User for which the gift code was created + // User for whom the gift code was created User User `json:"user"` } ``` -### func \(\*ChatBoostSourceGiftCode\) [MarshalJSON]() +### func \(\*ChatBoostSourceGiftCode\) [MarshalJSON]() ```go func (v *ChatBoostSourceGiftCode) MarshalJSON() ([]byte, error) @@ -3800,7 +4111,7 @@ func (v *ChatBoostSourceGiftCode) MarshalJSON() ([]byte, error) MarshalJSON encodes ChatBoostSourceGiftCode with the discriminator field "source" forced to "gift\_code". The hardcoded value frees callers from setting Source by hand — any user\-supplied value on the struct literal is overridden so a typo can't slip through to Telegram. -## type [ChatBoostSourceGiveaway]() +## type [ChatBoostSourceGiveaway]() The 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 and prize\_star\_count / 500 times for one year for Telegram Star giveaways. @@ -3820,7 +4131,7 @@ type ChatBoostSourceGiveaway struct { ``` -### func \(\*ChatBoostSourceGiveaway\) [MarshalJSON]() +### func \(\*ChatBoostSourceGiveaway\) [MarshalJSON]() ```go func (v *ChatBoostSourceGiveaway) MarshalJSON() ([]byte, error) @@ -3829,7 +4140,7 @@ func (v *ChatBoostSourceGiveaway) MarshalJSON() ([]byte, error) MarshalJSON encodes ChatBoostSourceGiveaway with the discriminator field "source" forced to "giveaway". The hardcoded value frees callers from setting Source by hand — any user\-supplied value on the struct literal is overridden so a typo can't slip through to Telegram. -## type [ChatBoostSourceKind]() +## type [ChatBoostSourceKind]() @@ -3848,7 +4159,7 @@ const ( ``` -## type [ChatBoostSourcePremium]() +## type [ChatBoostSourcePremium]() The boost was obtained by subscribing to Telegram Premium or by gifting a Telegram Premium subscription to another user. @@ -3862,7 +4173,7 @@ type ChatBoostSourcePremium struct { ``` -### func \(\*ChatBoostSourcePremium\) [MarshalJSON]() +### func \(\*ChatBoostSourcePremium\) [MarshalJSON]() ```go func (v *ChatBoostSourcePremium) MarshalJSON() ([]byte, error) @@ -3871,7 +4182,7 @@ func (v *ChatBoostSourcePremium) MarshalJSON() ([]byte, error) MarshalJSON encodes ChatBoostSourcePremium with the discriminator field "source" forced to "premium". The hardcoded value frees callers from setting Source by hand — any user\-supplied value on the struct literal is overridden so a typo can't slip through to Telegram. -## type [ChatBoostUpdated]() +## type [ChatBoostUpdated]() This object represents a boost added to a chat or changed. @@ -3885,13 +4196,13 @@ type ChatBoostUpdated struct { ``` -## type [ChatFullInfo]() +## type [ChatFullInfo]() This object contains full information about a chat. ```go type ChatFullInfo struct { - // Unique identifier for this chat. This number may have more than 32 significant bits and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a signed 64-bit integer or double-precision float type are safe for storing this identifier. + // Unique identifier for this chat. This number may have more than 32 significant bits and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a signed 64-bit integer or double-precision float type is safe for storing this identifier. ID int64 `json:"id"` // Type of the chat, can be either “private”, “group”, “supergroup” or “channel” Type ChatType `json:"type"` @@ -3941,7 +4252,7 @@ type ChatFullInfo struct { EmojiStatusExpirationDate *int64 `json:"emoji_status_expiration_date,omitempty"` // Optional. Bio of the other party in a private chat Bio string `json:"bio,omitempty"` - // Optional. True, if privacy settings of the other party in the private chat allows to use tg://user?id= links only in chats with the user + // Optional. True, if the privacy settings of the other party in the private chat allow using tg://user?id= links only in chats with the user HasPrivateForwards *bool `json:"has_private_forwards,omitempty"` // Optional. True, if the privacy settings of the other party restrict sending voice and video note messages in the private chat HasRestrictedVoiceAndVideoMessages *bool `json:"has_restricted_voice_and_video_messages,omitempty"` @@ -3981,7 +4292,7 @@ type ChatFullInfo struct { CanSetStickerSet *bool `json:"can_set_sticker_set,omitempty"` // Optional. For supergroups, the name of the group's custom emoji sticker set. Custom emoji from this set can be used by all users and bots in the group. CustomEmojiStickerSetName string `json:"custom_emoji_sticker_set_name,omitempty"` - // Optional. Unique identifier for the linked chat, i.e. the discussion group identifier for a channel and vice versa; for supergroups and channel chats. This identifier may be greater than 32 bits and some programming languages may have difficulty/silent defects in interpreting it. But it is smaller than 52 bits, so a signed 64 bit integer or double-precision float type are safe for storing this identifier. + // Optional. Unique identifier for the linked chat, i.e. the discussion group identifier for a channel and vice versa; for supergroups and channel chats. This identifier may be greater than 32 bits and some programming languages may have difficulty/silent defects in interpreting it. But it is smaller than 52 bits, so a signed 64-bit integer or double-precision float type is safe for storing this identifier. LinkedChatID *int64 `json:"linked_chat_id,omitempty"` // Optional. For supergroups, the location to which the supergroup is connected Location *ChatLocation `json:"location,omitempty"` @@ -3997,11 +4308,15 @@ type ChatFullInfo struct { GuardBot *User `json:"guard_bot,omitempty"` // Optional. The Community to which the chat belongs Community *Community `json:"community,omitempty"` + // Optional. For private chats, the TON wallet card of the user, which is shown on their profile page + TonWalletCard *TonWalletCard `json:"ton_wallet_card,omitempty"` + // Optional. For private chats, supergroups and channels, the theme of the screen for sharing a link to the user or the chat; omitted if the default theme is used + ShareTheme ChatShareTheme `json:"share_theme,omitempty"` } ``` -### func [GetChat]() +### func [GetChat]() ```go func GetChat(ctx context.Context, b *client.Bot, p *GetChatParams) (*ChatFullInfo, error) @@ -4012,13 +4327,13 @@ GetChat calls the getChat Telegram Bot API method. Use this method to get up\-to\-date information about the chat. Returns a ChatFullInfo object on success. -### func \(\*ChatFullInfo\) [UnmarshalJSON]() +### func \(\*ChatFullInfo\) [UnmarshalJSON]() ```go func (m *ChatFullInfo) UnmarshalJSON(data []byte) error ``` -UnmarshalJSON decodes ChatFullInfo by dispatching union\-typed fields \(AvailableReactions\) through their concrete UnmarshalXxx helpers. +UnmarshalJSON decodes ChatFullInfo by dispatching union\-typed fields \(AvailableReactions, ShareTheme\) through their concrete UnmarshalXxx helpers. ## type [ChatID]() @@ -4086,7 +4401,7 @@ func (c *ChatID) UnmarshalJSON(data []byte) error UnmarshalJSON accepts either a JSON number or a JSON string. -## type [ChatInviteLink]() +## type [ChatInviteLink]() Represents an invite link for a chat. @@ -4104,7 +4419,7 @@ type ChatInviteLink struct { IsRevoked bool `json:"is_revoked"` // Optional. Invite link name Name string `json:"name,omitempty"` - // Optional. Point in time (Unix timestamp) when the link will expire or has been expired + // Optional. Point in time (Unix timestamp) when the link will expire or has expired ExpireDate *int64 `json:"expire_date,omitempty"` // Optional. The maximum number of users that can be members of the chat simultaneously after joining the chat via this invite link; 1-99999 MemberLimit *int64 `json:"member_limit,omitempty"` @@ -4118,7 +4433,7 @@ type ChatInviteLink struct { ``` -### func [CreateChatInviteLink]() +### func [CreateChatInviteLink]() ```go func CreateChatInviteLink(ctx context.Context, b *client.Bot, p *CreateChatInviteLinkParams) (*ChatInviteLink, error) @@ -4126,10 +4441,10 @@ func CreateChatInviteLink(ctx context.Context, b *client.Bot, p *CreateChatInvit CreateChatInviteLink calls the createChatInviteLink Telegram Bot API method. -Use 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 revokeChatInviteLink. Returns the new invite link as ChatInviteLink object. +Use 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 revokeChatInviteLink. Returns the new invite link as a ChatInviteLink object. -### func [CreateChatSubscriptionInviteLink]() +### func [CreateChatSubscriptionInviteLink]() ```go func CreateChatSubscriptionInviteLink(ctx context.Context, b *client.Bot, p *CreateChatSubscriptionInviteLinkParams) (*ChatInviteLink, error) @@ -4137,10 +4452,10 @@ func CreateChatSubscriptionInviteLink(ctx context.Context, b *client.Bot, p *Cre CreateChatSubscriptionInviteLink calls the createChatSubscriptionInviteLink Telegram Bot API method. -Use 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 using the method revokeChatInviteLink. Returns the new invite link as a ChatInviteLink object. +Use this method to create a subscription invite link for a channel chat. The bot must have the can\_invite\_users administrator right. The link can be edited using the method editChatSubscriptionInviteLink or revoked using the method revokeChatInviteLink. Returns the new invite link as a ChatInviteLink object. -### func [EditChatInviteLink]() +### func [EditChatInviteLink]() ```go func EditChatInviteLink(ctx context.Context, b *client.Bot, p *EditChatInviteLinkParams) (*ChatInviteLink, error) @@ -4151,7 +4466,7 @@ EditChatInviteLink calls the editChatInviteLink Telegram Bot API method. Use 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 ChatInviteLink object. -### func [EditChatSubscriptionInviteLink]() +### func [EditChatSubscriptionInviteLink]() ```go func EditChatSubscriptionInviteLink(ctx context.Context, b *client.Bot, p *EditChatSubscriptionInviteLinkParams) (*ChatInviteLink, error) @@ -4159,10 +4474,10 @@ func EditChatSubscriptionInviteLink(ctx context.Context, b *client.Bot, p *EditC EditChatSubscriptionInviteLink calls the editChatSubscriptionInviteLink Telegram Bot API method. -Use 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. +Use this method to edit a subscription invite link created by the bot. The bot must have the can\_invite\_users administrator right. Returns the edited invite link as a ChatInviteLink object. -### func [RevokeChatInviteLink]() +### func [RevokeChatInviteLink]() ```go func RevokeChatInviteLink(ctx context.Context, b *client.Bot, p *RevokeChatInviteLinkParams) (*ChatInviteLink, error) @@ -4170,10 +4485,10 @@ func RevokeChatInviteLink(ctx context.Context, b *client.Bot, p *RevokeChatInvit RevokeChatInviteLink calls the revokeChatInviteLink Telegram Bot API method. -Use 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 appropriate administrator rights. Returns the revoked invite link as ChatInviteLink object. +Use 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 appropriate administrator rights. Returns the revoked invite link as a ChatInviteLink object. -## type [ChatJoinRequest]() +## type [ChatJoinRequest]() Represents a join request sent to a chat. @@ -4183,7 +4498,7 @@ type ChatJoinRequest struct { Chat Chat `json:"chat"` // User that sent the join request From User `json:"from"` - // Identifier of a private chat with the user who sent the join request. This number may have more than 32 significant bits and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a 64-bit integer or double-precision float type are safe for storing this identifier. The bot can use this identifier for 5 minutes to send messages until the join request is processed, assuming no other administrator contacted the user. + // Identifier of a private chat with the user who sent the join request. This number may have more than 32 significant bits and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a 64-bit integer or double-precision float type is safe for storing this identifier. The bot can use this identifier for 5 minutes to send messages until the join request is processed, assuming no other administrator contacted the user. UserChatID int64 `json:"user_chat_id"` // Date the request was sent in Unix time Date int64 `json:"date"` @@ -4197,7 +4512,7 @@ type ChatJoinRequest struct { ``` -## type [ChatLocation]() +## type [ChatLocation]() Represents a location to which a chat is connected. @@ -4211,7 +4526,7 @@ type ChatLocation struct { ``` -## type [ChatMember]() +## type [ChatMember]() ChatMember is a union type. The following concrete variants implement it: @@ -4231,7 +4546,7 @@ type ChatMember interface { ``` -### func [GetChatAdministrators]() +### func [GetChatAdministrators]() ```go func GetChatAdministrators(ctx context.Context, b *client.Bot, p *GetChatAdministratorsParams) ([]ChatMember, error) @@ -4242,7 +4557,7 @@ GetChatAdministrators calls the getChatAdministrators Telegram Bot API method. Use this method to get a list of administrators in a chat. Returns an Array of ChatMember objects. -### func [GetChatMember]() +### func [GetChatMember]() ```go func GetChatMember(ctx context.Context, b *client.Bot, p *GetChatMemberParams) (ChatMember, error) @@ -4253,7 +4568,7 @@ GetChatMember calls the getChatMember Telegram Bot API method. Use 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. -### func [UnmarshalChatMember]() +### func [UnmarshalChatMember]() ```go func UnmarshalChatMember(data []byte) (ChatMember, error) @@ -4262,7 +4577,7 @@ func UnmarshalChatMember(data []byte) (ChatMember, error) UnmarshalChatMember decodes a ChatMember from JSON by inspecting the "status" field and dispatching to the correct concrete type. -## type [ChatMemberAdministrator]() +## type [ChatMemberAdministrator]() Represents a chat member that has some additional privileges. @@ -4316,7 +4631,7 @@ type ChatMemberAdministrator struct { ``` -### func \(\*ChatMemberAdministrator\) [MarshalJSON]() +### func \(\*ChatMemberAdministrator\) [MarshalJSON]() ```go func (v *ChatMemberAdministrator) MarshalJSON() ([]byte, error) @@ -4325,7 +4640,7 @@ func (v *ChatMemberAdministrator) MarshalJSON() ([]byte, error) MarshalJSON encodes ChatMemberAdministrator with the discriminator field "status" forced to "administrator". The hardcoded value frees callers from setting Status by hand — any user\-supplied value on the struct literal is overridden so a typo can't slip through to Telegram. -## type [ChatMemberBanned]() +## type [ChatMemberBanned]() Represents a chat member that was banned in the chat and can't return to the chat or view chat messages. @@ -4341,7 +4656,7 @@ type ChatMemberBanned struct { ``` -### func \(\*ChatMemberBanned\) [MarshalJSON]() +### func \(\*ChatMemberBanned\) [MarshalJSON]() ```go func (v *ChatMemberBanned) MarshalJSON() ([]byte, error) @@ -4350,7 +4665,7 @@ func (v *ChatMemberBanned) MarshalJSON() ([]byte, error) MarshalJSON encodes ChatMemberBanned with the discriminator field "status" forced to "kicked". The hardcoded value frees callers from setting Status by hand — any user\-supplied value on the struct literal is overridden so a typo can't slip through to Telegram. -## type [ChatMemberLeft]() +## type [ChatMemberLeft]() Represents a chat member that isn't currently a member of the chat, but may join it themselves. @@ -4364,7 +4679,7 @@ type ChatMemberLeft struct { ``` -### func \(\*ChatMemberLeft\) [MarshalJSON]() +### func \(\*ChatMemberLeft\) [MarshalJSON]() ```go func (v *ChatMemberLeft) MarshalJSON() ([]byte, error) @@ -4373,7 +4688,7 @@ func (v *ChatMemberLeft) MarshalJSON() ([]byte, error) MarshalJSON encodes ChatMemberLeft with the discriminator field "status" forced to "left". The hardcoded value frees callers from setting Status by hand — any user\-supplied value on the struct literal is overridden so a typo can't slip through to Telegram. -## type [ChatMemberMember]() +## type [ChatMemberMember]() Represents a chat member that has no additional privileges or restrictions. @@ -4391,7 +4706,7 @@ type ChatMemberMember struct { ``` -### func \(\*ChatMemberMember\) [MarshalJSON]() +### func \(\*ChatMemberMember\) [MarshalJSON]() ```go func (v *ChatMemberMember) MarshalJSON() ([]byte, error) @@ -4400,7 +4715,7 @@ func (v *ChatMemberMember) MarshalJSON() ([]byte, error) MarshalJSON encodes ChatMemberMember with the discriminator field "status" forced to "member". The hardcoded value frees callers from setting Status by hand — any user\-supplied value on the struct literal is overridden so a typo can't slip through to Telegram. -## type [ChatMemberOwner]() +## type [ChatMemberOwner]() Represents a chat member that owns the chat and has all administrator privileges. @@ -4418,7 +4733,7 @@ type ChatMemberOwner struct { ``` -### func \(\*ChatMemberOwner\) [MarshalJSON]() +### func \(\*ChatMemberOwner\) [MarshalJSON]() ```go func (v *ChatMemberOwner) MarshalJSON() ([]byte, error) @@ -4427,7 +4742,7 @@ func (v *ChatMemberOwner) MarshalJSON() ([]byte, error) MarshalJSON encodes ChatMemberOwner with the discriminator field "status" forced to "creator". The hardcoded value frees callers from setting Status by hand — any user\-supplied value on the struct literal is overridden so a typo can't slip through to Telegram. -## type [ChatMemberRestricted]() +## type [ChatMemberRestricted]() Represents a chat member that is under certain restrictions in the chat. Supergroups only. @@ -4457,7 +4772,7 @@ type ChatMemberRestricted struct { CanSendVoiceNotes bool `json:"can_send_voice_notes"` // True, if the user is allowed to send polls and checklists CanSendPolls bool `json:"can_send_polls"` - // True, if the user is allowed to send animations, games, stickers and use inline bots + // True, if the user is allowed to send animations, games, stickers, widgets and use inline bots CanSendOtherMessages bool `json:"can_send_other_messages"` // True, if the user is allowed to add web page previews to their messages CanAddWebPagePreviews bool `json:"can_add_web_page_previews"` @@ -4479,7 +4794,7 @@ type ChatMemberRestricted struct { ``` -### func \(\*ChatMemberRestricted\) [MarshalJSON]() +### func \(\*ChatMemberRestricted\) [MarshalJSON]() ```go func (v *ChatMemberRestricted) MarshalJSON() ([]byte, error) @@ -4488,7 +4803,7 @@ func (v *ChatMemberRestricted) MarshalJSON() ([]byte, error) MarshalJSON encodes ChatMemberRestricted with the discriminator field "status" forced to "restricted". The hardcoded value frees callers from setting Status by hand — any user\-supplied value on the struct literal is overridden so a typo can't slip through to Telegram. -## type [ChatMemberStatus]() +## type [ChatMemberStatus]() @@ -4510,7 +4825,7 @@ const ( ``` -## type [ChatMemberUpdated]() +## type [ChatMemberUpdated]() This object represents changes in the status of a chat member. @@ -4536,7 +4851,7 @@ type ChatMemberUpdated struct { ``` -### func \(\*ChatMemberUpdated\) [UnmarshalJSON]() +### func \(\*ChatMemberUpdated\) [UnmarshalJSON]() ```go func (m *ChatMemberUpdated) UnmarshalJSON(data []byte) error @@ -4545,7 +4860,7 @@ func (m *ChatMemberUpdated) UnmarshalJSON(data []byte) error UnmarshalJSON decodes ChatMemberUpdated by dispatching union\-typed fields \(OldChatMember, NewChatMember\) through their concrete UnmarshalXxx helpers. -## type [ChatOwnerChanged]() +## type [ChatOwnerChanged]() Describes a service message about an ownership change in the chat. @@ -4557,7 +4872,7 @@ type ChatOwnerChanged struct { ``` -## type [ChatOwnerLeft]() +## type [ChatOwnerLeft]() Describes a service message about the chat owner leaving the chat. @@ -4569,7 +4884,7 @@ type ChatOwnerLeft struct { ``` -## type [ChatPermissions]() +## type [ChatPermissions]() Describes actions that a non\-administrator user is allowed to take in a chat. @@ -4591,7 +4906,7 @@ type ChatPermissions struct { CanSendVoiceNotes *bool `json:"can_send_voice_notes,omitempty"` // Optional. True, if the user is allowed to send polls and checklists CanSendPolls *bool `json:"can_send_polls,omitempty"` - // Optional. True, if the user is allowed to send animations, games, stickers and use inline bots + // Optional. True, if the user is allowed to send animations, games, stickers, widgets and use inline bots CanSendOtherMessages *bool `json:"can_send_other_messages,omitempty"` // Optional. True, if the user is allowed to add web page previews to their messages CanAddWebPagePreviews *bool `json:"can_add_web_page_previews,omitempty"` @@ -4611,7 +4926,7 @@ type ChatPermissions struct { ``` -## type [ChatPhoto]() +## type [ChatPhoto]() This object represents a chat photo. @@ -4628,8 +4943,147 @@ type ChatPhoto struct { } ``` + +## type [ChatShareTheme]() + +ChatShareTheme is a union type. The following concrete variants implement it: + +- ChatShareThemeEmoji +- ChatShareThemeUniqueGift + +This object describes the theme of the screen for sharing a link to a user or a chat. Currently, it can be one of + +```go +type ChatShareTheme interface { + // contains filtered or unexported methods +} +``` + + +### func [UnmarshalChatShareTheme]() + +```go +func UnmarshalChatShareTheme(data []byte) (ChatShareTheme, error) +``` + +UnmarshalChatShareTheme decodes a ChatShareTheme from JSON by inspecting the "type" field and dispatching to the correct concrete type. + + +## type [ChatShareThemeBackdrop]() + +This 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. + +```go +type ChatShareThemeBackdrop struct { + // Unique identifier of the backdrop + ID int64 `json:"id"` + // Name of the backdrop + Name string `json:"name"` + // Colors of the backdrop + Colors UniqueGiftBackdropColors `json:"colors"` +} +``` + + +## type [ChatShareThemeBackdrops]() + +This 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. + +```go +type ChatShareThemeBackdrops struct { + // The list of backdrops + Backdrops []ChatShareThemeBackdrop `json:"backdrops"` +} +``` + + +### func [GetChatShareThemeBackdrops]() + +```go +func GetChatShareThemeBackdrops(ctx context.Context, b *client.Bot, p *GetChatShareThemeBackdropsParams) (*ChatShareThemeBackdrops, error) +``` + +GetChatShareThemeBackdrops calls the getChatShareThemeBackdrops Telegram Bot API method. + +Use 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. + + +## type [ChatShareThemeEmoji]() + +The theme with emoji placed on a background. + +```go +type ChatShareThemeEmoji struct { + // Type of the theme, always “emoji” + Type ChatShareThemeType `json:"type"` + // The emoji; 0-6 regular or custom emoji + Emojis []EmojiType `json:"emojis"` + // Optional. Identifier of the backdrop used as the background; omitted if the default background is used. Use getChatShareThemeBackdrops to get details about the backdrop. + BackgroundBackdropID *int64 `json:"background_backdrop_id,omitempty"` +} +``` + + +### func \(\*ChatShareThemeEmoji\) [MarshalJSON]() + +```go +func (v *ChatShareThemeEmoji) MarshalJSON() ([]byte, error) +``` + +MarshalJSON encodes ChatShareThemeEmoji with the discriminator field "type" forced to "emoji". The hardcoded value frees callers from setting Type by hand — any user\-supplied value on the struct literal is overridden so a typo can't slip through to Telegram. + + +### func \(\*ChatShareThemeEmoji\) [UnmarshalJSON]() + +```go +func (m *ChatShareThemeEmoji) UnmarshalJSON(data []byte) error +``` + +UnmarshalJSON decodes ChatShareThemeEmoji by dispatching union\-typed fields \(Emojis\) through their concrete UnmarshalXxx helpers. + + +## type [ChatShareThemeType]() + + + +```go +type ChatShareThemeType string +``` + + + +```go +const ( + ChatShareThemeTypeEmoji ChatShareThemeType = "emoji" + ChatShareThemeTypeUniqueGift ChatShareThemeType = "unique_gift" +) +``` + + +## type [ChatShareThemeUniqueGift]() + +The theme based on a unique gift owned by the user or the chat. + +```go +type ChatShareThemeUniqueGift struct { + // Type of the theme, always “unique_gift” + Type ChatShareThemeType `json:"type"` + // The gift + Gift UniqueGift `json:"gift"` +} +``` + + +### func \(\*ChatShareThemeUniqueGift\) [MarshalJSON]() + +```go +func (v *ChatShareThemeUniqueGift) MarshalJSON() ([]byte, error) +``` + +MarshalJSON encodes ChatShareThemeUniqueGift with the discriminator field "type" forced to "unique\_gift". The hardcoded value frees callers from setting Type by hand — any user\-supplied value on the struct literal is overridden so a typo can't slip through to Telegram. + -## type [ChatShared]() +## type [ChatShared]() This object contains information about a chat that was shared with the bot using a KeyboardButtonRequestChat button. @@ -4637,7 +5091,7 @@ This object contains information about a chat that was shared with the bot using type ChatShared struct { // Identifier of the request RequestID int64 `json:"request_id"` - // Identifier of the shared chat. This number may have more than 32 significant bits and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a 64-bit integer or double-precision float type are safe for storing this identifier. The bot may not have access to the chat and could be unable to use this identifier, unless the chat is already known to the bot by some other means. + // Identifier of the shared chat. This number may have more than 32 significant bits and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a 64-bit integer or double-precision float type is safe for storing this identifier. The bot may not have access to the chat and could be unable to use this identifier, unless the chat is already known to the bot by some other means. ChatID int64 `json:"chat_id"` // Optional. Title of the chat, if the title was requested by the bot Title string `json:"title,omitempty"` @@ -4649,7 +5103,7 @@ type ChatShared struct { ``` -## type [ChatType]() +## type [ChatType]() @@ -4669,7 +5123,7 @@ const ( ``` -## type [Checklist]() +## type [Checklist]() Describes a checklist. @@ -4689,7 +5143,7 @@ type Checklist struct { ``` -## type [ChecklistTask]() +## type [ChecklistTask]() Describes a task in a checklist. @@ -4711,7 +5165,7 @@ type ChecklistTask struct { ``` -## type [ChecklistTasksAdded]() +## type [ChecklistTasksAdded]() Describes a service message about tasks added to a checklist. @@ -4725,7 +5179,7 @@ type ChecklistTasksAdded struct { ``` -## type [ChecklistTasksDone]() +## type [ChecklistTasksDone]() Describes a service message about checklist tasks marked as done or not done. @@ -4741,9 +5195,9 @@ type ChecklistTasksDone struct { ``` -## type [ChosenInlineResult]() +## type [ChosenInlineResult]() -Represents a result of an inline query that was chosen by the user and sent to their chat partner. Note: It is necessary to enable inline feedback via @BotFather in order to receive these objects in updates. +Represents a result of an inline query that was chosen by the user and sent to their chat partner. Note: It is necessary to enable inline feedback via @BotFather or using the parameter inline\_feedback\_share\_denominator of the method setMySettings in order to receive these objects in updates. ```go type ChosenInlineResult struct { @@ -4751,9 +5205,9 @@ type ChosenInlineResult struct { ResultID string `json:"result_id"` // The user that chose the result From User `json:"from"` - // Optional. Sender location, only for bots that require user location + // Optional. Sender location, only for bots that enabled user location requests via @BotFather or using the parameter needs_inline_query_location of the method setMySettings Location *Location `json:"location,omitempty"` - // Optional. Identifier of the sent inline message. Available only if there is an inline keyboard attached to the message. Will be also received in callback queries and can be used to edit the message. + // Optional. Identifier of the sent inline message. Available only if there is an inline keyboard attached to the message. Will also be received in callback queries and can be used to edit the message. InlineMessageID string `json:"inline_message_id,omitempty"` // The query that was used to obtain the result Query string `json:"query"` @@ -4761,11 +5215,11 @@ type ChosenInlineResult struct { ``` -## type [CloseForumTopicParams]() +## type [CloseForumTopicParams]() CloseForumTopicParams is the parameter set for CloseForumTopic. -Use 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 topic. Returns True on success. +Use 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 right, unless it is the creator of the topic. Returns True on success. ```go type CloseForumTopicParams struct { @@ -4777,11 +5231,11 @@ type CloseForumTopicParams struct { ``` -## type [CloseGeneralForumTopicParams]() +## type [CloseGeneralForumTopicParams]() CloseGeneralForumTopicParams is the parameter set for CloseGeneralForumTopic. -Use 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 success. +Use 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 right. Returns True on success. ```go type CloseGeneralForumTopicParams struct { @@ -4803,13 +5257,13 @@ type CloseParams struct { ``` -## type [Community]() +## type [Community]() Represents a community \(a group of chats\). ```go type Community struct { - // Unique identifier for this community. This number may have more than 32 significant bits and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a signed 64-bit integer or double-precision float type are safe for storing this identifier. + // Unique identifier for this community. This number may have more than 32 significant bits and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a signed 64-bit integer or double-precision float type is safe for storing this identifier. ID int64 `json:"id"` // Name of the community Name string `json:"name"` @@ -4817,7 +5271,7 @@ type Community struct { ``` -## type [CommunityChatAdded]() +## type [CommunityChatAdded]() Describes a service message about a chat or a bot being added to a community. @@ -4829,7 +5283,7 @@ type CommunityChatAdded struct { ``` -## type [CommunityChatJoined]() +## type [CommunityChatJoined]() Describes a service message about a chat being joined by a user from a community. @@ -4841,7 +5295,7 @@ type CommunityChatJoined struct { ``` -## type [CommunityChatRemoved]() +## type [CommunityChatRemoved]() Describes a service message about a chat or a bot being removed from a community. Currently holds no information. @@ -4851,7 +5305,7 @@ type CommunityChatRemoved struct { ``` -## type [Contact]() +## type [Contact]() This object represents a phone contact. @@ -4863,7 +5317,7 @@ type Contact struct { FirstName string `json:"first_name"` // Optional. Contact's last name LastName string `json:"last_name,omitempty"` - // Optional. Contact's user identifier in Telegram. This number may have more than 32 significant bits and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a 64-bit integer or double-precision float type are safe for storing this identifier. + // Optional. Contact's user identifier in Telegram. This number may have more than 32 significant bits and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a 64-bit integer or double-precision float type is safe for storing this identifier. UserID *int64 `json:"user_id,omitempty"` // Optional. Additional data about the contact in the form of a vCard Vcard string `json:"vcard,omitempty"` @@ -4871,7 +5325,7 @@ type Contact struct { ``` -## type [ConvertGiftToStarsParams]() +## type [ConvertGiftToStarsParams]() ConvertGiftToStarsParams is the parameter set for ConvertGiftToStars. @@ -4891,17 +5345,17 @@ type ConvertGiftToStarsParams struct { CopyMessageParams is the parameter set for CopyMessage. -Use this method to copy messages of any kind. Service messages, paid media messages, giveaway messages, giveaway winners messages, and invoice messages can't be copied. A quiz poll can be copied only if the value of the field correct\_option\_ids is known to the bot. The method is analogous to the method forwardMessage, but the copied message doesn't have a link to the original message. Returns the MessageId of the sent message on success. +Use 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 the value of the field correct\_option\_ids is known to the bot. The method is analogous to the method forwardMessage, but the copied message doesn't have a link to the original message. Returns the MessageId of the sent message on success. ```go type CopyMessageParams struct { - // Unique identifier for the target chat or username of the target bot, supergroup or channel in the format @username + // Unique identifier for the target chat or username of the target bot, supergroup, or channel in the format @username ChatID ChatID `json:"chat_id"` // Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only MessageThreadID *int64 `json:"message_thread_id,omitempty"` // Identifier of the direct messages topic to which the message will be sent; required if the message is sent to a direct messages chat DirectMessagesTopicID *int64 `json:"direct_messages_topic_id,omitempty"` - // Unique identifier for the chat where the original message was sent (or username of the target bot, supergroup or channel in the format @username) + // Unique identifier for the chat where the original message was sent (or username of the target bot, supergroup, or channel in the format @username) FromChatID ChatID `json:"from_chat_id"` // Message identifier in the chat specified in from_chat_id MessageID int64 `json:"message_id"` @@ -4937,17 +5391,17 @@ type CopyMessageParams struct { CopyMessagesParams is the parameter set for CopyMessages. -Use 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, and invoice messages can't be copied. A quiz poll can be copied only if the value of the field correct\_option\_ids is known to the bot. The method is analogous to the method forwardMessages, but the copied messages don't have a link to the original message. Album grouping is kept for copied messages. On success, an Array of MessageId of the sent messages is returned. +Use 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 messages, and widget messages can't be copied. A quiz poll can be copied only if the value of the field correct\_option\_ids is known to the bot. The method is analogous to the method forwardMessages, but the copied messages don't have a link to the original message. Album grouping is kept for copied messages. On success, an Array of MessageId of the sent messages is returned. ```go type CopyMessagesParams struct { - // Unique identifier for the target chat or username of the target bot, supergroup or channel in the format @username + // Unique identifier for the target chat or username of the target bot, supergroup, or channel in the format @username ChatID ChatID `json:"chat_id"` // Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only MessageThreadID *int64 `json:"message_thread_id,omitempty"` // Identifier of the direct messages topic to which the messages will be sent; required if the messages are sent to a direct messages chat DirectMessagesTopicID *int64 `json:"direct_messages_topic_id,omitempty"` - // Unique identifier for the chat where the original messages were sent (or username of the target bot, supergroup or channel in the format @username) + // Unique identifier for the chat where the original messages were sent (or username of the target bot, supergroup, or channel in the format @username) FromChatID ChatID `json:"from_chat_id"` // A JSON-serialized list of 1-100 identifiers of messages in the chat from_chat_id to copy. The identifiers must be specified in a strictly increasing order. MessageIds []int64 `json:"message_ids"` @@ -4961,7 +5415,7 @@ type CopyMessagesParams struct { ``` -## type [CopyTextButton]() +## type [CopyTextButton]() This object represents an inline keyboard button that copies specified text to the clipboard. @@ -4973,11 +5427,11 @@ type CopyTextButton struct { ``` -## type [CreateChatInviteLinkParams]() +## type [CreateChatInviteLinkParams]() CreateChatInviteLinkParams is the parameter set for CreateChatInviteLink. -Use 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 revokeChatInviteLink. Returns the new invite link as ChatInviteLink object. +Use 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 revokeChatInviteLink. Returns the new invite link as a ChatInviteLink object. ```go type CreateChatInviteLinkParams struct { @@ -4995,11 +5449,11 @@ type CreateChatInviteLinkParams struct { ``` -## type [CreateChatSubscriptionInviteLinkParams]() +## type [CreateChatSubscriptionInviteLinkParams]() CreateChatSubscriptionInviteLinkParams is the parameter set for CreateChatSubscriptionInviteLink. -Use 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 using the method revokeChatInviteLink. Returns the new invite link as a ChatInviteLink object. +Use this method to create a subscription invite link for a channel chat. The bot must have the can\_invite\_users administrator right. The link can be edited using the method editChatSubscriptionInviteLink or revoked using the method revokeChatInviteLink. Returns the new invite link as a ChatInviteLink object. ```go type CreateChatSubscriptionInviteLinkParams struct { @@ -5015,11 +5469,11 @@ type CreateChatSubscriptionInviteLinkParams struct { ``` -## type [CreateForumTopicParams]() +## type [CreateForumTopicParams]() CreateForumTopicParams is the parameter set for CreateForumTopic. -Use 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\_topics administrator right. Returns information about the created topic as a ForumTopic object. +Use 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\_topics administrator right. In the case of a private chat, a link to the topic can be created in the format https://t.me/\/\; the link opens the topic only for the user. Returns information about the created topic as a ForumTopic object. ```go type CreateForumTopicParams struct { @@ -5035,7 +5489,7 @@ type CreateForumTopicParams struct { ``` -## type [CreateInvoiceLinkParams]() +## type [CreateInvoiceLinkParams]() CreateInvoiceLinkParams is the parameter set for CreateInvoiceLink. @@ -5049,7 +5503,7 @@ type CreateInvoiceLinkParams struct { Title string `json:"title"` // Product description, 1-255 characters Description string `json:"description"` - // Bot-defined invoice payload, 1-128 bytes. This will not be displayed to the user, use it for your internal processes. + // Bot-defined invoice payload, 1-128 bytes. This will not be displayed to the user; use it for your internal processes. Payload string `json:"payload"` // Payment provider token, obtained via @BotFather. Pass an empty string for payments in Telegram Stars. ProviderToken string `json:"provider_token,omitempty"` @@ -5057,13 +5511,13 @@ type CreateInvoiceLinkParams struct { Currency string `json:"currency"` // Price breakdown, a JSON-serialized list of components (e.g. product price, tax, discount, delivery cost, delivery tax, bonus, etc.). Must contain exactly one item for payments in Telegram Stars. Prices []LabeledPrice `json:"prices"` - // The number of seconds the subscription will be active for before the next payment. The currency must be set to “XTR” (Telegram Stars) if the parameter is used. Currently, it must always be 2592000 (30 days) if specified. Any number of subscriptions can be active for a given bot at the same time, including multiple concurrent subscriptions from the same user. Subscription price must no exceed 10000 Telegram Stars. + // The number of seconds the subscription will be active for before the next payment. The currency must be set to “XTR” (Telegram Stars) if the parameter is used. Currently, it must always be 2592000 (30 days) if specified. Any number of subscriptions can be active for a given bot at the same time, including multiple concurrent subscriptions from the same user. Subscription price must not exceed 10000 Telegram Stars. SubscriptionPeriod *int64 `json:"subscription_period,omitempty"` - // The maximum accepted amount for tips in the smallest units of the currency (integer, not float/double). For example, for a maximum tip of US$ 1.45 pass max_tip_amount = 145. See the exp parameter in currencies.json, it shows the number of digits past the decimal point for each currency (2 for the majority of currencies). Defaults to 0. Not supported for payments in Telegram Stars. + // The maximum accepted amount for tips in the smallest units of the currency (integer, not float/double). For example, for a maximum tip of US$ 1.45 pass max_tip_amount = 145. See the exp parameter in currencies.json; it shows the number of digits past the decimal point for each currency (2 for the majority of currencies). Defaults to 0. Not supported for payments in Telegram Stars. MaxTipAmount *int64 `json:"max_tip_amount,omitempty"` - // A JSON-serialized Array of suggested amounts of tips in the smallest units of the currency (integer, not float/double). At most 4 suggested tip amounts can be specified. The suggested tip amounts must be positive, passed in a strictly increased order and must not exceed max_tip_amount. + // A JSON-serialized Array of suggested amounts of tips in the smallest units of the currency (integer, not float/double). At most 4 suggested tip amounts can be specified. The suggested tip amounts must be positive, passed in a strictly increasing order and must not exceed max_tip_amount. SuggestedTipAmounts []int64 `json:"suggested_tip_amounts,omitempty"` - // JSON-serialized data about the invoice, which will be shared with the payment provider. A detailed description of required fields should be provided by the payment provider. + // JSON-serialized data about the invoice, which will be shared with the payment provider. A detailed description of the required fields should be provided by the payment provider. ProviderData string `json:"provider_data,omitempty"` // URL of the product photo for the invoice. Can be a photo of the goods or a marketing image for a service. PhotoURL string `json:"photo_url,omitempty"` @@ -5091,7 +5545,7 @@ type CreateInvoiceLinkParams struct { ``` -## type [CreateNewStickerSetParams]() +## type [CreateNewStickerSetParams]() CreateNewStickerSetParams is the parameter set for CreateNewStickerSet. @@ -5115,7 +5569,7 @@ type CreateNewStickerSetParams struct { ``` -## type [DeclineChatJoinRequestParams]() +## type [DeclineChatJoinRequestParams]() DeclineChatJoinRequestParams is the parameter set for DeclineChatJoinRequest. @@ -5131,7 +5585,7 @@ type DeclineChatJoinRequestParams struct { ``` -## type [DeclineSuggestedPostParams]() +## type [DeclineSuggestedPostParams]() DeclineSuggestedPostParams is the parameter set for DeclineSuggestedPost. @@ -5149,7 +5603,7 @@ type DeclineSuggestedPostParams struct { ``` -## type [DeleteAllMessageReactionsParams]() +## type [DeleteAllMessageReactionsParams]() DeleteAllMessageReactionsParams is the parameter set for DeleteAllMessageReactions. @@ -5166,12 +5620,28 @@ type DeleteAllMessageReactionsParams struct { } ``` + +## type [DeleteBusinessAccountGiftParams]() + +DeleteBusinessAccountGiftParams is the parameter set for DeleteBusinessAccountGift. + +Deletes 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 total\_count of the Gift is omitted\) and wasn't refunded. Returns True on success. + +```go +type DeleteBusinessAccountGiftParams struct { + // Unique identifier of the business connection + BusinessConnectionID string `json:"business_connection_id"` + // Unique identifier of the regular gift that should be deleted + OwnedGiftID string `json:"owned_gift_id"` +} +``` + -## type [DeleteBusinessMessagesParams]() +## type [DeleteBusinessMessagesParams]() DeleteBusinessMessagesParams is the parameter set for DeleteBusinessMessages. -Delete 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 message. Returns True on success. +Deletes 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 message. Returns True on success. ```go type DeleteBusinessMessagesParams struct { @@ -5183,7 +5653,7 @@ type DeleteBusinessMessagesParams struct { ``` -## type [DeleteChatPhotoParams]() +## type [DeleteChatPhotoParams]() DeleteChatPhotoParams is the parameter set for DeleteChatPhoto. @@ -5197,7 +5667,7 @@ type DeleteChatPhotoParams struct { ``` -## type [DeleteChatStickerSetParams]() +## type [DeleteChatStickerSetParams]() DeleteChatStickerSetParams is the parameter set for DeleteChatStickerSet. @@ -5211,7 +5681,7 @@ type DeleteChatStickerSetParams struct { ``` -## type [DeleteEphemeralMessageParams]() +## type [DeleteEphemeralMessageParams]() DeleteEphemeralMessageParams is the parameter set for DeleteEphemeralMessage. @@ -5229,11 +5699,11 @@ type DeleteEphemeralMessageParams struct { ``` -## type [DeleteForumTopicParams]() +## type [DeleteForumTopicParams]() DeleteForumTopicParams is the parameter set for DeleteForumTopic. -Use this method to delete a forum topic along with all its messages in a forum supergroup chat or a private chat with a user. 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\_delete\_messages administrator rights. Returns True on success. +Use this method to delete a forum topic along with all its messages in a forum supergroup chat or a private chat with a user. 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\_delete\_messages administrator right. Returns True on success. ```go type DeleteForumTopicParams struct { @@ -5245,15 +5715,15 @@ type DeleteForumTopicParams struct { ``` -## type [DeleteMessageParams]() +## type [DeleteMessageParams]() DeleteMessageParams is the parameter set for DeleteMessage. -Use this method to delete a message, including service messages, with the following limitations:\- A message can only be deleted if it was sent less than 48 hours ago.\- Service messages about a supergroup, channel, or forum topic creation can't be deleted.\- A dice message in a private chat can only be deleted if it was sent more than 24 hours ago.\- Bots can delete outgoing messages in private chats, groups, and supergroups.\- Bots can delete incoming messages in private chats.\- Bots granted can\_post\_messages permissions can delete outgoing messages in channels.\- If the bot is an administrator of a group, it can delete any message there.\- If the bot has can\_delete\_messages administrator right in a supergroup or a channel, it can delete any message there.\- If the bot has can\_manage\_direct\_messages administrator right in a channel, it can delete any message in the corresponding direct messages chat.Returns True on success. +Use this method to delete a message, including service messages, with the following limitations:\- A message can only be deleted if it was sent less than 48 hours ago.\- Service messages about a supergroup, channel, or forum topic creation can't be deleted.\- A dice message in a private chat can only be deleted if it was sent more than 24 hours ago.\- Bots can delete outgoing messages in private chats, groups, and supergroups.\- Bots can delete incoming messages in private chats.\- Bots granted can\_post\_messages permissions can delete outgoing messages in channels.\- If the bot is an administrator of a group, it can delete any message there.\- If the bot has the can\_delete\_messages administrator right in a supergroup or a channel, it can delete any message there.\- If the bot has the can\_manage\_direct\_messages administrator right in a channel, it can delete any message in the corresponding direct messages chat.Returns True on success. ```go type DeleteMessageParams struct { - // Unique identifier for the target chat or username of the target bot, supergroup or channel in the format @username + // Unique identifier for the target chat or username of the target bot, supergroup, or channel in the format @username ChatID ChatID `json:"chat_id"` // Identifier of the message to delete MessageID int64 `json:"message_id"` @@ -5261,7 +5731,7 @@ type DeleteMessageParams struct { ``` -## type [DeleteMessageReactionParams]() +## type [DeleteMessageReactionParams]() DeleteMessageReactionParams is the parameter set for DeleteMessageReaction. @@ -5281,7 +5751,7 @@ type DeleteMessageReactionParams struct { ``` -## type [DeleteMessagesParams]() +## type [DeleteMessagesParams]() DeleteMessagesParams is the parameter set for DeleteMessages. @@ -5289,7 +5759,7 @@ Use this method to delete multiple messages simultaneously. If some of the speci ```go type DeleteMessagesParams struct { - // Unique identifier for the target chat or username of the target bot, supergroup or channel in the format @username + // Unique identifier for the target chat or username of the target bot, supergroup, or channel in the format @username ChatID ChatID `json:"chat_id"` // A JSON-serialized list of 1-100 identifiers of messages to delete. See deleteMessage for limitations on which messages can be deleted. MessageIds []int64 `json:"message_ids"` @@ -5297,7 +5767,7 @@ type DeleteMessagesParams struct { ``` -## type [DeleteMyCommandsParams]() +## type [DeleteMyCommandsParams]() DeleteMyCommandsParams is the parameter set for DeleteMyCommands. @@ -5313,7 +5783,7 @@ type DeleteMyCommandsParams struct { ``` -## type [DeleteStickerFromSetParams]() +## type [DeleteStickerFromSetParams]() DeleteStickerFromSetParams is the parameter set for DeleteStickerFromSet. @@ -5327,7 +5797,7 @@ type DeleteStickerFromSetParams struct { ``` -## type [DeleteStickerSetParams]() +## type [DeleteStickerSetParams]() DeleteStickerSetParams is the parameter set for DeleteStickerSet. @@ -5341,7 +5811,7 @@ type DeleteStickerSetParams struct { ``` -## type [DeleteStoryParams]() +## type [DeleteStoryParams]() DeleteStoryParams is the parameter set for DeleteStory. @@ -5371,7 +5841,7 @@ type DeleteWebhookParams struct { ``` -## type [Dice]() +## type [Dice]() This object represents an animated emoji that displays a random value. @@ -5407,7 +5877,7 @@ const ( ``` -## type [DirectMessagePriceChanged]() +## type [DirectMessagePriceChanged]() Describes a service message about a change in the price of direct messages sent to a channel chat. @@ -5421,13 +5891,13 @@ type DirectMessagePriceChanged struct { ``` -## type [DirectMessagesTopic]() +## type [DirectMessagesTopic]() Describes a topic of a direct messages chat. ```go type DirectMessagesTopic struct { - // Unique identifier of the topic. This number may have more than 32 significant bits and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a 64-bit integer or double-precision float type are safe for storing this identifier. + // Unique identifier of the topic. This number may have more than 32 significant bits and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a 64-bit integer or double-precision float type is safe for storing this identifier. TopicID int64 `json:"topic_id"` // Optional. Information about the user that created the topic. Currently, it is always present. User *User `json:"user,omitempty"` @@ -5435,7 +5905,7 @@ type DirectMessagesTopic struct { ``` -## type [DisabledButton]() +## type [DisabledButton]() This object represents a disabled button which does nothing. Currently holds no information. @@ -5445,7 +5915,7 @@ type DisabledButton struct { ``` -## type [Document]() +## type [Document]() This object represents a general file \(as opposed to photos, voice messages and audio files\). @@ -5461,13 +5931,13 @@ type Document struct { FileName string `json:"file_name,omitempty"` // Optional. MIME type of the file as defined by the sender MimeType string `json:"mime_type,omitempty"` - // Optional. File size in bytes. It can be bigger than 2^31 and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a signed 64-bit integer or double-precision float type are safe for storing this value. + // Optional. File size in bytes. It can be bigger than 2^31 and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a signed 64-bit integer or double-precision float type is safe for storing this value. FileSize *int64 `json:"file_size,omitempty"` } ``` -## type [EditChatInviteLinkParams]() +## type [EditChatInviteLinkParams]() EditChatInviteLinkParams is the parameter set for EditChatInviteLink. @@ -5491,11 +5961,11 @@ type EditChatInviteLinkParams struct { ``` -## type [EditChatSubscriptionInviteLinkParams]() +## type [EditChatSubscriptionInviteLinkParams]() EditChatSubscriptionInviteLinkParams is the parameter set for EditChatSubscriptionInviteLink. -Use 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. +Use this method to edit a subscription invite link created by the bot. The bot must have the can\_invite\_users administrator right. Returns the edited invite link as a ChatInviteLink object. ```go type EditChatSubscriptionInviteLinkParams struct { @@ -5509,7 +5979,7 @@ type EditChatSubscriptionInviteLinkParams struct { ``` -## type [EditEphemeralMessageCaptionParams]() +## type [EditEphemeralMessageCaptionParams]() EditEphemeralMessageCaptionParams is the parameter set for EditEphemeralMessageCaption. @@ -5529,7 +5999,7 @@ type EditEphemeralMessageCaptionParams struct { ParseMode ParseMode `json:"parse_mode,omitempty"` // A JSON-serialized list of special entities that appear in the caption, which can be specified instead of parse_mode CaptionEntities []MessageEntity `json:"caption_entities,omitempty"` - // Pass True if the caption must be shown above the message media. Supported only for animation, photo and video messages. + // Pass True if the caption must be shown above the message media. Supported only for animation, live photo, photo and video messages. ShowCaptionAboveMedia *bool `json:"show_caption_above_media,omitempty"` // A JSON-serialized object for an inline keyboard ReplyMarkup *InlineKeyboardMarkup `json:"reply_markup,omitempty"` @@ -5537,7 +6007,7 @@ type EditEphemeralMessageCaptionParams struct { ``` -## type [EditEphemeralMessageMediaParams]() +## type [EditEphemeralMessageMediaParams]() EditEphemeralMessageMediaParams is the parameter set for EditEphemeralMessageMedia. @@ -5559,7 +6029,7 @@ type EditEphemeralMessageMediaParams struct { ``` -### func \(\*EditEphemeralMessageMediaParams\) [HasFile]() +### func \(\*EditEphemeralMessageMediaParams\) [HasFile]() ```go func (p *EditEphemeralMessageMediaParams) HasFile() bool @@ -5568,7 +6038,7 @@ func (p *EditEphemeralMessageMediaParams) HasFile() bool HasFile reports whether a multipart upload is required. -### func \(\*EditEphemeralMessageMediaParams\) [MultipartFields]() +### func \(\*EditEphemeralMessageMediaParams\) [MultipartFields]() ```go func (p *EditEphemeralMessageMediaParams) MultipartFields() map[string]string @@ -5577,7 +6047,7 @@ func (p *EditEphemeralMessageMediaParams) MultipartFields() map[string]string MultipartFields returns the non\-file fields used in the multipart body. -### func \(\*EditEphemeralMessageMediaParams\) [MultipartFiles]() +### func \(\*EditEphemeralMessageMediaParams\) [MultipartFiles]() ```go func (p *EditEphemeralMessageMediaParams) MultipartFiles() []client.MultipartFile @@ -5586,7 +6056,7 @@ func (p *EditEphemeralMessageMediaParams) MultipartFiles() []client.MultipartFil MultipartFiles returns the file parts. -## type [EditEphemeralMessageReplyMarkupParams]() +## type [EditEphemeralMessageReplyMarkupParams]() EditEphemeralMessageReplyMarkupParams is the parameter set for EditEphemeralMessageReplyMarkup. @@ -5606,7 +6076,7 @@ type EditEphemeralMessageReplyMarkupParams struct { ``` -## type [EditEphemeralMessageTextParams]() +## type [EditEphemeralMessageTextParams]() EditEphemeralMessageTextParams is the parameter set for EditEphemeralMessageText. @@ -5636,11 +6106,11 @@ type EditEphemeralMessageTextParams struct { ``` -## type [EditForumTopicParams]() +## type [EditForumTopicParams]() EditForumTopicParams is the parameter set for EditForumTopic. -Use 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 can\_manage\_topics administrator rights, unless it is the creator of the topic. Returns True on success. +Use this method to edit the 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 can\_manage\_topics administrator right, unless it is the creator of the topic. Returns True on success. ```go type EditForumTopicParams struct { @@ -5656,11 +6126,11 @@ type EditForumTopicParams struct { ``` -## type [EditGeneralForumTopicParams]() +## type [EditGeneralForumTopicParams]() EditGeneralForumTopicParams is the parameter set for EditGeneralForumTopic. -Use 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 success. +Use 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 right. Returns True on success. ```go type EditGeneralForumTopicParams struct { @@ -5672,17 +6142,17 @@ type EditGeneralForumTopicParams struct { ``` -## type [EditMessageCaptionParams]() +## type [EditMessageCaptionParams]() EditMessageCaptionParams is the parameter set for EditMessageCaption. -Use 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 bot and do not contain an inline keyboard can only be edited within 48 hours from the time they were sent. +Use 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 bot and do not contain an inline keyboard can only be edited within 48 hours from the time they were sent. ```go type EditMessageCaptionParams struct { // Unique identifier of the business connection on behalf of which the message to be edited was sent BusinessConnectionID string `json:"business_connection_id,omitempty"` - // Required if inline_message_id is not specified. Unique identifier for the target chat or username of the target bot, supergroup or channel in the format @username. + // Required if inline_message_id is not specified. Unique identifier for the target chat or username of the target bot, supergroup, or channel in the format @username. ChatID *ChatID `json:"chat_id,omitempty"` // Required if inline_message_id is not specified. Identifier of the message to edit. MessageID *int64 `json:"message_id,omitempty"` @@ -5694,7 +6164,7 @@ type EditMessageCaptionParams struct { ParseMode ParseMode `json:"parse_mode,omitempty"` // A JSON-serialized list of special entities that appear in the caption, which can be specified instead of parse_mode CaptionEntities []MessageEntity `json:"caption_entities,omitempty"` - // Pass True if the caption must be shown above the message media. Supported only for animation, photo and video messages. + // Pass True if the caption must be shown above the message media. Supported only for animation, live photo, paid media, photo, video and widget messages. ShowCaptionAboveMedia *bool `json:"show_caption_above_media,omitempty"` // A JSON-serialized object for an inline keyboard ReplyMarkup *InlineKeyboardMarkup `json:"reply_markup,omitempty"` @@ -5702,7 +6172,7 @@ type EditMessageCaptionParams struct { ``` -## type [EditMessageChecklistParams]() +## type [EditMessageChecklistParams]() EditMessageChecklistParams is the parameter set for EditMessageChecklist. @@ -5710,7 +6180,7 @@ Use this method to edit a checklist on behalf of a connected business account. O ```go type EditMessageChecklistParams struct { - // Unique identifier of the business connection on behalf of which the message will be sent + // Unique identifier of the business connection on behalf of which the message to be edited was sent BusinessConnectionID string `json:"business_connection_id"` // Unique identifier for the target chat or username of the target bot in the format @username ChatID ChatID `json:"chat_id"` @@ -5724,17 +6194,17 @@ type EditMessageChecklistParams struct { ``` -## type [EditMessageLiveLocationParams]() +## type [EditMessageLiveLocationParams]() EditMessageLiveLocationParams is the parameter set for EditMessageLiveLocation. -Use 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 inline message, the edited Message is returned, otherwise True is returned. +Use 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 inline message, the edited Message is returned; otherwise, True is returned. ```go type EditMessageLiveLocationParams struct { // Unique identifier of the business connection on behalf of which the message to be edited was sent BusinessConnectionID string `json:"business_connection_id,omitempty"` - // Required if inline_message_id is not specified. Unique identifier for the target chat or username of the target bot, supergroup or channel in the format @username. + // Required if inline_message_id is not specified. Unique identifier for the target chat or username of the target bot, supergroup, or channel in the format @username. ChatID *ChatID `json:"chat_id,omitempty"` // Required if inline_message_id is not specified. Identifier of the message to edit. MessageID *int64 `json:"message_id,omitempty"` @@ -5758,17 +6228,17 @@ type EditMessageLiveLocationParams struct { ``` -## type [EditMessageMediaParams]() +## type [EditMessageMediaParams]() EditMessageMediaParams is the parameter set for EditMessageMedia. -Use 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 audio for audio albums, only to a document for document albums and to a photo, a live photo, or a video otherwise. When an inline message is edited, a new file can't be uploaded; use a previously uploaded file via its file\_id or specify a URL. 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 bot and do not contain an inline keyboard can only be edited within 48 hours from the time they were sent. +Use this method to edit animation, audio, document, live photo, photo, or video messages, or to replace a text or a rich message with media. If a message is part of a message album, then it can be edited only to an audio for audio albums, only to a document for document albums and to a photo, a live photo, or a video otherwise. When an inline message is edited, a new file can't be uploaded; use a previously uploaded file via its file\_id or specify a URL. 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 bot and do not contain an inline keyboard can only be edited within 48 hours from the time they were sent. ```go type EditMessageMediaParams struct { // Unique identifier of the business connection on behalf of which the message to be edited was sent BusinessConnectionID string `json:"business_connection_id,omitempty"` - // Required if inline_message_id is not specified. Unique identifier for the target chat or username of the target bot, supergroup or channel in the format @username. + // Required if inline_message_id is not specified. Unique identifier for the target chat or username of the target bot, supergroup, or channel in the format @username. ChatID *ChatID `json:"chat_id,omitempty"` // Required if inline_message_id is not specified. Identifier of the message to edit. MessageID *int64 `json:"message_id,omitempty"` @@ -5782,7 +6252,7 @@ type EditMessageMediaParams struct { ``` -### func \(\*EditMessageMediaParams\) [HasFile]() +### func \(\*EditMessageMediaParams\) [HasFile]() ```go func (p *EditMessageMediaParams) HasFile() bool @@ -5791,7 +6261,7 @@ func (p *EditMessageMediaParams) HasFile() bool HasFile reports whether a multipart upload is required. -### func \(\*EditMessageMediaParams\) [MultipartFields]() +### func \(\*EditMessageMediaParams\) [MultipartFields]() ```go func (p *EditMessageMediaParams) MultipartFields() map[string]string @@ -5800,7 +6270,7 @@ func (p *EditMessageMediaParams) MultipartFields() map[string]string MultipartFields returns the non\-file fields used in the multipart body. -### func \(\*EditMessageMediaParams\) [MultipartFiles]() +### func \(\*EditMessageMediaParams\) [MultipartFiles]() ```go func (p *EditMessageMediaParams) MultipartFiles() []client.MultipartFile @@ -5809,17 +6279,17 @@ func (p *EditMessageMediaParams) MultipartFiles() []client.MultipartFile MultipartFiles returns the file parts. -## type [EditMessageReplyMarkupParams]() +## type [EditMessageReplyMarkupParams]() EditMessageReplyMarkupParams is the parameter set for EditMessageReplyMarkup. -Use 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 not sent by the bot and do not contain an inline keyboard can only be edited within 48 hours from the time they were sent. +Use 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 not sent by the bot and do not contain an inline keyboard can only be edited within 48 hours from the time they were sent. ```go type EditMessageReplyMarkupParams struct { // Unique identifier of the business connection on behalf of which the message to be edited was sent BusinessConnectionID string `json:"business_connection_id,omitempty"` - // Required if inline_message_id is not specified. Unique identifier for the target chat or username of the target bot, supergroup or channel in the format @username. + // Required if inline_message_id is not specified. Unique identifier for the target chat or username of the target bot, supergroup, or channel in the format @username. ChatID *ChatID `json:"chat_id,omitempty"` // Required if inline_message_id is not specified. Identifier of the message to edit. MessageID *int64 `json:"message_id,omitempty"` @@ -5831,17 +6301,17 @@ type EditMessageReplyMarkupParams struct { ``` -## type [EditMessageTextParams]() +## type [EditMessageTextParams]() EditMessageTextParams is the parameter set for EditMessageText. -Use 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 sent by the bot and do not contain an inline keyboard can only be edited within 48 hours from the time they were sent. +Use 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 sent by the bot and do not contain an inline keyboard can only be edited within 48 hours from the time they were sent. ```go type EditMessageTextParams struct { // Unique identifier of the business connection on behalf of which the message to be edited was sent BusinessConnectionID string `json:"business_connection_id,omitempty"` - // Required if inline_message_id is not specified. Unique identifier for the target chat or username of the target bot, supergroup or channel in the format @username. + // Required if inline_message_id is not specified. Unique identifier for the target chat or username of the target bot, supergroup, or channel in the format @username. ChatID *ChatID `json:"chat_id,omitempty"` // Required if inline_message_id is not specified. Identifier of the message to edit. MessageID *int64 `json:"message_id,omitempty"` @@ -5855,15 +6325,55 @@ type EditMessageTextParams struct { Entities []MessageEntity `json:"entities,omitempty"` // Link preview generation options for the message LinkPreviewOptions *LinkPreviewOptions `json:"link_preview_options,omitempty"` - // New rich content of the message; required if text isn't specified. Direct upload of new files and explicit upload of files by a URL isn't supported when an inline message is edited. + // New rich content of the message; required if text isn't specified. Direct upload of new files and explicit upload of files by a URL aren't supported when an inline message is edited. RichMessage *InputRichMessage `json:"rich_message,omitempty"` // A JSON-serialized object for an inline keyboard ReplyMarkup *InlineKeyboardMarkup `json:"reply_markup,omitempty"` } ``` + +## type [EditMessageWidgetDataParams]() + +EditMessageWidgetDataParams is the parameter set for EditMessageWidgetData. + +Use 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. + +```go +type EditMessageWidgetDataParams struct { + // Required if inline_message_id is not specified. Unique identifier for the target chat or username of the target supergroup in the format @username. + ChatID *ChatID `json:"chat_id,omitempty"` + // Required if inline_message_id is not specified. Identifier of the message with the widget. + MessageID *int64 `json:"message_id,omitempty"` + // Required if chat_id and message_id are not specified. Identifier of the inline message. + InlineMessageID string `json:"inline_message_id,omitempty"` + // New public data of the widget, 0-1024 bytes; pass an empty string to remove the public data. If omitted, then the public data isn't changed. + PublicData string `json:"public_data,omitempty"` + // New data of the widget, which is specific to the message, 0-1024 bytes; pass an empty string to remove the data. If omitted, then the data isn't changed. + ChatData string `json:"chat_data,omitempty"` +} +``` + + +## type [EditSharedWidgetDataParams]() + +EditSharedWidgetDataParams is the parameter set for EditSharedWidgetData. + +Use 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. + +```go +type EditSharedWidgetDataParams struct { + // Unique identifier of the shared widget + WidgetID string `json:"widget_id"` + // New public data of the widget, 0-1024 bytes; pass an empty string to remove the public data + PublicData string `json:"public_data"` + // The maximum amount of time in seconds that the public data of the widget may be cached client-side; 5-3600. If omitted, then the current value is kept, which is 30 by default. + CacheTime *int64 `json:"cache_time,omitempty"` +} +``` + -## type [EditStoryParams]() +## type [EditStoryParams]() EditStoryParams is the parameter set for EditStory. @@ -5889,7 +6399,7 @@ type EditStoryParams struct { ``` -## type [EditUserStarSubscriptionParams]() +## type [EditUserStarSubscriptionParams]() EditUserStarSubscriptionParams is the parameter set for EditUserStarSubscription. @@ -5906,8 +6416,97 @@ type EditUserStarSubscriptionParams struct { } ``` + +## type [EmojiType]() + +EmojiType is a union type. The following concrete variants implement it: + +- EmojiTypeEmoji +- EmojiTypeCustomEmoji + +This object describes an emoji. Currently, it can be one of + +```go +type EmojiType interface { + // contains filtered or unexported methods +} +``` + + +### func [UnmarshalEmojiType]() + +```go +func UnmarshalEmojiType(data []byte) (EmojiType, error) +``` + +UnmarshalEmojiType decodes a EmojiType from JSON by inspecting the "type" field and dispatching to the correct concrete type. + + +## type [EmojiTypeCustomEmoji]() + +A custom emoji. + +```go +type EmojiTypeCustomEmoji struct { + // Type of the emoji, always “custom_emoji” + Type EmojiTypeKind `json:"type"` + // Identifier of the custom emoji. Use getCustomEmojiStickers to get full information about the sticker. + CustomEmojiID string `json:"custom_emoji_id"` +} +``` + + +### func \(\*EmojiTypeCustomEmoji\) [MarshalJSON]() + +```go +func (v *EmojiTypeCustomEmoji) MarshalJSON() ([]byte, error) +``` + +MarshalJSON encodes EmojiTypeCustomEmoji with the discriminator field "type" forced to "custom\_emoji". The hardcoded value frees callers from setting Type by hand — any user\-supplied value on the struct literal is overridden so a typo can't slip through to Telegram. + + +## type [EmojiTypeEmoji]() + +A regular emoji. + +```go +type EmojiTypeEmoji struct { + // Type of the emoji, always “emoji” + Type EmojiTypeKind `json:"type"` + // The emoji + Emoji string `json:"emoji"` +} +``` + + +### func \(\*EmojiTypeEmoji\) [MarshalJSON]() + +```go +func (v *EmojiTypeEmoji) MarshalJSON() ([]byte, error) +``` + +MarshalJSON encodes EmojiTypeEmoji with the discriminator field "type" forced to "emoji". The hardcoded value frees callers from setting Type by hand — any user\-supplied value on the struct literal is overridden so a typo can't slip through to Telegram. + + +## type [EmojiTypeKind]() + + + +```go +type EmojiTypeKind string +``` + + + +```go +const ( + EmojiTypeKindEmoji EmojiTypeKind = "emoji" + EmojiTypeKindCustomEmoji EmojiTypeKind = "custom_emoji" +) +``` + -## type [EncryptedCredentials]() +## type [EncryptedCredentials]() Describes data required for decrypting and authenticating EncryptedPassportElement. See the Telegram Passport Documentation for a complete description of the data decryption and authentication processes. @@ -5923,7 +6522,7 @@ type EncryptedCredentials struct { ``` -## type [EncryptedPassportElement]() +## type [EncryptedPassportElement]() Describes documents or other Telegram Passport elements shared with the bot by the user. @@ -5953,7 +6552,7 @@ type EncryptedPassportElement struct { ``` -## type [EncryptedPassportElementType]() +## type [EncryptedPassportElementType]() @@ -5982,15 +6581,15 @@ const ( ``` -## type [EphemeralMessageParameters]() - +## type [EphemeralMessageParameters]() +Describes the parameters of an ephemeral message to be sent. ```go type EphemeralMessageParameters struct { - // Identifier of the user who will receive the message. It is not guaranteed that the user will receive the message, especially if they are offline. See here for more details. - ReceiverUserID int64 `json:"receiver_user_id"` - // Optional. Identifier of the callback query which triggered the message, if any + // Optional. Identifier of the user who will receive the message; required unless the message is sent as an ephemeral reply to a callback query. If omitted, then the parameter chat_id of the method is ignored. If specified together with callback_query_id, then it must be the identifier of the user who pressed the button. Must be omitted for messages sent in chats where the bot isn't a member, unless the message is a reply to an ephemeral message. It is not guaranteed that the user will receive the message, especially if they are offline. See here for more details. + ReceiverUserID *int64 `json:"receiver_user_id,omitempty"` + // Optional. Identifier of the callback query which triggered the message, if any. If specified and receiver_user_id is omitted, then the message is sent as an ephemeral reply to the callback query and will be shown only to the user who pressed the button. Ephemeral replies can't be sent to callback queries from messages in channel direct messages chats. The bot must still answer the callback query using answerCallbackQuery. CallbackQueryID string `json:"callback_query_id,omitempty"` // Optional. Pass True if the ephemeral message must be shown in place of the original message. Must be False for callback queries from ephemeral messages, which must be edited using regular editEphemeralMessage… methods. ReplaceCallbackQueryMessage *bool `json:"replace_callback_query_message,omitempty"` @@ -5998,7 +6597,7 @@ type EphemeralMessageParameters struct { ``` -## type [ExportChatInviteLinkParams]() +## type [ExportChatInviteLinkParams]() ExportChatInviteLinkParams is the parameter set for ExportChatInviteLink. @@ -6012,7 +6611,7 @@ type ExportChatInviteLinkParams struct { ``` -## type [ExternalReplyInfo]() +## type [ExternalReplyInfo]() This object contains information about a message that is being replied to, which may come from another chat or forum topic. @@ -6048,6 +6647,8 @@ type ExternalReplyInfo struct { VideoNote *VideoNote `json:"video_note,omitempty"` // Optional. Message is a voice message, information about the file Voice *Voice `json:"voice,omitempty"` + // Optional. Message is an HTML widget, information about the widget + Widget *Widget `json:"widget,omitempty"` // Optional. True, if the message media is covered by a spoiler animation HasMediaSpoiler *bool `json:"has_media_spoiler,omitempty"` // Optional. Message is a checklist @@ -6074,7 +6675,7 @@ type ExternalReplyInfo struct { ``` -### func \(\*ExternalReplyInfo\) [UnmarshalJSON]() +### func \(\*ExternalReplyInfo\) [UnmarshalJSON]() ```go func (m *ExternalReplyInfo) UnmarshalJSON(data []byte) error @@ -6083,7 +6684,7 @@ func (m *ExternalReplyInfo) UnmarshalJSON(data []byte) error UnmarshalJSON decodes ExternalReplyInfo by dispatching union\-typed fields \(Origin\) through their concrete UnmarshalXxx helpers. -## type [File]() +## type [File]() This object represents a file ready to be downloaded. The file can be downloaded via the link https://api.telegram.org/file/bot\/\. It is guaranteed that the link will be valid for at least 1 hour. When the link expires, a new one can be requested by calling getFile. The maximum file size to download is 20 MB @@ -6093,7 +6694,7 @@ type File struct { FileID string `json:"file_id"` // Unique identifier for this file, which is supposed to be the same over time and for different bots. Can't be used to download or reuse the file. FileUniqueID string `json:"file_unique_id"` - // Optional. File size in bytes. It can be bigger than 2^31 and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a signed 64-bit integer or double-precision float type are safe for storing this value. + // Optional. File size in bytes. It can be bigger than 2^31 and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a signed 64-bit integer or double-precision float type is safe for storing this value. FileSize *int64 `json:"file_size,omitempty"` // Optional. File path. Use https://api.telegram.org/file/bot/ to get the file. FilePath string `json:"file_path,omitempty"` @@ -6114,7 +6715,7 @@ The returned io.ReadCloser must be closed by the caller. The size of the file is For files larger than 20 MB, Telegram requires a self\-hosted Bot API server \(default api.telegram.org has a 20 MB limit on getFile\). -### func [GetFile]() +### func [GetFile]() ```go func GetFile(ctx context.Context, b *client.Bot, p *GetFileParams) (*File, error) @@ -6125,7 +6726,7 @@ GetFile calls the getFile Telegram Bot API method. Use 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 via the link https://api.telegram.org/file/bot\/\, where \ is taken from the response. It is guaranteed that the link will be valid for at least 1 hour. When the link expires, a new one can be requested by calling getFile again. Note: This function may not preserve the original file name and MIME type. You should save the file's MIME type and name \(if available\) when the File object is received. -### func [UploadStickerFile]() +### func [UploadStickerFile]() ```go func UploadStickerFile(ctx context.Context, b *client.Bot, p *UploadStickerFileParams) (*File, error) @@ -6136,9 +6737,9 @@ UploadStickerFile calls the uploadStickerFile Telegram Bot API method. Use 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. -## type [ForceReply]() +## type [ForceReply]() -Upon 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 create user\-friendly step\-by\-step interfaces without having to sacrifice privacy mode. Not supported in channels and for messages sent on behalf of a user account. Example: A poll bot for groups runs in privacy mode \(only receives commands, replies to its messages and mentions\). There could be two ways to create a new poll: The last option is definitely more attractive. And if you use ForceReply in your bot's questions, it will receive the user's answers even if it only receives replies, commands and mentions \- without any extra work for the user. +Upon 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 create user\-friendly step\-by\-step interfaces without having to sacrifice privacy mode. Not supported in channels and for messages sent on behalf of a business account. Example: A poll bot for groups runs in privacy mode \(only receives commands, replies to its messages and mentions\). There could be two ways to create a new poll: The last option is definitely more attractive. And if you use ForceReply in your bot's questions, it will receive the user's answers even if it only receives replies, commands and mentions \- without any extra work for the user. ```go type ForceReply struct { @@ -6152,7 +6753,7 @@ type ForceReply struct { ``` -## type [ForumTopic]() +## type [ForumTopic]() This object represents a forum topic. @@ -6172,7 +6773,7 @@ type ForumTopic struct { ``` -### func [CreateForumTopic]() +### func [CreateForumTopic]() ```go func CreateForumTopic(ctx context.Context, b *client.Bot, p *CreateForumTopicParams) (*ForumTopic, error) @@ -6180,10 +6781,10 @@ func CreateForumTopic(ctx context.Context, b *client.Bot, p *CreateForumTopicPar CreateForumTopic calls the createForumTopic Telegram Bot API method. -Use 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\_topics administrator right. Returns information about the created topic as a ForumTopic object. +Use 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\_topics administrator right. In the case of a private chat, a link to the topic can be created in the format https://t.me/\/\; the link opens the topic only for the user. Returns information about the created topic as a ForumTopic object. -## type [ForumTopicClosed]() +## type [ForumTopicClosed]() This object represents a service message about a forum topic closed in the chat. Currently holds no information. @@ -6193,7 +6794,7 @@ type ForumTopicClosed struct { ``` -## type [ForumTopicCreated]() +## type [ForumTopicCreated]() This object represents a service message about a new forum topic created in the chat. @@ -6211,7 +6812,7 @@ type ForumTopicCreated struct { ``` -## type [ForumTopicEdited]() +## type [ForumTopicEdited]() This object represents a service message about an edited forum topic. @@ -6225,7 +6826,7 @@ type ForumTopicEdited struct { ``` -## type [ForumTopicReopened]() +## type [ForumTopicReopened]() This object represents a service message about a forum topic reopened in the chat. Currently holds no information. @@ -6243,13 +6844,13 @@ Use this method to forward messages of any kind. Service messages and messages w ```go type ForwardMessageParams struct { - // Unique identifier for the target chat or username of the target bot, supergroup or channel in the format @username + // Unique identifier for the target chat or username of the target bot, supergroup, or channel in the format @username ChatID ChatID `json:"chat_id"` // Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only MessageThreadID *int64 `json:"message_thread_id,omitempty"` // Identifier of the direct messages topic to which the message will be forwarded; required if the message is forwarded to a direct messages chat DirectMessagesTopicID *int64 `json:"direct_messages_topic_id,omitempty"` - // Unique identifier for the chat where the original message was sent (or username of the target bot, supergroup or channel in the format @username) + // Unique identifier for the chat where the original message was sent (or username of the target bot, supergroup, or channel in the format @username) FromChatID ChatID `json:"from_chat_id"` // New start timestamp for the forwarded video in the message VideoStartTimestamp *int64 `json:"video_start_timestamp,omitempty"` @@ -6275,13 +6876,13 @@ Use this method to forward multiple messages of any kind. If some of the specifi ```go type ForwardMessagesParams struct { - // Unique identifier for the target chat or username of the target bot, supergroup or channel in the format @username + // Unique identifier for the target chat or username of the target bot, supergroup, or channel in the format @username ChatID ChatID `json:"chat_id"` // Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only MessageThreadID *int64 `json:"message_thread_id,omitempty"` // Identifier of the direct messages topic to which the messages will be forwarded; required if the messages are forwarded to a direct messages chat DirectMessagesTopicID *int64 `json:"direct_messages_topic_id,omitempty"` - // Unique identifier for the chat where the original messages were sent (or username of the target bot, supergroup or channel in the format @username) + // Unique identifier for the chat where the original messages were sent (or username of the target bot, supergroup, or channel in the format @username) FromChatID ChatID `json:"from_chat_id"` // A JSON-serialized list of 1-100 identifiers of messages in the chat from_chat_id to forward. The identifiers must be specified in a strictly increasing order. MessageIds []int64 `json:"message_ids"` @@ -6293,9 +6894,9 @@ type ForwardMessagesParams struct { ``` -## type [Game]() +## type [Game]() -This object represents a game. Use BotFather to create and edit games, their short names will act as unique identifiers. +This object represents a game. Use BotFather to create and edit games; their short names will act as unique identifiers. ```go type Game struct { @@ -6315,7 +6916,7 @@ type Game struct { ``` -## type [GameHighScore]() +## type [GameHighScore]() This object represents one row of the high scores table for a game. And that's about all we've got for now.If you've got any questions, please check out our Bot FAQ » @@ -6331,7 +6932,7 @@ type GameHighScore struct { ``` -### func [GetGameHighScores]() +### func [GetGameHighScores]() ```go func GetGameHighScores(ctx context.Context, b *client.Bot, p *GetGameHighScoresParams) ([]GameHighScore, error) @@ -6342,9 +6943,9 @@ GetGameHighScores calls the getGameHighScores Telegram Bot API method. Use 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. This method will currently return scores for the target user, plus two of their closest neighbors on each side. Will also return the top three users if the user and their neighbors are not among them. Please note that this behavior is subject to change. -## type [GeneralForumTopicHidden]() +## type [GeneralForumTopicHidden]() -This object represents a service message about General forum topic hidden in the chat. Currently holds no information. +This object represents a service message about the General forum topic hidden in the chat. Currently holds no information. ```go type GeneralForumTopicHidden struct { @@ -6352,9 +6953,9 @@ type GeneralForumTopicHidden struct { ``` -## type [GeneralForumTopicUnhidden]() +## type [GeneralForumTopicUnhidden]() -This object represents a service message about General forum topic unhidden in the chat. Currently holds no information. +This object represents a service message about the General forum topic unhidden in the chat. Currently holds no information. ```go type GeneralForumTopicUnhidden struct { @@ -6362,7 +6963,7 @@ type GeneralForumTopicUnhidden struct { ``` -## type [GetAvailableGiftsParams]() +## type [GetAvailableGiftsParams]() GetAvailableGiftsParams is the parameter set for GetAvailableGifts. @@ -6374,7 +6975,7 @@ type GetAvailableGiftsParams struct { ``` -## type [GetBusinessAccountGiftsParams]() +## type [GetBusinessAccountGiftsParams]() GetBusinessAccountGiftsParams is the parameter set for GetBusinessAccountGifts. @@ -6400,7 +7001,7 @@ type GetBusinessAccountGiftsParams struct { ExcludeFromBlockchain *bool `json:"exclude_from_blockchain,omitempty"` // Pass True to sort results by gift price instead of send date. Sorting is applied before pagination. SortByPrice *bool `json:"sort_by_price,omitempty"` - // Offset of the first entry to return as received from the previous request; use empty string to get the first chunk of results + // Offset of the first entry to return as received from the previous request; use an empty string to get the first chunk of results Offset string `json:"offset,omitempty"` // The maximum number of gifts to be returned; 1-100. Defaults to 100. Limit *int64 `json:"limit,omitempty"` @@ -6408,7 +7009,7 @@ type GetBusinessAccountGiftsParams struct { ``` -## type [GetBusinessAccountStarBalanceParams]() +## type [GetBusinessAccountStarBalanceParams]() GetBusinessAccountStarBalanceParams is the parameter set for GetBusinessAccountStarBalance. @@ -6422,7 +7023,7 @@ type GetBusinessAccountStarBalanceParams struct { ``` -## type [GetBusinessConnectionParams]() +## type [GetBusinessConnectionParams]() GetBusinessConnectionParams is the parameter set for GetBusinessConnection. @@ -6436,7 +7037,7 @@ type GetBusinessConnectionParams struct { ``` -## type [GetChatAdministratorsParams]() +## type [GetChatAdministratorsParams]() GetChatAdministratorsParams is the parameter set for GetChatAdministrators. @@ -6452,7 +7053,7 @@ type GetChatAdministratorsParams struct { ``` -## type [GetChatGiftsParams]() +## type [GetChatGiftsParams]() GetChatGiftsParams is the parameter set for GetChatGifts. @@ -6486,7 +7087,7 @@ type GetChatGiftsParams struct { ``` -## type [GetChatMemberCountParams]() +## type [GetChatMemberCountParams]() GetChatMemberCountParams is the parameter set for GetChatMemberCount. @@ -6500,7 +7101,7 @@ type GetChatMemberCountParams struct { ``` -## type [GetChatMemberParams]() +## type [GetChatMemberParams]() GetChatMemberParams is the parameter set for GetChatMember. @@ -6516,7 +7117,7 @@ type GetChatMemberParams struct { ``` -## type [GetChatMenuButtonParams]() +## type [GetChatMenuButtonParams]() GetChatMenuButtonParams is the parameter set for GetChatMenuButton. @@ -6530,7 +7131,7 @@ type GetChatMenuButtonParams struct { ``` -## type [GetChatParams]() +## type [GetChatParams]() GetChatParams is the parameter set for GetChat. @@ -6543,8 +7144,20 @@ type GetChatParams struct { } ``` + +## type [GetChatShareThemeBackdropsParams]() + +GetChatShareThemeBackdropsParams is the parameter set for GetChatShareThemeBackdrops. + +Use 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. + +```go +type GetChatShareThemeBackdropsParams struct { +} +``` + -## type [GetCustomEmojiStickersParams]() +## type [GetCustomEmojiStickersParams]() GetCustomEmojiStickersParams is the parameter set for GetCustomEmojiStickers. @@ -6558,7 +7171,7 @@ type GetCustomEmojiStickersParams struct { ``` -## type [GetFileParams]() +## type [GetFileParams]() GetFileParams is the parameter set for GetFile. @@ -6572,7 +7185,7 @@ type GetFileParams struct { ``` -## type [GetForumTopicIconStickersParams]() +## type [GetForumTopicIconStickersParams]() GetForumTopicIconStickersParams is the parameter set for GetForumTopicIconStickers. @@ -6584,7 +7197,7 @@ type GetForumTopicIconStickersParams struct { ``` -## type [GetGameHighScoresParams]() +## type [GetGameHighScoresParams]() GetGameHighScoresParams is the parameter set for GetGameHighScores. @@ -6604,7 +7217,7 @@ type GetGameHighScoresParams struct { ``` -## type [GetManagedBotAccessSettingsParams]() +## type [GetManagedBotAccessSettingsParams]() GetManagedBotAccessSettingsParams is the parameter set for GetManagedBotAccessSettings. @@ -6618,7 +7231,7 @@ type GetManagedBotAccessSettingsParams struct { ``` -## type [GetManagedBotTokenParams]() +## type [GetManagedBotTokenParams]() GetManagedBotTokenParams is the parameter set for GetManagedBotToken. @@ -6636,7 +7249,7 @@ type GetManagedBotTokenParams struct { GetMeParams is the parameter set for GetMe. -A simple method for testing your bot's authentication token. Requires no parameters. Returns basic information about the bot in form of a User object. +A simple method for testing your bot's authentication token. Requires no parameters. Returns information about the bot in the form of a BotFullInfo object. ```go type GetMeParams struct { @@ -6644,7 +7257,7 @@ type GetMeParams struct { ``` -## type [GetMyCommandsParams]() +## type [GetMyCommandsParams]() GetMyCommandsParams is the parameter set for GetMyCommands. @@ -6660,7 +7273,7 @@ type GetMyCommandsParams struct { ``` -## type [GetMyDefaultAdministratorRightsParams]() +## type [GetMyDefaultAdministratorRightsParams]() GetMyDefaultAdministratorRightsParams is the parameter set for GetMyDefaultAdministratorRights. @@ -6668,13 +7281,13 @@ Use this method to get the current default administrator rights of the bot. Retu ```go type GetMyDefaultAdministratorRightsParams struct { - // Pass True to get default administrator rights of the bot in channels. Otherwise, default administrator rights of the bot for groups and supergroups will be returned. + // Pass True to get the default administrator rights of the bot in channels. Otherwise, the default administrator rights of the bot for groups and supergroups will be returned. ForChannels *bool `json:"for_channels,omitempty"` } ``` -## type [GetMyDescriptionParams]() +## type [GetMyDescriptionParams]() GetMyDescriptionParams is the parameter set for GetMyDescription. @@ -6688,7 +7301,7 @@ type GetMyDescriptionParams struct { ``` -## type [GetMyNameParams]() +## type [GetMyNameParams]() GetMyNameParams is the parameter set for GetMyName. @@ -6702,7 +7315,7 @@ type GetMyNameParams struct { ``` -## type [GetMyShortDescriptionParams]() +## type [GetMyShortDescriptionParams]() GetMyShortDescriptionParams is the parameter set for GetMyShortDescription. @@ -6716,7 +7329,7 @@ type GetMyShortDescriptionParams struct { ``` -## type [GetMyStarBalanceParams]() +## type [GetMyStarBalanceParams]() GetMyStarBalanceParams is the parameter set for GetMyStarBalance. @@ -6728,7 +7341,7 @@ type GetMyStarBalanceParams struct { ``` -## type [GetStarTransactionsParams]() +## type [GetStarTransactionsParams]() GetStarTransactionsParams is the parameter set for GetStarTransactions. @@ -6744,7 +7357,7 @@ type GetStarTransactionsParams struct { ``` -## type [GetStickerSetParams]() +## type [GetStickerSetParams]() GetStickerSetParams is the parameter set for GetStickerSet. @@ -6757,6 +7370,20 @@ type GetStickerSetParams struct { } ``` + +## type [GetUniqueGiftParams]() + +GetUniqueGiftParams is the parameter set for GetUniqueGift. + +Use this method to get information about a unique gift by its name. Returns a UniqueGift object on success. + +```go +type GetUniqueGiftParams struct { + // Unique name of the gift + Name string `json:"name"` +} +``` + ## type [GetUpdatesParams]() @@ -6770,7 +7397,7 @@ type GetUpdatesParams struct { Offset *int64 `json:"offset,omitempty"` // Limits the number of updates to be retrieved. Values between 1-100 are accepted. Defaults to 100. Limit *int64 `json:"limit,omitempty"` - // Timeout in seconds for long polling. Defaults to 0, i.e. usual short polling. Should be positive, short polling should be used for testing purposes only. + // Timeout in seconds for long polling. Defaults to 0, i.e. usual short polling. Should be positive; short polling should be used for testing purposes only. Timeout *int64 `json:"timeout,omitempty"` // A JSON-serialized list of the update types you want your bot to receive. For example, specify ["message", "edited_channel_post", "callback_query"] to only receive updates of these types. See Update for a complete list of available update types. Specify an empty list to receive all update types except chat_member, message_reaction, and message_reaction_count (default). If not specified, the previous setting will be used.Please note that this parameter doesn't affect updates created before the call to getUpdates, so unwanted updates may be received for a short period of time. AllowedUpdates []UpdateType `json:"allowed_updates,omitempty"` @@ -6778,7 +7405,7 @@ type GetUpdatesParams struct { ``` -## type [GetUserChatBoostsParams]() +## type [GetUserChatBoostsParams]() GetUserChatBoostsParams is the parameter set for GetUserChatBoosts. @@ -6794,7 +7421,7 @@ type GetUserChatBoostsParams struct { ``` -## type [GetUserGiftsParams]() +## type [GetUserGiftsParams]() GetUserGiftsParams is the parameter set for GetUserGifts. @@ -6824,7 +7451,7 @@ type GetUserGiftsParams struct { ``` -## type [GetUserPersonalChatMessagesParams]() +## type [GetUserPersonalChatMessagesParams]() GetUserPersonalChatMessagesParams is the parameter set for GetUserPersonalChatMessages. @@ -6840,7 +7467,7 @@ type GetUserPersonalChatMessagesParams struct { ``` -## type [GetUserProfileAudiosParams]() +## type [GetUserProfileAudiosParams]() GetUserProfileAudiosParams is the parameter set for GetUserProfileAudios. @@ -6858,7 +7485,7 @@ type GetUserProfileAudiosParams struct { ``` -## type [GetUserProfilePhotosParams]() +## type [GetUserProfilePhotosParams]() GetUserProfilePhotosParams is the parameter set for GetUserProfilePhotos. @@ -6880,7 +7507,7 @@ type GetUserProfilePhotosParams struct { GetWebhookInfoParams is the parameter set for GetWebhookInfo. -Use 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. +Use this method to get the current webhook status. Requires no parameters. On success, returns a WebhookInfo object. If the bot is using getUpdates, it will return an object with the url field empty. ```go type GetWebhookInfoParams struct { @@ -6888,7 +7515,7 @@ type GetWebhookInfoParams struct { ``` -## type [Gift]() +## type [Gift]() This object represents a gift that can be sent by the bot. @@ -6924,7 +7551,7 @@ type Gift struct { ``` -## type [GiftBackground]() +## type [GiftBackground]() This object describes the background of a gift. @@ -6940,7 +7567,7 @@ type GiftBackground struct { ``` -## type [GiftInfo]() +## type [GiftInfo]() Describes a service message about a regular gift that was sent or received. @@ -6970,7 +7597,7 @@ type GiftInfo struct { ``` -## type [GiftPremiumSubscriptionParams]() +## type [GiftPremiumSubscriptionParams]() GiftPremiumSubscriptionParams is the parameter set for GiftPremiumSubscription. @@ -6994,9 +7621,9 @@ type GiftPremiumSubscriptionParams struct { ``` -## type [Gifts]() +## type [Gifts]() -This object represent a list of gifts. +This object represents a list of gifts. ```go type Gifts struct { @@ -7006,7 +7633,7 @@ type Gifts struct { ``` -### func [GetAvailableGifts]() +### func [GetAvailableGifts]() ```go func GetAvailableGifts(ctx context.Context, b *client.Bot, p *GetAvailableGiftsParams) (*Gifts, error) @@ -7017,7 +7644,7 @@ GetAvailableGifts calls the getAvailableGifts Telegram Bot API method. Returns the list of gifts that can be sent by the bot to users and channel chats. Requires no parameters. Returns a Gifts object. -## type [Giveaway]() +## type [Giveaway]() This object represents a message about a scheduled giveaway. @@ -7027,13 +7654,13 @@ type Giveaway struct { Chats []Chat `json:"chats"` // Point in time (Unix timestamp) when winners of the giveaway will be selected WinnersSelectionDate int64 `json:"winners_selection_date"` - // The number of users which are supposed to be selected as winners of the giveaway + // The number of users who are supposed to be selected as winners of the giveaway WinnerCount int64 `json:"winner_count"` // Optional. True, if only users who join the chats after the giveaway started should be eligible to win OnlyNewMembers *bool `json:"only_new_members,omitempty"` // Optional. True, if the list of giveaway winners will be visible to everyone HasPublicWinners *bool `json:"has_public_winners,omitempty"` - // Optional. Description of additional giveaway prize + // Optional. Description of an additional giveaway prize PrizeDescription string `json:"prize_description,omitempty"` // Optional. A list of two-letter ISO 3166-1 alpha-2 country codes indicating the countries from which eligible users for the giveaway must come. If empty, then all users can participate in the giveaway. Users with a phone number that was bought on Fragment can always participate in giveaways. CountryCodes []string `json:"country_codes,omitempty"` @@ -7045,7 +7672,7 @@ type Giveaway struct { ``` -## type [GiveawayCompleted]() +## type [GiveawayCompleted]() This object represents a service message about the completion of a giveaway without public winners. @@ -7063,7 +7690,7 @@ type GiveawayCompleted struct { ``` -## type [GiveawayCreated]() +## type [GiveawayCreated]() This object represents a service message about the creation of a scheduled giveaway. @@ -7075,7 +7702,7 @@ type GiveawayCreated struct { ``` -## type [GiveawayWinners]() +## type [GiveawayWinners]() This object represents a message about the completion of a giveaway with public winners. @@ -7103,17 +7730,17 @@ type GiveawayWinners struct { OnlyNewMembers *bool `json:"only_new_members,omitempty"` // Optional. True, if the giveaway was canceled because the payment for it was refunded WasRefunded *bool `json:"was_refunded,omitempty"` - // Optional. Description of additional giveaway prize + // Optional. Description of an additional giveaway prize PrizeDescription string `json:"prize_description,omitempty"` } ``` -## type [HideGeneralForumTopicParams]() +## type [HideGeneralForumTopicParams]() HideGeneralForumTopicParams is the parameter set for HideGeneralForumTopic. -Use 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 automatically closed if it was open. Returns True on success. +Use 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 right. The topic will be automatically closed if it was open. Returns True on success. ```go type HideGeneralForumTopicParams struct { @@ -7123,7 +7750,7 @@ type HideGeneralForumTopicParams struct { ``` -## type [InaccessibleMessage]() +## type [InaccessibleMessage]() This object describes a message that was deleted or is otherwise inaccessible to the bot. @@ -7139,7 +7766,7 @@ type InaccessibleMessage struct { ``` -## type [InlineKeyboardButton]() +## type [InlineKeyboardButton]() This 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. @@ -7155,7 +7782,7 @@ type InlineKeyboardButton struct { URL string `json:"url,omitempty"` // Optional. Data to be sent in a callback query to the bot when the button is pressed, 1-64 bytes CallbackData string `json:"callback_data,omitempty"` - // Optional. Description of the Web App that will be launched when the user presses the button. The Web App will be able to send an arbitrary message on behalf of the user using the method answerWebAppQuery. Available only in private chats between a user and the bot. Not supported for messages sent on behalf of a business account. + // Optional. Description of the Web App that will be launched when the user presses the button. The Web App will be able to send an arbitrary message on behalf of the user using the method answerWebAppQuery. Available only in private chats between a user and the bot. Not supported for messages sent on behalf of a business account and ephemeral messages. WebApp *WebAppInfo `json:"web_app,omitempty"` // Optional. An HTTPS URL used to automatically authorize the user. Can be used as a replacement for the Telegram Login Widget. Not supported for ephemeral messages. LoginURL *LoginUrl `json:"login_url,omitempty"` @@ -7169,7 +7796,7 @@ type InlineKeyboardButton struct { CopyText *CopyTextButton `json:"copy_text,omitempty"` // Optional. Description of the game that will be launched when the user presses the button.NOTE: This type of button must always be the first button in the first row. CallbackGame *CallbackGame `json:"callback_game,omitempty"` - // Optional. Specify True, to send a Pay button. Substrings “” and “XTR” in the buttons's text will be replaced with a Telegram Star icon.NOTE: This type of button must always be the first button in the first row and can only be used in invoice messages. + // Optional. Specify True to send a Pay button. Substrings “” and “XTR” in the button's text will be replaced with a Telegram Star icon.NOTE: This type of button must always be the first button in the first row and can only be used in invoice messages. Pay *bool `json:"pay,omitempty"` // Optional. If set, then the button is disabled and does nothing Disabled *DisabledButton `json:"disabled,omitempty"` @@ -7177,7 +7804,7 @@ type InlineKeyboardButton struct { ``` -## type [InlineKeyboardMarkup]() +## type [InlineKeyboardMarkup]() This object represents an inline keyboard that appears right next to the message it belongs to. @@ -7191,7 +7818,7 @@ type InlineKeyboardMarkup struct { ``` -## type [InlineQuery]() +## type [InlineQuery]() This object represents an incoming inline query. When the user sends an empty query, your bot could return some default or trending results. @@ -7205,15 +7832,15 @@ type InlineQuery struct { Query string `json:"query"` // Offset of the results to be returned, can be controlled by the bot Offset string `json:"offset"` - // Optional. Type of the chat from which the inline query was sent. Can be either “sender” for a private chat with the inline query sender, “private”, “group”, “supergroup”, or “channel”. The chat type should be always known for requests sent from official clients and most third-party clients, unless the request was sent from a secret chat. + // Optional. Type of the chat from which the inline query was sent. Can be either “sender” for a private chat with the inline query sender, “private”, “group”, “supergroup”, or “channel”. The chat type should always be known for requests sent from official clients and most third-party clients, unless the request was sent from a secret chat. ChatType InlineQueryChatType `json:"chat_type,omitempty"` - // Optional. Sender location, only for bots that request user location + // Optional. Sender location, only for bots that enabled user location requests via @BotFather or using the parameter needs_inline_query_location of the method setMySettings Location *Location `json:"location,omitempty"` } ``` -## type [InlineQueryChatType]() +## type [InlineQueryChatType]() @@ -7234,7 +7861,7 @@ const ( ``` -## type [InlineQueryResult]() +## type [InlineQueryResult]() InlineQueryResult is a union type. The following concrete variants implement it: @@ -7268,7 +7895,7 @@ type InlineQueryResult interface { ``` -## type [InlineQueryResultArticle]() +## type [InlineQueryResultArticle]() Represents a link to an article or web page. @@ -7298,7 +7925,7 @@ type InlineQueryResultArticle struct { ``` -### func \(\*InlineQueryResultArticle\) [MarshalJSON]() +### func \(\*InlineQueryResultArticle\) [MarshalJSON]() ```go func (v *InlineQueryResultArticle) MarshalJSON() ([]byte, error) @@ -7307,7 +7934,7 @@ func (v *InlineQueryResultArticle) MarshalJSON() ([]byte, error) MarshalJSON encodes InlineQueryResultArticle with the discriminator field "type" forced to "article". The hardcoded value frees callers from setting Type by hand — any user\-supplied value on the struct literal is overridden so a typo can't slip through to Telegram. -## type [InlineQueryResultAudio]() +## type [InlineQueryResultAudio]() Represents 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. @@ -7339,7 +7966,7 @@ type InlineQueryResultAudio struct { ``` -### func \(\*InlineQueryResultAudio\) [MarshalJSON]() +### func \(\*InlineQueryResultAudio\) [MarshalJSON]() ```go func (v *InlineQueryResultAudio) MarshalJSON() ([]byte, error) @@ -7348,7 +7975,7 @@ func (v *InlineQueryResultAudio) MarshalJSON() ([]byte, error) MarshalJSON encodes InlineQueryResultAudio with the discriminator field "type" forced to "audio". The hardcoded value frees callers from setting Type by hand — any user\-supplied value on the struct literal is overridden so a typo can't slip through to Telegram. -## type [InlineQueryResultCachedAudio]() +## type [InlineQueryResultCachedAudio]() Represents 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 instead of the audio. @@ -7374,7 +8001,7 @@ type InlineQueryResultCachedAudio struct { ``` -### func \(\*InlineQueryResultCachedAudio\) [MarshalJSON]() +### func \(\*InlineQueryResultCachedAudio\) [MarshalJSON]() ```go func (v *InlineQueryResultCachedAudio) MarshalJSON() ([]byte, error) @@ -7383,7 +8010,7 @@ func (v *InlineQueryResultCachedAudio) MarshalJSON() ([]byte, error) MarshalJSON encodes InlineQueryResultCachedAudio with the discriminator field "type" forced to "audio". The hardcoded value frees callers from setting Type by hand — any user\-supplied value on the struct literal is overridden so a typo can't slip through to Telegram. -## type [InlineQueryResultCachedDocument]() +## type [InlineQueryResultCachedDocument]() Represents 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 content instead of the file. @@ -7413,7 +8040,7 @@ type InlineQueryResultCachedDocument struct { ``` -### func \(\*InlineQueryResultCachedDocument\) [MarshalJSON]() +### func \(\*InlineQueryResultCachedDocument\) [MarshalJSON]() ```go func (v *InlineQueryResultCachedDocument) MarshalJSON() ([]byte, error) @@ -7422,9 +8049,9 @@ func (v *InlineQueryResultCachedDocument) MarshalJSON() ([]byte, error) MarshalJSON encodes InlineQueryResultCachedDocument with the discriminator field "type" forced to "document". The hardcoded value frees callers from setting Type by hand — any user\-supplied value on the struct literal is overridden so a typo can't slip through to Telegram. -## type [InlineQueryResultCachedGif]() +## type [InlineQueryResultCachedGif]() -Represents 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 message with specified content instead of the animation. +Represents 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 message with the specified content instead of the animation. ```go type InlineQueryResultCachedGif struct { @@ -7452,7 +8079,7 @@ type InlineQueryResultCachedGif struct { ``` -### func \(\*InlineQueryResultCachedGif\) [MarshalJSON]() +### func \(\*InlineQueryResultCachedGif\) [MarshalJSON]() ```go func (v *InlineQueryResultCachedGif) MarshalJSON() ([]byte, error) @@ -7461,7 +8088,7 @@ func (v *InlineQueryResultCachedGif) MarshalJSON() ([]byte, error) MarshalJSON encodes InlineQueryResultCachedGif with the discriminator field "type" forced to "gif". The hardcoded value frees callers from setting Type by hand — any user\-supplied value on the struct literal is overridden so a typo can't slip through to Telegram. -## type [InlineQueryResultCachedMpeg4Gif]() +## type [InlineQueryResultCachedMpeg4Gif]() Represents 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 can use input\_message\_content to send a message with the specified content instead of the animation. @@ -7491,7 +8118,7 @@ type InlineQueryResultCachedMpeg4Gif struct { ``` -### func \(\*InlineQueryResultCachedMpeg4Gif\) [MarshalJSON]() +### func \(\*InlineQueryResultCachedMpeg4Gif\) [MarshalJSON]() ```go func (v *InlineQueryResultCachedMpeg4Gif) MarshalJSON() ([]byte, error) @@ -7500,7 +8127,7 @@ func (v *InlineQueryResultCachedMpeg4Gif) MarshalJSON() ([]byte, error) MarshalJSON encodes InlineQueryResultCachedMpeg4Gif with the discriminator field "type" forced to "mpeg4\_gif". The hardcoded value frees callers from setting Type by hand — any user\-supplied value on the struct literal is overridden so a typo can't slip through to Telegram. -## type [InlineQueryResultCachedPhoto]() +## type [InlineQueryResultCachedPhoto]() Represents 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 specified content instead of the photo. @@ -7532,7 +8159,7 @@ type InlineQueryResultCachedPhoto struct { ``` -### func \(\*InlineQueryResultCachedPhoto\) [MarshalJSON]() +### func \(\*InlineQueryResultCachedPhoto\) [MarshalJSON]() ```go func (v *InlineQueryResultCachedPhoto) MarshalJSON() ([]byte, error) @@ -7541,7 +8168,7 @@ func (v *InlineQueryResultCachedPhoto) MarshalJSON() ([]byte, error) MarshalJSON encodes InlineQueryResultCachedPhoto with the discriminator field "type" forced to "photo". The hardcoded value frees callers from setting Type by hand — any user\-supplied value on the struct literal is overridden so a typo can't slip through to Telegram. -## type [InlineQueryResultCachedSticker]() +## type [InlineQueryResultCachedSticker]() Represents 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 the sticker. @@ -7561,7 +8188,7 @@ type InlineQueryResultCachedSticker struct { ``` -### func \(\*InlineQueryResultCachedSticker\) [MarshalJSON]() +### func \(\*InlineQueryResultCachedSticker\) [MarshalJSON]() ```go func (v *InlineQueryResultCachedSticker) MarshalJSON() ([]byte, error) @@ -7570,7 +8197,7 @@ func (v *InlineQueryResultCachedSticker) MarshalJSON() ([]byte, error) MarshalJSON encodes InlineQueryResultCachedSticker with the discriminator field "type" forced to "sticker". The hardcoded value frees callers from setting Type by hand — any user\-supplied value on the struct literal is overridden so a typo can't slip through to Telegram. -## type [InlineQueryResultCachedVideo]() +## type [InlineQueryResultCachedVideo]() Represents 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 the specified content instead of the video. @@ -7602,7 +8229,7 @@ type InlineQueryResultCachedVideo struct { ``` -### func \(\*InlineQueryResultCachedVideo\) [MarshalJSON]() +### func \(\*InlineQueryResultCachedVideo\) [MarshalJSON]() ```go func (v *InlineQueryResultCachedVideo) MarshalJSON() ([]byte, error) @@ -7611,7 +8238,7 @@ func (v *InlineQueryResultCachedVideo) MarshalJSON() ([]byte, error) MarshalJSON encodes InlineQueryResultCachedVideo with the discriminator field "type" forced to "video". The hardcoded value frees callers from setting Type by hand — any user\-supplied value on the struct literal is overridden so a typo can't slip through to Telegram. -## type [InlineQueryResultCachedVoice]() +## type [InlineQueryResultCachedVoice]() Represents 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 instead of the voice message. @@ -7639,7 +8266,7 @@ type InlineQueryResultCachedVoice struct { ``` -### func \(\*InlineQueryResultCachedVoice\) [MarshalJSON]() +### func \(\*InlineQueryResultCachedVoice\) [MarshalJSON]() ```go func (v *InlineQueryResultCachedVoice) MarshalJSON() ([]byte, error) @@ -7648,7 +8275,7 @@ func (v *InlineQueryResultCachedVoice) MarshalJSON() ([]byte, error) MarshalJSON encodes InlineQueryResultCachedVoice with the discriminator field "type" forced to "voice". The hardcoded value frees callers from setting Type by hand — any user\-supplied value on the struct literal is overridden so a typo can't slip through to Telegram. -## type [InlineQueryResultContact]() +## type [InlineQueryResultContact]() Represents 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. @@ -7680,7 +8307,7 @@ type InlineQueryResultContact struct { ``` -### func \(\*InlineQueryResultContact\) [MarshalJSON]() +### func \(\*InlineQueryResultContact\) [MarshalJSON]() ```go func (v *InlineQueryResultContact) MarshalJSON() ([]byte, error) @@ -7689,7 +8316,7 @@ func (v *InlineQueryResultContact) MarshalJSON() ([]byte, error) MarshalJSON encodes InlineQueryResultContact with the discriminator field "type" forced to "contact". The hardcoded value frees callers from setting Type by hand — any user\-supplied value on the struct literal is overridden so a typo can't slip through to Telegram. -## type [InlineQueryResultDocument]() +## type [InlineQueryResultDocument]() Represents 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. Currently, only .PDF and .ZIP files can be sent using this method. @@ -7727,7 +8354,7 @@ type InlineQueryResultDocument struct { ``` -### func \(\*InlineQueryResultDocument\) [MarshalJSON]() +### func \(\*InlineQueryResultDocument\) [MarshalJSON]() ```go func (v *InlineQueryResultDocument) MarshalJSON() ([]byte, error) @@ -7736,7 +8363,7 @@ func (v *InlineQueryResultDocument) MarshalJSON() ([]byte, error) MarshalJSON encodes InlineQueryResultDocument with the discriminator field "type" forced to "document". The hardcoded value frees callers from setting Type by hand — any user\-supplied value on the struct literal is overridden so a typo can't slip through to Telegram. -## type [InlineQueryResultDocumentMimeType]() +## type [InlineQueryResultDocumentMimeType]() @@ -7754,7 +8381,7 @@ const ( ``` -## type [InlineQueryResultGame]() +## type [InlineQueryResultGame]() Represents a Game. @@ -7772,7 +8399,7 @@ type InlineQueryResultGame struct { ``` -### func \(\*InlineQueryResultGame\) [MarshalJSON]() +### func \(\*InlineQueryResultGame\) [MarshalJSON]() ```go func (v *InlineQueryResultGame) MarshalJSON() ([]byte, error) @@ -7781,9 +8408,9 @@ func (v *InlineQueryResultGame) MarshalJSON() ([]byte, error) MarshalJSON encodes InlineQueryResultGame with the discriminator field "type" forced to "game". The hardcoded value frees callers from setting Type by hand — any user\-supplied value on the struct literal is overridden so a typo can't slip through to Telegram. -## type [InlineQueryResultGif]() +## type [InlineQueryResultGif]() -Represents 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 instead of the animation. +Represents a link to an animated GIF file. 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 message with the specified content instead of the animation. ```go type InlineQueryResultGif struct { @@ -7821,7 +8448,7 @@ type InlineQueryResultGif struct { ``` -### func \(\*InlineQueryResultGif\) [MarshalJSON]() +### func \(\*InlineQueryResultGif\) [MarshalJSON]() ```go func (v *InlineQueryResultGif) MarshalJSON() ([]byte, error) @@ -7830,7 +8457,7 @@ func (v *InlineQueryResultGif) MarshalJSON() ([]byte, error) MarshalJSON encodes InlineQueryResultGif with the discriminator field "type" forced to "gif". The hardcoded value frees callers from setting Type by hand — any user\-supplied value on the struct literal is overridden so a typo can't slip through to Telegram. -## type [InlineQueryResultGifThumbnailMimeType]() +## type [InlineQueryResultGifThumbnailMimeType]() @@ -7849,7 +8476,7 @@ const ( ``` -## type [InlineQueryResultLocation]() +## type [InlineQueryResultLocation]() Represents 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. @@ -7887,7 +8514,7 @@ type InlineQueryResultLocation struct { ``` -### func \(\*InlineQueryResultLocation\) [MarshalJSON]() +### func \(\*InlineQueryResultLocation\) [MarshalJSON]() ```go func (v *InlineQueryResultLocation) MarshalJSON() ([]byte, error) @@ -7896,9 +8523,9 @@ func (v *InlineQueryResultLocation) MarshalJSON() ([]byte, error) MarshalJSON encodes InlineQueryResultLocation with the discriminator field "type" forced to "location". The hardcoded value frees callers from setting Type by hand — any user\-supplied value on the struct literal is overridden so a typo can't slip through to Telegram. -## type [InlineQueryResultMpeg4Gif]() +## type [InlineQueryResultMpeg4Gif]() -Represents 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 send a message with the specified content instead of the animation. +Represents 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 an optional caption. Alternatively, you can use input\_message\_content to send a message with the specified content instead of the animation. ```go type InlineQueryResultMpeg4Gif struct { @@ -7936,7 +8563,7 @@ type InlineQueryResultMpeg4Gif struct { ``` -### func \(\*InlineQueryResultMpeg4Gif\) [MarshalJSON]() +### func \(\*InlineQueryResultMpeg4Gif\) [MarshalJSON]() ```go func (v *InlineQueryResultMpeg4Gif) MarshalJSON() ([]byte, error) @@ -7945,9 +8572,9 @@ func (v *InlineQueryResultMpeg4Gif) MarshalJSON() ([]byte, error) MarshalJSON encodes InlineQueryResultMpeg4Gif with the discriminator field "type" forced to "mpeg4\_gif". The hardcoded value frees callers from setting Type by hand — any user\-supplied value on the struct literal is overridden so a typo can't slip through to Telegram. -## type [InlineQueryResultPhoto]() +## type [InlineQueryResultPhoto]() -Represents 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. +Represents a link to a photo. 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 specified content instead of the photo. ```go type InlineQueryResultPhoto struct { @@ -7983,7 +8610,7 @@ type InlineQueryResultPhoto struct { ``` -### func \(\*InlineQueryResultPhoto\) [MarshalJSON]() +### func \(\*InlineQueryResultPhoto\) [MarshalJSON]() ```go func (v *InlineQueryResultPhoto) MarshalJSON() ([]byte, error) @@ -7992,7 +8619,7 @@ func (v *InlineQueryResultPhoto) MarshalJSON() ([]byte, error) MarshalJSON encodes InlineQueryResultPhoto with the discriminator field "type" forced to "photo". The hardcoded value frees callers from setting Type by hand — any user\-supplied value on the struct literal is overridden so a typo can't slip through to Telegram. -## type [InlineQueryResultType]() +## type [InlineQueryResultType]() @@ -8021,7 +8648,7 @@ const ( ``` -## type [InlineQueryResultVenue]() +## type [InlineQueryResultVenue]() Represents 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. @@ -8061,7 +8688,7 @@ type InlineQueryResultVenue struct { ``` -### func \(\*InlineQueryResultVenue\) [MarshalJSON]() +### func \(\*InlineQueryResultVenue\) [MarshalJSON]() ```go func (v *InlineQueryResultVenue) MarshalJSON() ([]byte, error) @@ -8070,7 +8697,7 @@ func (v *InlineQueryResultVenue) MarshalJSON() ([]byte, error) MarshalJSON encodes InlineQueryResultVenue with the discriminator field "type" forced to "venue". The hardcoded value frees callers from setting Type by hand — any user\-supplied value on the struct literal is overridden so a typo can't slip through to Telegram. -## type [InlineQueryResultVideo]() +## type [InlineQueryResultVideo]() Represents 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 message with the specified content instead of the video. If an InlineQueryResultVideo message contains an embedded video \(e.g., YouTube\), you must replace its content using input\_message\_content. @@ -8106,13 +8733,13 @@ type InlineQueryResultVideo struct { Description string `json:"description,omitempty"` // Optional. Inline keyboard attached to the message ReplyMarkup *InlineKeyboardMarkup `json:"reply_markup,omitempty"` - // Optional. Content of the message to be sent instead of the video. This field is required if InlineQueryResultVideo is used to send an HTML-page as a result (e.g., a YouTube video). + // Optional. Content of the message to be sent instead of the video. This field is required if InlineQueryResultVideo is used to send an HTML page as a result (e.g., a YouTube video). InputMessageContent InputMessageContent `json:"input_message_content,omitempty"` } ``` -### func \(\*InlineQueryResultVideo\) [MarshalJSON]() +### func \(\*InlineQueryResultVideo\) [MarshalJSON]() ```go func (v *InlineQueryResultVideo) MarshalJSON() ([]byte, error) @@ -8121,9 +8748,9 @@ func (v *InlineQueryResultVideo) MarshalJSON() ([]byte, error) MarshalJSON encodes InlineQueryResultVideo with the discriminator field "type" forced to "video". The hardcoded value frees callers from setting Type by hand — any user\-supplied value on the struct literal is overridden so a typo can't slip through to Telegram. -## type [InlineQueryResultVoice]() +## type [InlineQueryResultVoice]() -Represents 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 specified content instead of the the voice message. +Represents 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 specified content instead of the voice message. ```go type InlineQueryResultVoice struct { @@ -8151,7 +8778,7 @@ type InlineQueryResultVoice struct { ``` -### func \(\*InlineQueryResultVoice\) [MarshalJSON]() +### func \(\*InlineQueryResultVoice\) [MarshalJSON]() ```go func (v *InlineQueryResultVoice) MarshalJSON() ([]byte, error) @@ -8160,7 +8787,7 @@ func (v *InlineQueryResultVoice) MarshalJSON() ([]byte, error) MarshalJSON encodes InlineQueryResultVoice with the discriminator field "type" forced to "voice". The hardcoded value frees callers from setting Type by hand — any user\-supplied value on the struct literal is overridden so a typo can't slip through to Telegram. -## type [InlineQueryResultsButton]() +## type [InlineQueryResultsButton]() This object represents a button to be shown above inline query results. You must use exactly one of the optional fields. @@ -8176,7 +8803,7 @@ type InlineQueryResultsButton struct { ``` -## type [InputChecklist]() +## type [InputChecklist]() Describes a checklist to create. @@ -8198,7 +8825,7 @@ type InputChecklist struct { ``` -## type [InputChecklistTask]() +## type [InputChecklistTask]() Describes a task to add to a checklist. @@ -8216,7 +8843,7 @@ type InputChecklistTask struct { ``` -## type [InputContactMessageContent]() +## type [InputContactMessageContent]() Represents the content of a contact message to be sent as the result of an inline query. @@ -8261,7 +8888,7 @@ func (f *InputFile) IsLocalUpload() bool IsLocalUpload reports whether this InputFile triggers a multipart upload. -## type [InputInvoiceMessageContent]() +## type [InputInvoiceMessageContent]() Represents the content of an invoice message to be sent as the result of an inline query. @@ -8271,7 +8898,7 @@ type InputInvoiceMessageContent struct { Title string `json:"title"` // Product description, 1-255 characters Description string `json:"description"` - // Bot-defined invoice payload, 1-128 bytes. This will not be displayed to the user, use it for your internal processes. + // Bot-defined invoice payload, 1-128 bytes. This will not be displayed to the user; use it for your internal processes. Payload string `json:"payload"` // Optional. Payment provider token, obtained via @BotFather. Pass an empty string for payments in Telegram Stars. ProviderToken string `json:"provider_token,omitempty"` @@ -8279,9 +8906,9 @@ type InputInvoiceMessageContent struct { Currency string `json:"currency"` // Price breakdown, a JSON-serialized list of components (e.g. product price, tax, discount, delivery cost, delivery tax, bonus, etc.). Must contain exactly one item for payments in Telegram Stars. Prices []LabeledPrice `json:"prices"` - // Optional. The maximum accepted amount for tips in the smallest units of the currency (integer, not float/double). For example, for a maximum tip of US$ 1.45 pass max_tip_amount = 145. See the exp parameter in currencies.json, it shows the number of digits past the decimal point for each currency (2 for the majority of currencies). Defaults to 0. Not supported for payments in Telegram Stars. + // Optional. The maximum accepted amount for tips in the smallest units of the currency (integer, not float/double). For example, for a maximum tip of US$ 1.45 pass max_tip_amount = 145. See the exp parameter in currencies.json; it shows the number of digits past the decimal point for each currency (2 for the majority of currencies). Defaults to 0. Not supported for payments in Telegram Stars. MaxTipAmount *int64 `json:"max_tip_amount,omitempty"` - // Optional. A JSON-serialized Array of suggested amounts of tip in the smallest units of the currency (integer, not float/double). At most 4 suggested tip amounts can be specified. The suggested tip amounts must be positive, passed in a strictly increased order and must not exceed max_tip_amount. + // Optional. A JSON-serialized Array of suggested amounts of tips in the smallest units of the currency (integer, not float/double). At most 4 suggested tip amounts can be specified. The suggested tip amounts must be positive, passed in a strictly increasing order and must not exceed max_tip_amount. SuggestedTipAmounts []int64 `json:"suggested_tip_amounts,omitempty"` // Optional. A JSON-serialized object for data about the invoice, which will be shared with the payment provider. A detailed description of the required fields should be provided by the payment provider. ProviderData string `json:"provider_data,omitempty"` @@ -8311,7 +8938,7 @@ type InputInvoiceMessageContent struct { ``` -## type [InputLocationMessageContent]() +## type [InputLocationMessageContent]() Represents the content of a location message to be sent as the result of an inline query. @@ -8333,7 +8960,7 @@ type InputLocationMessageContent struct { ``` -## type [InputMedia]() +## type [InputMedia]() InputMedia is a union type. The following concrete variants implement it: @@ -8353,7 +8980,7 @@ type InputMedia interface { ``` -### func [UnmarshalInputMedia]() +### func [UnmarshalInputMedia]() ```go func UnmarshalInputMedia(data []byte) (InputMedia, error) @@ -8362,7 +8989,7 @@ func UnmarshalInputMedia(data []byte) (InputMedia, error) UnmarshalInputMedia decodes a InputMedia from JSON by inspecting the "type" field and dispatching to the correct concrete type. -## type [InputMediaAnimation]() +## type [InputMediaAnimation]() Represents an animation file \(GIF or H.264/MPEG\-4 AVC video without sound\) to be sent. @@ -8372,7 +8999,7 @@ type InputMediaAnimation struct { Type InputMediaType `json:"type"` // File to send. Pass a file_id to send a file that exists on the Telegram servers (recommended), pass an HTTP URL for Telegram to get a file from the Internet, or pass “attach://” to upload a new one using multipart/form-data under name. More information on Sending Files » Media string `json:"media"` - // Optional. Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass “attach://” if the thumbnail was uploaded using multipart/form-data under . More information on Sending Files » + // Optional. Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can only be uploaded as a new file, so you can pass “attach://” if the thumbnail was uploaded using multipart/form-data under . More information on Sending Files » Thumbnail string `json:"thumbnail,omitempty"` // Optional. Caption of the animation to be sent, 0-1024 characters after entities parsing Caption string `json:"caption,omitempty"` @@ -8394,7 +9021,7 @@ type InputMediaAnimation struct { ``` -### func \(\*InputMediaAnimation\) [MarshalJSON]() +### func \(\*InputMediaAnimation\) [MarshalJSON]() ```go func (v *InputMediaAnimation) MarshalJSON() ([]byte, error) @@ -8403,7 +9030,7 @@ func (v *InputMediaAnimation) MarshalJSON() ([]byte, error) MarshalJSON encodes InputMediaAnimation with the discriminator field "type" forced to "animation". The hardcoded value frees callers from setting Type by hand — any user\-supplied value on the struct literal is overridden so a typo can't slip through to Telegram. -## type [InputMediaAudio]() +## type [InputMediaAudio]() Represents an audio file to be treated as music to be sent. @@ -8413,7 +9040,7 @@ type InputMediaAudio struct { Type InputMediaType `json:"type"` // File to send. Pass a file_id to send a file that exists on the Telegram servers (recommended), pass an HTTP URL for Telegram to get a file from the Internet, or pass “attach://” to upload a new one using multipart/form-data under name. More information on Sending Files » Media string `json:"media"` - // Optional. Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass “attach://” if the thumbnail was uploaded using multipart/form-data under . More information on Sending Files » + // Optional. Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can only be uploaded as a new file, so you can pass “attach://” if the thumbnail was uploaded using multipart/form-data under . More information on Sending Files » Thumbnail string `json:"thumbnail,omitempty"` // Optional. Caption of the audio to be sent, 0-1024 characters after entities parsing Caption string `json:"caption,omitempty"` @@ -8431,7 +9058,7 @@ type InputMediaAudio struct { ``` -### func \(\*InputMediaAudio\) [MarshalJSON]() +### func \(\*InputMediaAudio\) [MarshalJSON]() ```go func (v *InputMediaAudio) MarshalJSON() ([]byte, error) @@ -8440,7 +9067,7 @@ func (v *InputMediaAudio) MarshalJSON() ([]byte, error) MarshalJSON encodes InputMediaAudio with the discriminator field "type" forced to "audio". The hardcoded value frees callers from setting Type by hand — any user\-supplied value on the struct literal is overridden so a typo can't slip through to Telegram. -## type [InputMediaDocument]() +## type [InputMediaDocument]() Represents a general file to be sent. @@ -8450,7 +9077,7 @@ type InputMediaDocument struct { Type InputMediaType `json:"type"` // File to send. Pass a file_id to send a file that exists on the Telegram servers (recommended), pass an HTTP URL for Telegram to get a file from the Internet, or pass “attach://” to upload a new one using multipart/form-data under name. More information on Sending Files » Media string `json:"media"` - // Optional. Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass “attach://” if the thumbnail was uploaded using multipart/form-data under . More information on Sending Files » + // Optional. Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can only be uploaded as a new file, so you can pass “attach://” if the thumbnail was uploaded using multipart/form-data under . More information on Sending Files » Thumbnail string `json:"thumbnail,omitempty"` // Optional. Caption of the document to be sent, 0-1024 characters after entities parsing Caption string `json:"caption,omitempty"` @@ -8464,7 +9091,7 @@ type InputMediaDocument struct { ``` -### func \(\*InputMediaDocument\) [MarshalJSON]() +### func \(\*InputMediaDocument\) [MarshalJSON]() ```go func (v *InputMediaDocument) MarshalJSON() ([]byte, error) @@ -8473,7 +9100,7 @@ func (v *InputMediaDocument) MarshalJSON() ([]byte, error) MarshalJSON encodes InputMediaDocument with the discriminator field "type" forced to "document". The hardcoded value frees callers from setting Type by hand — any user\-supplied value on the struct literal is overridden so a typo can't slip through to Telegram. -## type [InputMediaLink]() +## type [InputMediaLink]() Represents an HTTP link to be sent. @@ -8487,7 +9114,7 @@ type InputMediaLink struct { ``` -### func \(\*InputMediaLink\) [MarshalJSON]() +### func \(\*InputMediaLink\) [MarshalJSON]() ```go func (v *InputMediaLink) MarshalJSON() ([]byte, error) @@ -8496,7 +9123,7 @@ func (v *InputMediaLink) MarshalJSON() ([]byte, error) MarshalJSON encodes InputMediaLink with the discriminator field "type" forced to "link". The hardcoded value frees callers from setting Type by hand — any user\-supplied value on the struct literal is overridden so a typo can't slip through to Telegram. -## type [InputMediaLivePhoto]() +## type [InputMediaLivePhoto]() Represents a live photo to be sent. @@ -8522,7 +9149,7 @@ type InputMediaLivePhoto struct { ``` -### func \(\*InputMediaLivePhoto\) [MarshalJSON]() +### func \(\*InputMediaLivePhoto\) [MarshalJSON]() ```go func (v *InputMediaLivePhoto) MarshalJSON() ([]byte, error) @@ -8531,7 +9158,7 @@ func (v *InputMediaLivePhoto) MarshalJSON() ([]byte, error) MarshalJSON encodes InputMediaLivePhoto with the discriminator field "type" forced to "live\_photo". The hardcoded value frees callers from setting Type by hand — any user\-supplied value on the struct literal is overridden so a typo can't slip through to Telegram. -## type [InputMediaLocation]() +## type [InputMediaLocation]() Represents a location to be sent. @@ -8549,7 +9176,7 @@ type InputMediaLocation struct { ``` -### func \(\*InputMediaLocation\) [MarshalJSON]() +### func \(\*InputMediaLocation\) [MarshalJSON]() ```go func (v *InputMediaLocation) MarshalJSON() ([]byte, error) @@ -8558,7 +9185,7 @@ func (v *InputMediaLocation) MarshalJSON() ([]byte, error) MarshalJSON encodes InputMediaLocation with the discriminator field "type" forced to "location". The hardcoded value frees callers from setting Type by hand — any user\-supplied value on the struct literal is overridden so a typo can't slip through to Telegram. -## type [InputMediaPhoto]() +## type [InputMediaPhoto]() Represents a photo to be sent. @@ -8582,7 +9209,7 @@ type InputMediaPhoto struct { ``` -### func \(\*InputMediaPhoto\) [MarshalJSON]() +### func \(\*InputMediaPhoto\) [MarshalJSON]() ```go func (v *InputMediaPhoto) MarshalJSON() ([]byte, error) @@ -8591,7 +9218,7 @@ func (v *InputMediaPhoto) MarshalJSON() ([]byte, error) MarshalJSON encodes InputMediaPhoto with the discriminator field "type" forced to "photo". The hardcoded value frees callers from setting Type by hand — any user\-supplied value on the struct literal is overridden so a typo can't slip through to Telegram. -## type [InputMediaSticker]() +## type [InputMediaSticker]() Represents a sticker file to be sent. @@ -8607,7 +9234,7 @@ type InputMediaSticker struct { ``` -### func \(\*InputMediaSticker\) [MarshalJSON]() +### func \(\*InputMediaSticker\) [MarshalJSON]() ```go func (v *InputMediaSticker) MarshalJSON() ([]byte, error) @@ -8616,7 +9243,7 @@ func (v *InputMediaSticker) MarshalJSON() ([]byte, error) MarshalJSON encodes InputMediaSticker with the discriminator field "type" forced to "sticker". The hardcoded value frees callers from setting Type by hand — any user\-supplied value on the struct literal is overridden so a typo can't slip through to Telegram. -## type [InputMediaType]() +## type [InputMediaType]() @@ -8638,7 +9265,7 @@ const ( ``` -## type [InputMediaVenue]() +## type [InputMediaVenue]() Represents a venue to be sent. @@ -8666,7 +9293,7 @@ type InputMediaVenue struct { ``` -### func \(\*InputMediaVenue\) [MarshalJSON]() +### func \(\*InputMediaVenue\) [MarshalJSON]() ```go func (v *InputMediaVenue) MarshalJSON() ([]byte, error) @@ -8675,7 +9302,7 @@ func (v *InputMediaVenue) MarshalJSON() ([]byte, error) MarshalJSON encodes InputMediaVenue with the discriminator field "type" forced to "venue". The hardcoded value frees callers from setting Type by hand — any user\-supplied value on the struct literal is overridden so a typo can't slip through to Telegram. -## type [InputMediaVideo]() +## type [InputMediaVideo]() Represents a video to be sent. @@ -8685,7 +9312,7 @@ type InputMediaVideo struct { Type InputMediaType `json:"type"` // File to send. Pass a file_id to send a file that exists on the Telegram servers (recommended), pass an HTTP URL for Telegram to get a file from the Internet, or pass “attach://” to upload a new one using multipart/form-data under name. More information on Sending Files » Media string `json:"media"` - // Optional. Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass “attach://” if the thumbnail was uploaded using multipart/form-data under . More information on Sending Files » + // Optional. Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can only be uploaded as a new file, so you can pass “attach://” if the thumbnail was uploaded using multipart/form-data under . More information on Sending Files » Thumbnail string `json:"thumbnail,omitempty"` // Optional. Cover for the video in the message. Pass a file_id to send a file that exists on the Telegram servers (recommended), pass an HTTP URL for Telegram to get a file from the Internet, or pass “attach://” to upload a new one using multipart/form-data under name. More information on Sending Files » Cover string `json:"cover,omitempty"` @@ -8713,7 +9340,7 @@ type InputMediaVideo struct { ``` -### func \(\*InputMediaVideo\) [MarshalJSON]() +### func \(\*InputMediaVideo\) [MarshalJSON]() ```go func (v *InputMediaVideo) MarshalJSON() ([]byte, error) @@ -8722,7 +9349,7 @@ func (v *InputMediaVideo) MarshalJSON() ([]byte, error) MarshalJSON encodes InputMediaVideo with the discriminator field "type" forced to "video". The hardcoded value frees callers from setting Type by hand — any user\-supplied value on the struct literal is overridden so a typo can't slip through to Telegram. -## type [InputMediaVoiceNote]() +## type [InputMediaVoiceNote]() Represents a voice message file to be sent. @@ -8730,7 +9357,7 @@ Represents a voice message file to be sent. type InputMediaVoiceNote struct { // Type of the media, must be voice_note Type InputMediaVoiceNoteType `json:"type"` - // File to send. Pass a file_id to send a file that exists on the Telegram servers (recommended), pass an HTTP URL for Telegram to get a file from the Internet, or pass "attach://" to upload a new one using multipart/form-data under name. More information on Sending Files » + // File to send. Pass a file_id to send a file that exists on the Telegram servers (recommended), pass an HTTP URL for Telegram to get a file from the Internet, or pass “attach://” to upload a new one using multipart/form-data under name. More information on Sending Files » Media string `json:"media"` // Optional. Caption of the voice message to be sent, 0-1024 characters after entities parsing Caption string `json:"caption,omitempty"` @@ -8744,7 +9371,7 @@ type InputMediaVoiceNote struct { ``` -## type [InputMediaVoiceNoteType]() +## type [InputMediaVoiceNoteType]() @@ -8761,7 +9388,7 @@ const ( ``` -## type [InputMessageContent]() +## type [InputMessageContent]() InputMessageContent is a union type. The following concrete variants implement it: @@ -8771,6 +9398,8 @@ InputMessageContent is a union type. The following concrete variants implement i - InputVenueMessageContent - InputContactMessageContent - InputInvoiceMessageContent +- InputWidgetMessageContent +- InputSharedWidgetMessageContent This object represents the content of a message to be sent as a result of an inline query. Telegram clients currently support the following types: @@ -8781,7 +9410,7 @@ type InputMessageContent interface { ``` -## type [InputPaidMedia]() +## type [InputPaidMedia]() InputPaidMedia is a union type. The following concrete variants implement it: @@ -8798,7 +9427,7 @@ type InputPaidMedia interface { ``` -### func [UnmarshalInputPaidMedia]() +### func [UnmarshalInputPaidMedia]() ```go func UnmarshalInputPaidMedia(data []byte) (InputPaidMedia, error) @@ -8807,7 +9436,7 @@ func UnmarshalInputPaidMedia(data []byte) (InputPaidMedia, error) UnmarshalInputPaidMedia decodes a InputPaidMedia from JSON by inspecting the "type" field and dispatching to the correct concrete type. -## type [InputPaidMediaLivePhoto]() +## type [InputPaidMediaLivePhoto]() The paid media to send is a live photo. @@ -8823,7 +9452,7 @@ type InputPaidMediaLivePhoto struct { ``` -### func \(\*InputPaidMediaLivePhoto\) [MarshalJSON]() +### func \(\*InputPaidMediaLivePhoto\) [MarshalJSON]() ```go func (v *InputPaidMediaLivePhoto) MarshalJSON() ([]byte, error) @@ -8832,7 +9461,7 @@ func (v *InputPaidMediaLivePhoto) MarshalJSON() ([]byte, error) MarshalJSON encodes InputPaidMediaLivePhoto with the discriminator field "type" forced to "live\_photo". The hardcoded value frees callers from setting Type by hand — any user\-supplied value on the struct literal is overridden so a typo can't slip through to Telegram. -## type [InputPaidMediaPhoto]() +## type [InputPaidMediaPhoto]() The paid media to send is a photo. @@ -8846,7 +9475,7 @@ type InputPaidMediaPhoto struct { ``` -### func \(\*InputPaidMediaPhoto\) [MarshalJSON]() +### func \(\*InputPaidMediaPhoto\) [MarshalJSON]() ```go func (v *InputPaidMediaPhoto) MarshalJSON() ([]byte, error) @@ -8855,7 +9484,7 @@ func (v *InputPaidMediaPhoto) MarshalJSON() ([]byte, error) MarshalJSON encodes InputPaidMediaPhoto with the discriminator field "type" forced to "photo". The hardcoded value frees callers from setting Type by hand — any user\-supplied value on the struct literal is overridden so a typo can't slip through to Telegram. -## type [InputPaidMediaType]() +## type [InputPaidMediaType]() @@ -8874,7 +9503,7 @@ const ( ``` -## type [InputPaidMediaVideo]() +## type [InputPaidMediaVideo]() The paid media to send is a video. @@ -8884,7 +9513,7 @@ type InputPaidMediaVideo struct { Type InputPaidMediaType `json:"type"` // File to send. Pass a file_id to send a file that exists on the Telegram servers (recommended), pass an HTTP URL for Telegram to get a file from the Internet, or pass “attach://” to upload a new one using multipart/form-data under name. More information on Sending Files » Media string `json:"media"` - // Optional. Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass “attach://” if the thumbnail was uploaded using multipart/form-data under . More information on Sending Files » + // Optional. Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can only be uploaded as a new file, so you can pass “attach://” if the thumbnail was uploaded using multipart/form-data under . More information on Sending Files » Thumbnail string `json:"thumbnail,omitempty"` // Optional. Cover for the video in the message. Pass a file_id to send a file that exists on the Telegram servers (recommended), pass an HTTP URL for Telegram to get a file from the Internet, or pass “attach://” to upload a new one using multipart/form-data under name. More information on Sending Files » Cover string `json:"cover,omitempty"` @@ -8902,7 +9531,7 @@ type InputPaidMediaVideo struct { ``` -### func \(\*InputPaidMediaVideo\) [MarshalJSON]() +### func \(\*InputPaidMediaVideo\) [MarshalJSON]() ```go func (v *InputPaidMediaVideo) MarshalJSON() ([]byte, error) @@ -8911,7 +9540,7 @@ func (v *InputPaidMediaVideo) MarshalJSON() ([]byte, error) MarshalJSON encodes InputPaidMediaVideo with the discriminator field "type" forced to "video". The hardcoded value frees callers from setting Type by hand — any user\-supplied value on the struct literal is overridden so a typo can't slip through to Telegram. -## type [InputPollMedia]() +## type [InputPollMedia]() InputPollMedia is a union type. The following concrete variants implement it: @@ -8933,7 +9562,7 @@ type InputPollMedia interface { ``` -### func [UnmarshalInputPollMedia]() +### func [UnmarshalInputPollMedia]() ```go func UnmarshalInputPollMedia(data []byte) (InputPollMedia, error) @@ -8942,7 +9571,7 @@ func UnmarshalInputPollMedia(data []byte) (InputPollMedia, error) UnmarshalInputPollMedia decodes a InputPollMedia from JSON by inspecting the "type" field and dispatching to the correct concrete type. -## type [InputPollMediaType]() +## type [InputPollMediaType]() @@ -8966,7 +9595,7 @@ const ( ``` -## type [InputPollOption]() +## type [InputPollOption]() This object contains information about one answer option in a poll to be sent. @@ -8984,7 +9613,7 @@ type InputPollOption struct { ``` -### func \(\*InputPollOption\) [UnmarshalJSON]() +### func \(\*InputPollOption\) [UnmarshalJSON]() ```go func (m *InputPollOption) UnmarshalJSON(data []byte) error @@ -8993,7 +9622,7 @@ func (m *InputPollOption) UnmarshalJSON(data []byte) error UnmarshalJSON decodes InputPollOption by dispatching union\-typed fields \(Media\) through their concrete UnmarshalXxx helpers. -## type [InputPollOptionMedia]() +## type [InputPollOptionMedia]() InputPollOptionMedia is a union type. The following concrete variants implement it: @@ -9015,7 +9644,7 @@ type InputPollOptionMedia interface { ``` -### func [UnmarshalInputPollOptionMedia]() +### func [UnmarshalInputPollOptionMedia]() ```go func UnmarshalInputPollOptionMedia(data []byte) (InputPollOptionMedia, error) @@ -9024,7 +9653,7 @@ func UnmarshalInputPollOptionMedia(data []byte) (InputPollOptionMedia, error) UnmarshalInputPollOptionMedia decodes a InputPollOptionMedia from JSON by inspecting the "type" field and dispatching to the correct concrete type. -## type [InputPollOptionMediaType]() +## type [InputPollOptionMediaType]() @@ -9048,7 +9677,7 @@ const ( ``` -## type [InputProfilePhoto]() +## type [InputProfilePhoto]() InputProfilePhoto is a union type. The following concrete variants implement it: @@ -9064,7 +9693,7 @@ type InputProfilePhoto interface { ``` -### func [UnmarshalInputProfilePhoto]() +### func [UnmarshalInputProfilePhoto]() ```go func UnmarshalInputProfilePhoto(data []byte) (InputProfilePhoto, error) @@ -9073,7 +9702,7 @@ func UnmarshalInputProfilePhoto(data []byte) (InputProfilePhoto, error) UnmarshalInputProfilePhoto decodes a InputProfilePhoto from JSON by inspecting the "type" field and dispatching to the correct concrete type. -## type [InputProfilePhotoAnimated]() +## type [InputProfilePhotoAnimated]() An animated profile photo in the MPEG4 format. @@ -9089,7 +9718,7 @@ type InputProfilePhotoAnimated struct { ``` -### func \(\*InputProfilePhotoAnimated\) [MarshalJSON]() +### func \(\*InputProfilePhotoAnimated\) [MarshalJSON]() ```go func (v *InputProfilePhotoAnimated) MarshalJSON() ([]byte, error) @@ -9098,7 +9727,7 @@ func (v *InputProfilePhotoAnimated) MarshalJSON() ([]byte, error) MarshalJSON encodes InputProfilePhotoAnimated with the discriminator field "type" forced to "animated". The hardcoded value frees callers from setting Type by hand — any user\-supplied value on the struct literal is overridden so a typo can't slip through to Telegram. -## type [InputProfilePhotoStatic]() +## type [InputProfilePhotoStatic]() A static profile photo in the .JPG format. @@ -9112,7 +9741,7 @@ type InputProfilePhotoStatic struct { ``` -### func \(\*InputProfilePhotoStatic\) [MarshalJSON]() +### func \(\*InputProfilePhotoStatic\) [MarshalJSON]() ```go func (v *InputProfilePhotoStatic) MarshalJSON() ([]byte, error) @@ -9121,7 +9750,7 @@ func (v *InputProfilePhotoStatic) MarshalJSON() ([]byte, error) MarshalJSON encodes InputProfilePhotoStatic with the discriminator field "type" forced to "static". The hardcoded value frees callers from setting Type by hand — any user\-supplied value on the struct literal is overridden so a typo can't slip through to Telegram. -## type [InputProfilePhotoType]() +## type [InputProfilePhotoType]() @@ -9139,7 +9768,7 @@ const ( ``` -## type [InputRichBlock]() +## type [InputRichBlock]() InputRichBlock is a union type. The following concrete variants implement it: @@ -9177,7 +9806,7 @@ type InputRichBlock interface { ``` -### func [UnmarshalInputRichBlock]() +### func [UnmarshalInputRichBlock]() ```go func UnmarshalInputRichBlock(data []byte) (InputRichBlock, error) @@ -9186,7 +9815,7 @@ func UnmarshalInputRichBlock(data []byte) (InputRichBlock, error) UnmarshalInputRichBlock decodes a InputRichBlock from JSON by inspecting the "type" field and dispatching to the correct concrete type. -## type [InputRichBlockAnchor]() +## type [InputRichBlockAnchor]() A block with an anchor, corresponding to the HTML tag \ with the attribute name. @@ -9200,7 +9829,7 @@ type InputRichBlockAnchor struct { ``` -### func \(\*InputRichBlockAnchor\) [MarshalJSON]() +### func \(\*InputRichBlockAnchor\) [MarshalJSON]() ```go func (v *InputRichBlockAnchor) MarshalJSON() ([]byte, error) @@ -9209,7 +9838,7 @@ func (v *InputRichBlockAnchor) MarshalJSON() ([]byte, error) MarshalJSON encodes InputRichBlockAnchor with the discriminator field "type" forced to "anchor". The hardcoded value frees callers from setting Type by hand — any user\-supplied value on the struct literal is overridden so a typo can't slip through to Telegram. -## type [InputRichBlockAnimation]() +## type [InputRichBlockAnimation]() A block with an animation, corresponding to the HTML tag \. @@ -9225,7 +9854,7 @@ type InputRichBlockAnimation struct { ``` -### func \(\*InputRichBlockAnimation\) [MarshalJSON]() +### func \(\*InputRichBlockAnimation\) [MarshalJSON]() ```go func (v *InputRichBlockAnimation) MarshalJSON() ([]byte, error) @@ -9234,7 +9863,7 @@ func (v *InputRichBlockAnimation) MarshalJSON() ([]byte, error) MarshalJSON encodes InputRichBlockAnimation with the discriminator field "type" forced to "animation". The hardcoded value frees callers from setting Type by hand — any user\-supplied value on the struct literal is overridden so a typo can't slip through to Telegram. -## type [InputRichBlockAudio]() +## type [InputRichBlockAudio]() A block with a music file, corresponding to the HTML tag \. @@ -9250,7 +9879,7 @@ type InputRichBlockAudio struct { ``` -### func \(\*InputRichBlockAudio\) [MarshalJSON]() +### func \(\*InputRichBlockAudio\) [MarshalJSON]() ```go func (v *InputRichBlockAudio) MarshalJSON() ([]byte, error) @@ -9259,7 +9888,7 @@ func (v *InputRichBlockAudio) MarshalJSON() ([]byte, error) MarshalJSON encodes InputRichBlockAudio with the discriminator field "type" forced to "audio". The hardcoded value frees callers from setting Type by hand — any user\-supplied value on the struct literal is overridden so a typo can't slip through to Telegram. -## type [InputRichBlockBlockQuotation]() +## type [InputRichBlockBlockQuotation]() A block quotation, corresponding to the HTML tag \. @@ -9275,7 +9904,7 @@ type InputRichBlockBlockQuotation struct { ``` -### func \(\*InputRichBlockBlockQuotation\) [MarshalJSON]() +### func \(\*InputRichBlockBlockQuotation\) [MarshalJSON]() ```go func (v *InputRichBlockBlockQuotation) MarshalJSON() ([]byte, error) @@ -9284,7 +9913,7 @@ func (v *InputRichBlockBlockQuotation) MarshalJSON() ([]byte, error) MarshalJSON encodes InputRichBlockBlockQuotation with the discriminator field "type" forced to "blockquote". The hardcoded value frees callers from setting Type by hand — any user\-supplied value on the struct literal is overridden so a typo can't slip through to Telegram. -### func \(\*InputRichBlockBlockQuotation\) [UnmarshalJSON]() +### func \(\*InputRichBlockBlockQuotation\) [UnmarshalJSON]() ```go func (m *InputRichBlockBlockQuotation) UnmarshalJSON(data []byte) error @@ -9293,7 +9922,7 @@ func (m *InputRichBlockBlockQuotation) UnmarshalJSON(data []byte) error UnmarshalJSON decodes InputRichBlockBlockQuotation by dispatching union\-typed fields \(Blocks, Credit\) through their concrete UnmarshalXxx helpers. -## type [InputRichBlockButtons]() +## type [InputRichBlockButtons]() A block containing a list of buttons that are shown in one row, corresponding to the custom HTML tag \. @@ -9309,7 +9938,7 @@ type InputRichBlockButtons struct { ``` -### func \(\*InputRichBlockButtons\) [MarshalJSON]() +### func \(\*InputRichBlockButtons\) [MarshalJSON]() ```go func (v *InputRichBlockButtons) MarshalJSON() ([]byte, error) @@ -9318,7 +9947,7 @@ func (v *InputRichBlockButtons) MarshalJSON() ([]byte, error) MarshalJSON encodes InputRichBlockButtons with the discriminator field "type" forced to "buttons". The hardcoded value frees callers from setting Type by hand — any user\-supplied value on the struct literal is overridden so a typo can't slip through to Telegram. -## type [InputRichBlockCollage]() +## type [InputRichBlockCollage]() A collage, corresponding to the custom HTML tag \. @@ -9334,7 +9963,7 @@ type InputRichBlockCollage struct { ``` -### func \(\*InputRichBlockCollage\) [MarshalJSON]() +### func \(\*InputRichBlockCollage\) [MarshalJSON]() ```go func (v *InputRichBlockCollage) MarshalJSON() ([]byte, error) @@ -9343,7 +9972,7 @@ func (v *InputRichBlockCollage) MarshalJSON() ([]byte, error) MarshalJSON encodes InputRichBlockCollage with the discriminator field "type" forced to "collage". The hardcoded value frees callers from setting Type by hand — any user\-supplied value on the struct literal is overridden so a typo can't slip through to Telegram. -### func \(\*InputRichBlockCollage\) [UnmarshalJSON]() +### func \(\*InputRichBlockCollage\) [UnmarshalJSON]() ```go func (m *InputRichBlockCollage) UnmarshalJSON(data []byte) error @@ -9352,7 +9981,7 @@ func (m *InputRichBlockCollage) UnmarshalJSON(data []byte) error UnmarshalJSON decodes InputRichBlockCollage by dispatching union\-typed fields \(Blocks\) through their concrete UnmarshalXxx helpers. -## type [InputRichBlockDetails]() +## type [InputRichBlockDetails]() An expandable block for details disclosure, corresponding to the HTML tag \. @@ -9370,7 +9999,7 @@ type InputRichBlockDetails struct { ``` -### func \(\*InputRichBlockDetails\) [MarshalJSON]() +### func \(\*InputRichBlockDetails\) [MarshalJSON]() ```go func (v *InputRichBlockDetails) MarshalJSON() ([]byte, error) @@ -9379,7 +10008,7 @@ func (v *InputRichBlockDetails) MarshalJSON() ([]byte, error) MarshalJSON encodes InputRichBlockDetails with the discriminator field "type" forced to "details". The hardcoded value frees callers from setting Type by hand — any user\-supplied value on the struct literal is overridden so a typo can't slip through to Telegram. -### func \(\*InputRichBlockDetails\) [UnmarshalJSON]() +### func \(\*InputRichBlockDetails\) [UnmarshalJSON]() ```go func (m *InputRichBlockDetails) UnmarshalJSON(data []byte) error @@ -9388,7 +10017,7 @@ func (m *InputRichBlockDetails) UnmarshalJSON(data []byte) error UnmarshalJSON decodes InputRichBlockDetails by dispatching union\-typed fields \(Summary, Blocks\) through their concrete UnmarshalXxx helpers. -## type [InputRichBlockDivider]() +## type [InputRichBlockDivider]() A divider, corresponding to the HTML tag \
. @@ -9400,7 +10029,7 @@ type InputRichBlockDivider struct { ``` -### func \(\*InputRichBlockDivider\) [MarshalJSON]() +### func \(\*InputRichBlockDivider\) [MarshalJSON]() ```go func (v *InputRichBlockDivider) MarshalJSON() ([]byte, error) @@ -9409,7 +10038,7 @@ func (v *InputRichBlockDivider) MarshalJSON() ([]byte, error) MarshalJSON encodes InputRichBlockDivider with the discriminator field "type" forced to "divider". The hardcoded value frees callers from setting Type by hand — any user\-supplied value on the struct literal is overridden so a typo can't slip through to Telegram. -## type [InputRichBlockDocument]() +## type [InputRichBlockDocument]() A block with a general file, corresponding to the custom HTML tag \. @@ -9425,7 +10054,7 @@ type InputRichBlockDocument struct { ``` -### func \(\*InputRichBlockDocument\) [MarshalJSON]() +### func \(\*InputRichBlockDocument\) [MarshalJSON]() ```go func (v *InputRichBlockDocument) MarshalJSON() ([]byte, error) @@ -9434,23 +10063,23 @@ func (v *InputRichBlockDocument) MarshalJSON() ([]byte, error) MarshalJSON encodes InputRichBlockDocument with the discriminator field "type" forced to "document". The hardcoded value frees callers from setting Type by hand — any user\-supplied value on the struct literal is overridden so a typo can't slip through to Telegram. -## type [InputRichBlockExpandableBlockQuotation]() +## type [InputRichBlockExpandableBlockQuotation]() -A block quotation, corresponding to the HTML tag \ with custom attribute "expandable". +A block quotation, corresponding to the HTML tag \ with the custom attribute "expandable". ```go type InputRichBlockExpandableBlockQuotation struct { // Type of the block, always “expandable_blockquote” Type InputRichBlockType `json:"type"` // Content of the block - Text RichText `json:"text"` + Blocks []InputRichBlock `json:"blocks"` // Optional. Credit of the block Credit RichText `json:"credit,omitempty"` } ``` -### func \(\*InputRichBlockExpandableBlockQuotation\) [MarshalJSON]() +### func \(\*InputRichBlockExpandableBlockQuotation\) [MarshalJSON]() ```go func (v *InputRichBlockExpandableBlockQuotation) MarshalJSON() ([]byte, error) @@ -9459,16 +10088,16 @@ func (v *InputRichBlockExpandableBlockQuotation) MarshalJSON() ([]byte, error) MarshalJSON encodes InputRichBlockExpandableBlockQuotation with the discriminator field "type" forced to "expandable\_blockquote". The hardcoded value frees callers from setting Type by hand — any user\-supplied value on the struct literal is overridden so a typo can't slip through to Telegram. -### func \(\*InputRichBlockExpandableBlockQuotation\) [UnmarshalJSON]() +### func \(\*InputRichBlockExpandableBlockQuotation\) [UnmarshalJSON]() ```go func (m *InputRichBlockExpandableBlockQuotation) UnmarshalJSON(data []byte) error ``` -UnmarshalJSON decodes InputRichBlockExpandableBlockQuotation by dispatching union\-typed fields \(Text, Credit\) through their concrete UnmarshalXxx helpers. +UnmarshalJSON decodes InputRichBlockExpandableBlockQuotation by dispatching union\-typed fields \(Blocks, Credit\) through their concrete UnmarshalXxx helpers. -## type [InputRichBlockFooter]() +## type [InputRichBlockFooter]() A footer, corresponding to the HTML tag \. @@ -9482,7 +10111,7 @@ type InputRichBlockFooter struct { ``` -### func \(\*InputRichBlockFooter\) [MarshalJSON]() +### func \(\*InputRichBlockFooter\) [MarshalJSON]() ```go func (v *InputRichBlockFooter) MarshalJSON() ([]byte, error) @@ -9491,7 +10120,7 @@ func (v *InputRichBlockFooter) MarshalJSON() ([]byte, error) MarshalJSON encodes InputRichBlockFooter with the discriminator field "type" forced to "footer". The hardcoded value frees callers from setting Type by hand — any user\-supplied value on the struct literal is overridden so a typo can't slip through to Telegram. -### func \(\*InputRichBlockFooter\) [UnmarshalJSON]() +### func \(\*InputRichBlockFooter\) [UnmarshalJSON]() ```go func (m *InputRichBlockFooter) UnmarshalJSON(data []byte) error @@ -9500,7 +10129,7 @@ func (m *InputRichBlockFooter) UnmarshalJSON(data []byte) error UnmarshalJSON decodes InputRichBlockFooter by dispatching union\-typed fields \(Text\) through their concrete UnmarshalXxx helpers. -## type [InputRichBlockList]() +## type [InputRichBlockList]() A list of blocks, corresponding to the HTML tag \ or \ with multiple nested tags \. @@ -9514,7 +10143,7 @@ type InputRichBlockList struct { ``` -### func \(\*InputRichBlockList\) [MarshalJSON]() +### func \(\*InputRichBlockList\) [MarshalJSON]() ```go func (v *InputRichBlockList) MarshalJSON() ([]byte, error) @@ -9523,7 +10152,7 @@ func (v *InputRichBlockList) MarshalJSON() ([]byte, error) MarshalJSON encodes InputRichBlockList with the discriminator field "type" forced to "list". The hardcoded value frees callers from setting Type by hand — any user\-supplied value on the struct literal is overridden so a typo can't slip through to Telegram. -## type [InputRichBlockListItem]() +## type [InputRichBlockListItem]() An item of a list to be sent. @@ -9543,7 +10172,7 @@ type InputRichBlockListItem struct { ``` -### func \(\*InputRichBlockListItem\) [UnmarshalJSON]() +### func \(\*InputRichBlockListItem\) [UnmarshalJSON]() ```go func (m *InputRichBlockListItem) UnmarshalJSON(data []byte) error @@ -9552,7 +10181,7 @@ func (m *InputRichBlockListItem) UnmarshalJSON(data []byte) error UnmarshalJSON decodes InputRichBlockListItem by dispatching union\-typed fields \(Blocks\) through their concrete UnmarshalXxx helpers. -## type [InputRichBlockMap]() +## type [InputRichBlockMap]() A block with a map, corresponding to the custom HTML tag \. The map's width and height must not exceed 10000 in total. The width and height ratio must be at most 20. @@ -9574,7 +10203,7 @@ type InputRichBlockMap struct { ``` -### func \(\*InputRichBlockMap\) [MarshalJSON]() +### func \(\*InputRichBlockMap\) [MarshalJSON]() ```go func (v *InputRichBlockMap) MarshalJSON() ([]byte, error) @@ -9583,7 +10212,7 @@ func (v *InputRichBlockMap) MarshalJSON() ([]byte, error) MarshalJSON encodes InputRichBlockMap with the discriminator field "type" forced to "map". The hardcoded value frees callers from setting Type by hand — any user\-supplied value on the struct literal is overridden so a typo can't slip through to Telegram. -## type [InputRichBlockMathematicalExpression]() +## type [InputRichBlockMathematicalExpression]() A block with a mathematical expression in LaTeX format, corresponding to the custom HTML tag \. @@ -9597,7 +10226,7 @@ type InputRichBlockMathematicalExpression struct { ``` -### func \(\*InputRichBlockMathematicalExpression\) [MarshalJSON]() +### func \(\*InputRichBlockMathematicalExpression\) [MarshalJSON]() ```go func (v *InputRichBlockMathematicalExpression) MarshalJSON() ([]byte, error) @@ -9606,7 +10235,7 @@ func (v *InputRichBlockMathematicalExpression) MarshalJSON() ([]byte, error) MarshalJSON encodes InputRichBlockMathematicalExpression with the discriminator field "type" forced to "mathematical\_expression". The hardcoded value frees callers from setting Type by hand — any user\-supplied value on the struct literal is overridden so a typo can't slip through to Telegram. -## type [InputRichBlockParagraph]() +## type [InputRichBlockParagraph]() A text paragraph, corresponding to the HTML tag \. @@ -9620,7 +10249,7 @@ type InputRichBlockParagraph struct { ``` -### func \(\*InputRichBlockParagraph\) [MarshalJSON]() +### func \(\*InputRichBlockParagraph\) [MarshalJSON]() ```go func (v *InputRichBlockParagraph) MarshalJSON() ([]byte, error) @@ -9629,7 +10258,7 @@ func (v *InputRichBlockParagraph) MarshalJSON() ([]byte, error) MarshalJSON encodes InputRichBlockParagraph with the discriminator field "type" forced to "paragraph". The hardcoded value frees callers from setting Type by hand — any user\-supplied value on the struct literal is overridden so a typo can't slip through to Telegram. -### func \(\*InputRichBlockParagraph\) [UnmarshalJSON]() +### func \(\*InputRichBlockParagraph\) [UnmarshalJSON]() ```go func (m *InputRichBlockParagraph) UnmarshalJSON(data []byte) error @@ -9638,7 +10267,7 @@ func (m *InputRichBlockParagraph) UnmarshalJSON(data []byte) error UnmarshalJSON decodes InputRichBlockParagraph by dispatching union\-typed fields \(Text\) through their concrete UnmarshalXxx helpers. -## type [InputRichBlockPhoto]() +## type [InputRichBlockPhoto]() A block with a photo, corresponding to the HTML tag \. @@ -9654,7 +10283,7 @@ type InputRichBlockPhoto struct { ``` -### func \(\*InputRichBlockPhoto\) [MarshalJSON]() +### func \(\*InputRichBlockPhoto\) [MarshalJSON]() ```go func (v *InputRichBlockPhoto) MarshalJSON() ([]byte, error) @@ -9663,7 +10292,7 @@ func (v *InputRichBlockPhoto) MarshalJSON() ([]byte, error) MarshalJSON encodes InputRichBlockPhoto with the discriminator field "type" forced to "photo". The hardcoded value frees callers from setting Type by hand — any user\-supplied value on the struct literal is overridden so a typo can't slip through to Telegram. -## type [InputRichBlockPreformatted]() +## type [InputRichBlockPreformatted]() A preformatted text block, corresponding to the nested HTML tags \ and \. @@ -9679,7 +10308,7 @@ type InputRichBlockPreformatted struct { ``` -### func \(\*InputRichBlockPreformatted\) [MarshalJSON]() +### func \(\*InputRichBlockPreformatted\) [MarshalJSON]() ```go func (v *InputRichBlockPreformatted) MarshalJSON() ([]byte, error) @@ -9688,7 +10317,7 @@ func (v *InputRichBlockPreformatted) MarshalJSON() ([]byte, error) MarshalJSON encodes InputRichBlockPreformatted with the discriminator field "type" forced to "pre". The hardcoded value frees callers from setting Type by hand — any user\-supplied value on the struct literal is overridden so a typo can't slip through to Telegram. -### func \(\*InputRichBlockPreformatted\) [UnmarshalJSON]() +### func \(\*InputRichBlockPreformatted\) [UnmarshalJSON]() ```go func (m *InputRichBlockPreformatted) UnmarshalJSON(data []byte) error @@ -9697,7 +10326,7 @@ func (m *InputRichBlockPreformatted) UnmarshalJSON(data []byte) error UnmarshalJSON decodes InputRichBlockPreformatted by dispatching union\-typed fields \(Text\) through their concrete UnmarshalXxx helpers. -## type [InputRichBlockPullQuotation]() +## type [InputRichBlockPullQuotation]() A quotation with centered text, loosely corresponding to the HTML tag \. @@ -9713,7 +10342,7 @@ type InputRichBlockPullQuotation struct { ``` -### func \(\*InputRichBlockPullQuotation\) [MarshalJSON]() +### func \(\*InputRichBlockPullQuotation\) [MarshalJSON]() ```go func (v *InputRichBlockPullQuotation) MarshalJSON() ([]byte, error) @@ -9722,7 +10351,7 @@ func (v *InputRichBlockPullQuotation) MarshalJSON() ([]byte, error) MarshalJSON encodes InputRichBlockPullQuotation with the discriminator field "type" forced to "pullquote". The hardcoded value frees callers from setting Type by hand — any user\-supplied value on the struct literal is overridden so a typo can't slip through to Telegram. -### func \(\*InputRichBlockPullQuotation\) [UnmarshalJSON]() +### func \(\*InputRichBlockPullQuotation\) [UnmarshalJSON]() ```go func (m *InputRichBlockPullQuotation) UnmarshalJSON(data []byte) error @@ -9731,7 +10360,7 @@ func (m *InputRichBlockPullQuotation) UnmarshalJSON(data []byte) error UnmarshalJSON decodes InputRichBlockPullQuotation by dispatching union\-typed fields \(Text, Credit\) through their concrete UnmarshalXxx helpers. -## type [InputRichBlockSectionHeading]() +## type [InputRichBlockSectionHeading]() A section heading, corresponding to the HTML tags \, \, \, \, \, or \. @@ -9747,7 +10376,7 @@ type InputRichBlockSectionHeading struct { ``` -### func \(\*InputRichBlockSectionHeading\) [MarshalJSON]() +### func \(\*InputRichBlockSectionHeading\) [MarshalJSON]() ```go func (v *InputRichBlockSectionHeading) MarshalJSON() ([]byte, error) @@ -9756,7 +10385,7 @@ func (v *InputRichBlockSectionHeading) MarshalJSON() ([]byte, error) MarshalJSON encodes InputRichBlockSectionHeading with the discriminator field "type" forced to "heading". The hardcoded value frees callers from setting Type by hand — any user\-supplied value on the struct literal is overridden so a typo can't slip through to Telegram. -### func \(\*InputRichBlockSectionHeading\) [UnmarshalJSON]() +### func \(\*InputRichBlockSectionHeading\) [UnmarshalJSON]() ```go func (m *InputRichBlockSectionHeading) UnmarshalJSON(data []byte) error @@ -9765,7 +10394,7 @@ func (m *InputRichBlockSectionHeading) UnmarshalJSON(data []byte) error UnmarshalJSON decodes InputRichBlockSectionHeading by dispatching union\-typed fields \(Text\) through their concrete UnmarshalXxx helpers. -## type [InputRichBlockSlideshow]() +## type [InputRichBlockSlideshow]() A slideshow, corresponding to the custom HTML tag \. @@ -9781,7 +10410,7 @@ type InputRichBlockSlideshow struct { ``` -### func \(\*InputRichBlockSlideshow\) [MarshalJSON]() +### func \(\*InputRichBlockSlideshow\) [MarshalJSON]() ```go func (v *InputRichBlockSlideshow) MarshalJSON() ([]byte, error) @@ -9790,7 +10419,7 @@ func (v *InputRichBlockSlideshow) MarshalJSON() ([]byte, error) MarshalJSON encodes InputRichBlockSlideshow with the discriminator field "type" forced to "slideshow". The hardcoded value frees callers from setting Type by hand — any user\-supplied value on the struct literal is overridden so a typo can't slip through to Telegram. -### func \(\*InputRichBlockSlideshow\) [UnmarshalJSON]() +### func \(\*InputRichBlockSlideshow\) [UnmarshalJSON]() ```go func (m *InputRichBlockSlideshow) UnmarshalJSON(data []byte) error @@ -9799,7 +10428,7 @@ func (m *InputRichBlockSlideshow) UnmarshalJSON(data []byte) error UnmarshalJSON decodes InputRichBlockSlideshow by dispatching union\-typed fields \(Blocks\) through their concrete UnmarshalXxx helpers. -## type [InputRichBlockTable]() +## type [InputRichBlockTable]() A table, corresponding to the HTML tag \. @@ -9821,7 +10450,7 @@ type InputRichBlockTable struct { ``` -### func \(\*InputRichBlockTable\) [MarshalJSON]() +### func \(\*InputRichBlockTable\) [MarshalJSON]() ```go func (v *InputRichBlockTable) MarshalJSON() ([]byte, error) @@ -9830,7 +10459,7 @@ func (v *InputRichBlockTable) MarshalJSON() ([]byte, error) MarshalJSON encodes InputRichBlockTable with the discriminator field "type" forced to "table". The hardcoded value frees callers from setting Type by hand — any user\-supplied value on the struct literal is overridden so a typo can't slip through to Telegram. -### func \(\*InputRichBlockTable\) [UnmarshalJSON]() +### func \(\*InputRichBlockTable\) [UnmarshalJSON]() ```go func (m *InputRichBlockTable) UnmarshalJSON(data []byte) error @@ -9839,9 +10468,9 @@ func (m *InputRichBlockTable) UnmarshalJSON(data []byte) error UnmarshalJSON decodes InputRichBlockTable by dispatching union\-typed fields \(Caption\) through their concrete UnmarshalXxx helpers. -## type [InputRichBlockThinking]() +## type [InputRichBlockThinking]() -A block with a “Thinking…” placeholder, corresponding to the custom HTML tag \. The block may be used only in sendRichMessageDraft, therefore it can't be received in messages. See https://t.me/addemoji/AIActions for examples of custom emoji that are recommended for usage in the block. +A block with a “Thinking…” placeholder, corresponding to the custom HTML tag \. The block may be used only in sendRichMessageDraft; therefore, it can't be received in messages. See https://t.me/addemoji/AIActions for examples of custom emoji that are recommended for usage in the block. ```go type InputRichBlockThinking struct { @@ -9853,7 +10482,7 @@ type InputRichBlockThinking struct { ``` -### func \(\*InputRichBlockThinking\) [MarshalJSON]() +### func \(\*InputRichBlockThinking\) [MarshalJSON]() ```go func (v *InputRichBlockThinking) MarshalJSON() ([]byte, error) @@ -9862,7 +10491,7 @@ func (v *InputRichBlockThinking) MarshalJSON() ([]byte, error) MarshalJSON encodes InputRichBlockThinking with the discriminator field "type" forced to "thinking". The hardcoded value frees callers from setting Type by hand — any user\-supplied value on the struct literal is overridden so a typo can't slip through to Telegram. -### func \(\*InputRichBlockThinking\) [UnmarshalJSON]() +### func \(\*InputRichBlockThinking\) [UnmarshalJSON]() ```go func (m *InputRichBlockThinking) UnmarshalJSON(data []byte) error @@ -9871,7 +10500,7 @@ func (m *InputRichBlockThinking) UnmarshalJSON(data []byte) error UnmarshalJSON decodes InputRichBlockThinking by dispatching union\-typed fields \(Text\) through their concrete UnmarshalXxx helpers. -## type [InputRichBlockType]() +## type [InputRichBlockType]() @@ -9911,7 +10540,7 @@ const ( ``` -## type [InputRichBlockVideo]() +## type [InputRichBlockVideo]() A block with a video, corresponding to the HTML tag \. @@ -9927,7 +10556,7 @@ type InputRichBlockVideo struct { ``` -### func \(\*InputRichBlockVideo\) [MarshalJSON]() +### func \(\*InputRichBlockVideo\) [MarshalJSON]() ```go func (v *InputRichBlockVideo) MarshalJSON() ([]byte, error) @@ -9936,7 +10565,7 @@ func (v *InputRichBlockVideo) MarshalJSON() ([]byte, error) MarshalJSON encodes InputRichBlockVideo with the discriminator field "type" forced to "video". The hardcoded value frees callers from setting Type by hand — any user\-supplied value on the struct literal is overridden so a typo can't slip through to Telegram. -## type [InputRichBlockVoiceNote]() +## type [InputRichBlockVoiceNote]() A block with a voice note, corresponding to the HTML tag \. @@ -9952,7 +10581,7 @@ type InputRichBlockVoiceNote struct { ``` -### func \(\*InputRichBlockVoiceNote\) [MarshalJSON]() +### func \(\*InputRichBlockVoiceNote\) [MarshalJSON]() ```go func (v *InputRichBlockVoiceNote) MarshalJSON() ([]byte, error) @@ -9961,7 +10590,7 @@ func (v *InputRichBlockVoiceNote) MarshalJSON() ([]byte, error) MarshalJSON encodes InputRichBlockVoiceNote with the discriminator field "type" forced to "voice\_note". The hardcoded value frees callers from setting Type by hand — any user\-supplied value on the struct literal is overridden so a typo can't slip through to Telegram. -## type [InputRichMessage]() +## type [InputRichMessage]() Describes a rich message to be sent. Exactly one of the fields html, markdown, or blocks must be used. @@ -9969,9 +10598,9 @@ Describes a rich message to be sent. Exactly one of the fields html, markdown, o type InputRichMessage struct { // Optional. Content of the rich message to send described as a list of blocks Blocks []InputRichBlock `json:"blocks,omitempty"` - // Optional. Content of the rich message to send described using HTML formatting. See rich message formatting options for more details. Use media field to specify the media used in the message. + // Optional. Content of the rich message to send described using HTML formatting. See rich message formatting options for more details. Use the media field to specify the media used in the message. HTML string `json:"html,omitempty"` - // Optional. Content of the rich message to send described using Markdown formatting. See rich message formatting options for more details. Use media field to specify the media used in the message. + // Optional. Content of the rich message to send described using Markdown formatting. See rich message formatting options for more details. Use the media field to specify the media used in the message. Markdown string `json:"markdown,omitempty"` // Optional. List of media that are specified in the markdown or html fields using tg://photo?id=, tg://video?id=, tg://document?id=, and tg://audio?id= links Media []InputRichMessageMedia `json:"media,omitempty"` @@ -9983,7 +10612,7 @@ type InputRichMessage struct { ``` -### func \(\*InputRichMessage\) [UnmarshalJSON]() +### func \(\*InputRichMessage\) [UnmarshalJSON]() ```go func (m *InputRichMessage) UnmarshalJSON(data []byte) error @@ -9992,7 +10621,7 @@ func (m *InputRichMessage) UnmarshalJSON(data []byte) error UnmarshalJSON decodes InputRichMessage by dispatching union\-typed fields \(Blocks\) through their concrete UnmarshalXxx helpers. -## type [InputRichMessageContent]() +## type [InputRichMessageContent]() Represents the content of a rich message to be sent as the result of an inline query. @@ -10004,7 +10633,7 @@ type InputRichMessageContent struct { ``` -## type [InputRichMessageMedia]() +## type [InputRichMessageMedia]() Describes a media element embedded in an outgoing rich message. @@ -10017,8 +10646,30 @@ type InputRichMessageMedia struct { } ``` + +## type [InputSharedWidgetMessageContent]() + +Represents 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. + +```go +type InputSharedWidgetMessageContent struct { + // Unique identifier of the shared widget created by the bot + WidgetID string `json:"widget_id"` + // Optional. Data of the widget, which is specific to the message, 0-1024 bytes + ChatData string `json:"chat_data,omitempty"` + // Optional. Widget caption, 0-1024 characters after entities parsing + Caption string `json:"caption,omitempty"` + // Optional. Mode for parsing entities in the widget caption. See formatting options for more details. + ParseMode ParseMode `json:"parse_mode,omitempty"` + // Optional. List of special entities that appear in the caption, which can be specified instead of parse_mode + CaptionEntities []MessageEntity `json:"caption_entities,omitempty"` + // Optional. Pass True if the caption must be shown above the widget + ShowCaptionAboveMedia *bool `json:"show_caption_above_media,omitempty"` +} +``` + -## type [InputSticker]() +## type [InputSticker]() This object describes a sticker to be added to a sticker set. @@ -10032,13 +10683,13 @@ type InputSticker struct { EmojiList []string `json:"emoji_list"` // Optional. Position where the mask should be placed on faces. For “mask” stickers only. MaskPosition *MaskPosition `json:"mask_position,omitempty"` - // Optional. List of 0-20 search keywords for the sticker with total length of up to 64 characters. For “regular” and “custom_emoji” stickers only. + // Optional. List of 0-20 search keywords for the sticker with a total length of up to 64 characters. For “regular” and “custom_emoji” stickers only. Keywords []string `json:"keywords,omitempty"` } ``` -## type [InputStickerFormat]() +## type [InputStickerFormat]() @@ -10057,7 +10708,7 @@ const ( ``` -## type [InputStoryContent]() +## type [InputStoryContent]() InputStoryContent is a union type. The following concrete variants implement it: @@ -10073,7 +10724,7 @@ type InputStoryContent interface { ``` -### func [UnmarshalInputStoryContent]() +### func [UnmarshalInputStoryContent]() ```go func UnmarshalInputStoryContent(data []byte) (InputStoryContent, error) @@ -10082,7 +10733,7 @@ func UnmarshalInputStoryContent(data []byte) (InputStoryContent, error) UnmarshalInputStoryContent decodes a InputStoryContent from JSON by inspecting the "type" field and dispatching to the correct concrete type. -## type [InputStoryContentPhoto]() +## type [InputStoryContentPhoto]() Describes a photo to post as a story. @@ -10096,7 +10747,7 @@ type InputStoryContentPhoto struct { ``` -### func \(\*InputStoryContentPhoto\) [MarshalJSON]() +### func \(\*InputStoryContentPhoto\) [MarshalJSON]() ```go func (v *InputStoryContentPhoto) MarshalJSON() ([]byte, error) @@ -10105,7 +10756,7 @@ func (v *InputStoryContentPhoto) MarshalJSON() ([]byte, error) MarshalJSON encodes InputStoryContentPhoto with the discriminator field "type" forced to "photo". The hardcoded value frees callers from setting Type by hand — any user\-supplied value on the struct literal is overridden so a typo can't slip through to Telegram. -## type [InputStoryContentType]() +## type [InputStoryContentType]() @@ -10123,7 +10774,7 @@ const ( ``` -## type [InputStoryContentVideo]() +## type [InputStoryContentVideo]() Describes a video to post as a story. @@ -10143,7 +10794,7 @@ type InputStoryContentVideo struct { ``` -### func \(\*InputStoryContentVideo\) [MarshalJSON]() +### func \(\*InputStoryContentVideo\) [MarshalJSON]() ```go func (v *InputStoryContentVideo) MarshalJSON() ([]byte, error) @@ -10152,7 +10803,7 @@ func (v *InputStoryContentVideo) MarshalJSON() ([]byte, error) MarshalJSON encodes InputStoryContentVideo with the discriminator field "type" forced to "video". The hardcoded value frees callers from setting Type by hand — any user\-supplied value on the struct literal is overridden so a typo can't slip through to Telegram. -## type [InputTextMessageContent]() +## type [InputTextMessageContent]() Represents the content of a text message to be sent as the result of an inline query. @@ -10170,7 +10821,7 @@ type InputTextMessageContent struct { ``` -## type [InputVenueMessageContent]() +## type [InputVenueMessageContent]() Represents the content of a venue message to be sent as the result of an inline query. @@ -10195,8 +10846,40 @@ type InputVenueMessageContent struct { } ``` + +## type [InputWidgetMessageContent]() + +Represents 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. + +```go +type InputWidgetMessageContent struct { + // HTML code of the widget, 1-32768 bytes. The code must not exceed 4096 bytes when compressed by zlib with the maximum compression level. + HTML string `json:"html"` + // Optional. Width of the widget in logical pixels; omit if the widget must occupy the whole width of the message bubble. The width is clamped by the app to the range from 200 to the maximum width of the message bubble. + Width *int64 `json:"width,omitempty"` + // Optional. Height of the widget in logical pixels; omit if the height of the widget isn't fixed. The height is clamped by the app to the range 50-600. + Height *int64 `json:"height,omitempty"` + // Optional. Public data of the widget, 0-1024 bytes, which will be available wherever the widget is shown. If the widget is shared, then all messages with it will have the same public data. + PublicData string `json:"public_data,omitempty"` + // Optional. Data of the widget, which is specific to the message, 0-1024 bytes + ChatData string `json:"chat_data,omitempty"` + // Optional. Widget caption, 0-1024 characters after entities parsing + Caption string `json:"caption,omitempty"` + // Optional. Mode for parsing entities in the widget caption. See formatting options for more details. + ParseMode ParseMode `json:"parse_mode,omitempty"` + // Optional. List of special entities that appear in the caption, which can be specified instead of parse_mode + CaptionEntities []MessageEntity `json:"caption_entities,omitempty"` + // Optional. Pass True if the caption must be shown above the widget + ShowCaptionAboveMedia *bool `json:"show_caption_above_media,omitempty"` + // Optional. Pass True to allow the widget to send queries to the bot + AllowQueries *bool `json:"allow_queries,omitempty"` + // Optional. Pass True to create a shared widget. Each message sent from the result creates a separate shared widget, whose identifier is received by the bot only in the field widget_id of queries from the widget. To send an existing shared widget in response to an inline query, use InputSharedWidgetMessageContent instead. + IsShared *bool `json:"is_shared,omitempty"` +} +``` + -## type [Invoice]() +## type [Invoice]() This object contains basic information about an invoice. @@ -10210,13 +10893,13 @@ type Invoice struct { StartParameter string `json:"start_parameter"` // Three-letter ISO 4217 currency code, or “XTR” for payments in Telegram Stars Currency string `json:"currency"` - // Total price in the smallest units of the currency (integer, not float/double). For example, for a price of US$ 1.45 pass amount = 145. See the exp parameter in currencies.json, it shows the number of digits past the decimal point for each currency (2 for the majority of currencies). + // Total price in the smallest units of the currency (integer, not float/double). For example, for a price of US$ 1.45, total_amount = 145. See the exp parameter in currencies.json; it shows the number of digits past the decimal point for each currency (2 for the majority of currencies). TotalAmount int64 `json:"total_amount"` } ``` -## type [KeyboardButton]() +## type [KeyboardButton]() This 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 used instead of this object to specify the button text. @@ -10232,7 +10915,7 @@ type KeyboardButton struct { RequestUsers *KeyboardButtonRequestUsers `json:"request_users,omitempty"` // Optional. If specified, pressing the button will open a list of suitable chats. Tapping on a chat will send its identifier to the bot in a “chat_shared” service message. Available in private chats only. RequestChat *KeyboardButtonRequestChat `json:"request_chat,omitempty"` - // Optional. If specified, pressing the button will ask the user to create and share a bot that will be managed by the current bot. Available for bots that enabled management of other bots in the @BotFather Mini App. Available in private chats only. + // Optional. If specified, pressing the button will ask the user to create and share a bot that will be managed by the current bot. Available for bots that enabled management of other bots in the @BotFather Mini App or using the parameter can_manage_bots of the method setMySettings. Available in private chats only. RequestManagedBot *KeyboardButtonRequestManagedBot `json:"request_managed_bot,omitempty"` // Optional. If True, the user's phone number will be sent as a contact when the button is pressed. Available in private chats only. RequestContact *bool `json:"request_contact,omitempty"` @@ -10246,9 +10929,9 @@ type KeyboardButton struct { ``` -## type [KeyboardButtonPollType]() +## type [KeyboardButtonPollType]() -This object represents type of a poll, which is allowed to be created and sent when the corresponding button is pressed. +This object represents the type of a poll, which is allowed to be created and sent when the corresponding button is pressed. ```go type KeyboardButtonPollType struct { @@ -10258,9 +10941,9 @@ type KeyboardButtonPollType struct { ``` -## type [KeyboardButtonRequestChat]() +## type [KeyboardButtonRequestChat]() -This 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 chat if appropriate. More about requesting chats ». +This 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 the requested rights in the chat if appropriate. More about requesting chats ». ```go type KeyboardButtonRequestChat struct { @@ -10290,7 +10973,7 @@ type KeyboardButtonRequestChat struct { ``` -## type [KeyboardButtonRequestManagedBot]() +## type [KeyboardButtonRequestManagedBot]() This 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. @@ -10300,13 +10983,13 @@ type KeyboardButtonRequestManagedBot struct { RequestID int64 `json:"request_id"` // Optional. Suggested name for the bot SuggestedName string `json:"suggested_name,omitempty"` - // Optional. Suggested username for the bot + // Optional. Suggested username for the bot. The username must end with “bot”. If the user creating the bot has a Telegram Premium subscription, then the username can also end with “agent”, “ai”, “app”, “game”, or “gay”; in this case, the username will be assigned to the bot as a secondary username, and a regular username ending with “bot” will be assigned to the bot automatically. SuggestedUsername string `json:"suggested_username,omitempty"` } ``` -## type [KeyboardButtonRequestUsers]() +## type [KeyboardButtonRequestUsers]() This 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 » @@ -10330,7 +11013,7 @@ type KeyboardButtonRequestUsers struct { ``` -## type [KeyboardButtonStyle]() +## type [KeyboardButtonStyle]() @@ -10349,7 +11032,7 @@ const ( ``` -## type [LabeledPrice]() +## type [LabeledPrice]() This object represents a portion of the price for goods or services. @@ -10357,13 +11040,13 @@ This object represents a portion of the price for goods or services. type LabeledPrice struct { // Portion label Label string `json:"label"` - // Price of the product in the smallest units of the currency (integer, not float/double). For example, for a price of US$ 1.45 pass amount = 145. See the exp parameter in currencies.json, it shows the number of digits past the decimal point for each currency (2 for the majority of currencies). + // Price of the product in the smallest units of the currency (integer, not float/double). For example, for a price of US$ 1.45 pass amount = 145. See the exp parameter in currencies.json; it shows the number of digits past the decimal point for each currency (2 for the majority of currencies). Amount int64 `json:"amount"` } ``` -## type [LeaveChatParams]() +## type [LeaveChatParams]() LeaveChatParams is the parameter set for LeaveChat. @@ -10377,7 +11060,7 @@ type LeaveChatParams struct { ``` -## type [Link]() +## type [Link]() Represents an HTTP link. @@ -10389,7 +11072,7 @@ type Link struct { ``` -## type [LinkPreviewOptions]() +## type [LinkPreviewOptions]() Describes the options used for link preview generation. @@ -10409,7 +11092,7 @@ type LinkPreviewOptions struct { ``` -## type [LivePhoto]() +## type [LivePhoto]() This object represents a live photo. @@ -10417,9 +11100,9 @@ This object represents a live photo. type LivePhoto struct { // Optional. Available sizes of the corresponding static photo Photo []PhotoSize `json:"photo,omitempty"` - // Identifier for the video file which can be used to download or reuse the file + // Identifier for the video file, which can be used to download or reuse the file FileID string `json:"file_id"` - // Unique identifier for the video file which is supposed to be the same over time and for different bots. Can't be used to download or reuse the file. + // Unique identifier for the video file, which is supposed to be the same over time and for different bots. Can't be used to download or reuse the file. FileUniqueID string `json:"file_unique_id"` // Video width as defined by the sender Width int64 `json:"width"` @@ -10429,13 +11112,13 @@ type LivePhoto struct { Duration int64 `json:"duration"` // Optional. MIME type of the file as defined by the sender MimeType string `json:"mime_type,omitempty"` - // Optional. File size in bytes. It can be bigger than 2^31 and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a signed 64-bit integer or double-precision float type are safe for storing this value. + // Optional. File size in bytes. It can be bigger than 2^31 and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a signed 64-bit integer or double-precision float type is safe for storing this value. FileSize *int64 `json:"file_size,omitempty"` } ``` -## type [Location]() +## type [Location]() This object represents a point on the map. @@ -10449,7 +11132,7 @@ type Location struct { HorizontalAccuracy *float64 `json:"horizontal_accuracy,omitempty"` // Optional. Time relative to the message sending date, during which the location can be updated; in seconds. For active live locations only. LivePeriod *int64 `json:"live_period,omitempty"` - // Optional. The direction in which user is moving, in degrees; 1-360. For active live locations only. + // Optional. The direction in which the user is moving, in degrees; 1-360. For active live locations only. Heading *int64 `json:"heading,omitempty"` // Optional. The maximum distance for proximity alerts about approaching another chat member, in meters. For sent live locations only. ProximityAlertRadius *int64 `json:"proximity_alert_radius,omitempty"` @@ -10457,7 +11140,7 @@ type Location struct { ``` -## type [LocationAddress]() +## type [LocationAddress]() Describes the physical address of a location. @@ -10479,7 +11162,7 @@ type LocationAddress struct { LogOutParams is the parameter set for LogOut. -Use 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 successful call, you can immediately log in on a local server, but will not be able to log in back to the cloud Bot API server for 10 minutes. Returns True on success. Requires no parameters. +Use 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 successful call, you can immediately log in on a local server, but will not be able to log back in to the cloud Bot API server for 10 minutes. Returns True on success. Requires no parameters. ```go type LogOutParams struct { @@ -10487,7 +11170,7 @@ type LogOutParams struct { ``` -## type [LoginUrl]() +## type [LoginUrl]() This 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 needs to do is tap/click a button and confirm that they want to log in: Sample bot: @DiscussBot @@ -10505,7 +11188,7 @@ type LoginUrl struct { ``` -## type [ManagedBotCreated]() +## type [ManagedBotCreated]() This object contains information about the bot that was created to be managed by the current bot. @@ -10517,7 +11200,7 @@ type ManagedBotCreated struct { ``` -## type [ManagedBotUpdated]() +## type [ManagedBotUpdated]() This object contains information about the creation, token update, or owner update of a bot that is managed by the current bot. @@ -10525,13 +11208,13 @@ This object contains information about the creation, token update, or owner upda type ManagedBotUpdated struct { // User that created the bot User User `json:"user"` - // Information about the bot. Token of the bot can be fetched using the method getManagedBotToken. + // Information about the bot. The token of the bot can be fetched using the method getManagedBotToken. Bot User `json:"bot"` } ``` -## type [MaskPosition]() +## type [MaskPosition]() This object describes the position on faces where a mask should be placed by default. @@ -10539,7 +11222,7 @@ This object describes the position on faces where a mask should be placed by def type MaskPosition struct { // The part of the face relative to which the mask should be placed. One of “forehead”, “eyes”, “mouth”, or “chin”. Point MaskPositionPoint `json:"point"` - // Shift by X-axis measured in widths of the mask scaled to the face size, from left to right. For example, choosing -1.0 will place mask just to the left of the default mask position. + // Shift by X-axis measured in widths of the mask scaled to the face size, from left to right. For example, choosing -1.0 will place the mask just to the left of the default mask position. XShift float64 `json:"x_shift"` // Shift by Y-axis measured in heights of the mask scaled to the face size, from top to bottom. For example, 1.0 will place the mask just below the default mask position. YShift float64 `json:"y_shift"` @@ -10549,7 +11232,7 @@ type MaskPosition struct { ``` -## type [MaskPositionPoint]() +## type [MaskPositionPoint]() @@ -10569,7 +11252,7 @@ const ( ``` -## type [MaybeInaccessibleMessage]() +## type [MaybeInaccessibleMessage]() MaybeInaccessibleMessage is a union type. The following concrete variants implement it: @@ -10585,7 +11268,7 @@ type MaybeInaccessibleMessage interface { ``` -### func [UnmarshalMaybeInaccessibleMessage]() +### func [UnmarshalMaybeInaccessibleMessage]() ```go func UnmarshalMaybeInaccessibleMessage(data []byte) (MaybeInaccessibleMessage, error) @@ -10596,7 +11279,7 @@ UnmarshalMaybeInaccessibleMessage decodes a JSON object into the correct MaybeIn ## type [MeCache]() -MeCache caches the result of GetMe across calls. Construct one per Bot and call Get to retrieve the cached User on subsequent invocations. +MeCache caches the result of GetMe across calls. Construct one per Bot and call Get to retrieve the cached BotFullInfo on subsequent invocations. ``` var meCache api.MeCache @@ -10615,10 +11298,10 @@ type MeCache struct { ### func \(\*MeCache\) [Get]() ```go -func (c *MeCache) Get(ctx context.Context, b *client.Bot) (*User, error) +func (c *MeCache) Get(ctx context.Context, b *client.Bot) (*BotFullInfo, error) ``` -Get returns the User from a cached GetMe call. If the cache is empty, it calls GetMe and populates the cache on success. +Get returns the BotFullInfo from a cached GetMe call. If the cache is empty, it calls GetMe and populates the cache on success. ### func \(\*MeCache\) [Reset]() @@ -10630,7 +11313,7 @@ func (c *MeCache) Reset() Reset clears the cache. Useful in tests or after the bot's identity is known to have changed \(very rare\). -## type [MenuButton]() +## type [MenuButton]() MenuButton is a union type. The following concrete variants implement it: @@ -10647,7 +11330,7 @@ type MenuButton interface { ``` -### func [GetChatMenuButton]() +### func [GetChatMenuButton]() ```go func GetChatMenuButton(ctx context.Context, b *client.Bot, p *GetChatMenuButtonParams) (MenuButton, error) @@ -10658,7 +11341,7 @@ GetChatMenuButton calls the getChatMenuButton Telegram Bot API method. Use 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. -### func [UnmarshalMenuButton]() +### func [UnmarshalMenuButton]() ```go func UnmarshalMenuButton(data []byte) (MenuButton, error) @@ -10667,7 +11350,7 @@ func UnmarshalMenuButton(data []byte) (MenuButton, error) UnmarshalMenuButton decodes a MenuButton from JSON by inspecting the "type" field and dispatching to the correct concrete type. -## type [MenuButtonCommands]() +## type [MenuButtonCommands]() Represents a menu button, which opens the bot's list of commands. @@ -10679,7 +11362,7 @@ type MenuButtonCommands struct { ``` -### func \(\*MenuButtonCommands\) [MarshalJSON]() +### func \(\*MenuButtonCommands\) [MarshalJSON]() ```go func (v *MenuButtonCommands) MarshalJSON() ([]byte, error) @@ -10688,7 +11371,7 @@ func (v *MenuButtonCommands) MarshalJSON() ([]byte, error) MarshalJSON encodes MenuButtonCommands with the discriminator field "type" forced to "commands". The hardcoded value frees callers from setting Type by hand — any user\-supplied value on the struct literal is overridden so a typo can't slip through to Telegram. -## type [MenuButtonDefault]() +## type [MenuButtonDefault]() Describes that no specific value for the menu button was set. @@ -10700,7 +11383,7 @@ type MenuButtonDefault struct { ``` -### func \(\*MenuButtonDefault\) [MarshalJSON]() +### func \(\*MenuButtonDefault\) [MarshalJSON]() ```go func (v *MenuButtonDefault) MarshalJSON() ([]byte, error) @@ -10709,7 +11392,7 @@ func (v *MenuButtonDefault) MarshalJSON() ([]byte, error) MarshalJSON encodes MenuButtonDefault with the discriminator field "type" forced to "default". The hardcoded value frees callers from setting Type by hand — any user\-supplied value on the struct literal is overridden so a typo can't slip through to Telegram. -## type [MenuButtonType]() +## type [MenuButtonType]() @@ -10728,7 +11411,7 @@ const ( ``` -## type [MenuButtonWebApp]() +## type [MenuButtonWebApp]() Represents a menu button, which launches a Web App. @@ -10744,7 +11427,7 @@ type MenuButtonWebApp struct { ``` -### func \(\*MenuButtonWebApp\) [MarshalJSON]() +### func \(\*MenuButtonWebApp\) [MarshalJSON]() ```go func (v *MenuButtonWebApp) MarshalJSON() ([]byte, error) @@ -10753,7 +11436,7 @@ func (v *MenuButtonWebApp) MarshalJSON() ([]byte, error) MarshalJSON encodes MenuButtonWebApp with the discriminator field "type" forced to "web\_app". The hardcoded value frees callers from setting Type by hand — any user\-supplied value on the struct literal is overridden so a typo can't slip through to Telegram. -## type [Message]() +## type [Message]() This object represents a message. @@ -10859,11 +11542,13 @@ type Message struct { VideoNote *VideoNote `json:"video_note,omitempty"` // Optional. Message is a voice message, information about the file Voice *Voice `json:"voice,omitempty"` - // Optional. Caption for the animation, audio, document, paid media, photo, video or voice + // Optional. Message is an HTML widget, information about the widget + Widget *Widget `json:"widget,omitempty"` + // Optional. Caption for the animation, audio, document, live photo, paid media, photo, video, voice, or widget Caption string `json:"caption,omitempty"` // Optional. For messages with a caption, special entities like usernames, URLs, bot commands, etc. that appear in the caption CaptionEntities []MessageEntity `json:"caption_entities,omitempty"` - // Optional. True, if the caption must be shown above the message media + // Optional. True, if the caption must be shown above the message media or the widget ShowCaptionAboveMedia *bool `json:"show_caption_above_media,omitempty"` // Optional. True, if the message media is covered by a spoiler animation HasMediaSpoiler *bool `json:"has_media_spoiler,omitempty"` @@ -10891,21 +11576,21 @@ type Message struct { ChatOwnerChanged *ChatOwnerChanged `json:"chat_owner_changed,omitempty"` // Optional. A chat title was changed to this value NewChatTitle string `json:"new_chat_title,omitempty"` - // Optional. A chat photo was change to this value + // Optional. A chat photo was changed to this value NewChatPhoto []PhotoSize `json:"new_chat_photo,omitempty"` // Optional. Service message: the chat photo was deleted DeleteChatPhoto *bool `json:"delete_chat_photo,omitempty"` // Optional. Service message: the group has been created GroupChatCreated *bool `json:"group_chat_created,omitempty"` - // Optional. Service message: the supergroup has been created. This field can't be received in a message coming through updates, because bot can't be a member of a supergroup when it is created. It can only be found in reply_to_message if someone replies to a very first message in a directly created supergroup. + // Optional. Service message: the supergroup has been created. This field can't be received in a message coming through updates, because a bot can't be a member of a supergroup when it is created. It can only be found in reply_to_message if someone replies to the very first message in a directly created supergroup. SupergroupChatCreated *bool `json:"supergroup_chat_created,omitempty"` - // Optional. Service message: the channel has been created. This field can't be received in a message coming through updates, because bot can't be a member of a channel when it is created. It can only be found in reply_to_message if someone replies to a very first message in a channel. + // Optional. Service message: the channel has been created. This field can't be received in a message coming through updates, because a bot can't be a member of a channel when it is created. It can only be found in reply_to_message if someone replies to the very first message in a channel. ChannelChatCreated *bool `json:"channel_chat_created,omitempty"` // Optional. Service message: auto-delete timer settings changed in the chat MessageAutoDeleteTimerChanged *MessageAutoDeleteTimerChanged `json:"message_auto_delete_timer_changed,omitempty"` - // Optional. The group has been migrated to a supergroup with the specified identifier. This number may have more than 32 significant bits and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a signed 64-bit integer or double-precision float type are safe for storing this identifier. + // Optional. The group has been migrated to a supergroup with the specified identifier. This number may have more than 32 significant bits and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a signed 64-bit integer or double-precision float type is safe for storing this identifier. MigrateToChatID *int64 `json:"migrate_to_chat_id,omitempty"` - // Optional. The supergroup has been migrated from a group with the specified identifier. This number may have more than 32 significant bits and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a signed 64-bit integer or double-precision float type are safe for storing this identifier. + // Optional. The supergroup has been migrated from a group with the specified identifier. This number may have more than 32 significant bits and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a signed 64-bit integer or double-precision float type is safe for storing this identifier. MigrateFromChatID *int64 `json:"migrate_from_chat_id,omitempty"` // Optional. Specified message was pinned. Note that the Message object in this field will not contain further reply_to_message fields even if it itself is a reply. PinnedMessage MaybeInaccessibleMessage `json:"pinned_message,omitempty"` @@ -10927,7 +11612,7 @@ type Message struct { GiftUpgradeSent *GiftInfo `json:"gift_upgrade_sent,omitempty"` // Optional. The domain name of the website on which the user has logged in. More about Telegram Login » ConnectedWebsite string `json:"connected_website,omitempty"` - // Optional. Service message: the user allowed the bot to write messages after adding it to the attachment or side menu, launching a Web App from a link, or accepting an explicit request from a Web App sent by the method requestWriteAccess + // Optional. Service message: the user allowed the bot to write messages after adding it to the attachment or side menu, launching a Web App from a link, or accepting an explicit request from a Web App sent by the method requestWriteAccess, or the user was invited to the private chat with the bot by the owner of the bot WriteAccessAllowed *WriteAccessAllowed `json:"write_access_allowed,omitempty"` // Optional. Telegram Passport data PassportData *PassportData `json:"passport_data,omitempty"` @@ -10973,6 +11658,8 @@ type Message struct { ManagedBotCreated *ManagedBotCreated `json:"managed_bot_created,omitempty"` // Optional. Service message: the price for paid messages has changed in the chat PaidMessagePriceChanged *PaidMessagePriceChanged `json:"paid_message_price_changed,omitempty"` + // Optional. Service message: the sender of the message used a link of the other user, which allows sending messages to the user without paying Telegram Stars + PaidMessagesWaived *PaidMessagesWaived `json:"paid_messages_waived,omitempty"` // Optional. Service message: answer option was added to a poll PollOptionAdded *PollOptionAdded `json:"poll_option_added,omitempty"` // Optional. Service message: answer option was deleted from a poll @@ -10987,6 +11674,8 @@ type Message struct { SuggestedPostPaid *SuggestedPostPaid `json:"suggested_post_paid,omitempty"` // Optional. Service message: payment for a suggested post was refunded SuggestedPostRefunded *SuggestedPostRefunded `json:"suggested_post_refunded,omitempty"` + // Optional. Service message: a transfer with a TON wallet + TonWalletTransfer *TonWalletTransfer `json:"ton_wallet_transfer,omitempty"` // Optional. Service message: video chat scheduled VideoChatScheduled *VideoChatScheduled `json:"video_chat_scheduled,omitempty"` // Optional. Service message: video chat started @@ -11003,7 +11692,7 @@ type Message struct { ``` -### func [EditMessageChecklist]() +### func [EditMessageChecklist]() ```go func EditMessageChecklist(ctx context.Context, b *client.Bot, p *EditMessageChecklistParams) (*Message, error) @@ -11025,7 +11714,7 @@ ForwardMessage calls the forwardMessage Telegram Bot API method. Use 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. -### func [GetUserPersonalChatMessages]() +### func [GetUserPersonalChatMessages]() ```go func GetUserPersonalChatMessages(ctx context.Context, b *client.Bot, p *GetUserPersonalChatMessagesParams) ([]Message, error) @@ -11036,7 +11725,7 @@ GetUserPersonalChatMessages calls the getUserPersonalChatMessages Telegram Bot A 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. On success, an Array of Message objects is returned. -### func [SendAnimation]() +### func [SendAnimation]() ```go func SendAnimation(ctx context.Context, b *client.Bot, p *SendAnimationParams) (*Message, error) @@ -11044,10 +11733,10 @@ func SendAnimation(ctx context.Context, b *client.Bot, p *SendAnimationParams) ( SendAnimation calls the sendAnimation Telegram Bot API method. -Use 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 in the future. +Use 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 in the future. -### func [SendAudio]() +### func [SendAudio]() ```go func SendAudio(ctx context.Context, b *client.Bot, p *SendAudioParams) (*Message, error) @@ -11055,10 +11744,10 @@ func SendAudio(ctx context.Context, b *client.Bot, p *SendAudioParams) (*Message SendAudio calls the sendAudio Telegram Bot API method. -Use 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 audio files of up to 50 MB in size, this limit may be changed in the future. For sending voice messages, use the sendVoice method instead. +Use 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 audio files of up to 50 MB in size; this limit may be changed in the future. For sending voice messages, use the sendVoice method instead. -### func [SendChecklist]() +### func [SendChecklist]() ```go func SendChecklist(ctx context.Context, b *client.Bot, p *SendChecklistParams) (*Message, error) @@ -11069,7 +11758,7 @@ SendChecklist calls the sendChecklist Telegram Bot API method. Use this method to send a checklist on behalf of a connected business account. On success, the sent Message is returned. -### func [SendContact]() +### func [SendContact]() ```go func SendContact(ctx context.Context, b *client.Bot, p *SendContactParams) (*Message, error) @@ -11080,7 +11769,7 @@ SendContact calls the sendContact Telegram Bot API method. Use this method to send phone contacts. On success, the sent Message is returned. -### func [SendDice]() +### func [SendDice]() ```go func SendDice(ctx context.Context, b *client.Bot, p *SendDiceParams) (*Message, error) @@ -11091,7 +11780,7 @@ SendDice calls the sendDice Telegram Bot API method. Use this method to send an animated emoji that will display a random value. On success, the sent Message is returned. -### func [SendDocument]() +### func [SendDocument]() ```go func SendDocument(ctx context.Context, b *client.Bot, p *SendDocumentParams) (*Message, error) @@ -11099,10 +11788,10 @@ func SendDocument(ctx context.Context, b *client.Bot, p *SendDocumentParams) (*M SendDocument calls the sendDocument Telegram Bot API method. -Use 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. +Use 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. -### func [SendGame]() +### func [SendGame]() ```go func SendGame(ctx context.Context, b *client.Bot, p *SendGameParams) (*Message, error) @@ -11113,7 +11802,7 @@ SendGame calls the sendGame Telegram Bot API method. Use this method to send a game. On success, the sent Message is returned. -### func [SendInvoice]() +### func [SendInvoice]() ```go func SendInvoice(ctx context.Context, b *client.Bot, p *SendInvoiceParams) (*Message, error) @@ -11124,7 +11813,7 @@ SendInvoice calls the sendInvoice Telegram Bot API method. Use this method to send invoices. On success, the sent Message is returned. -### func [SendLivePhoto]() +### func [SendLivePhoto]() ```go func SendLivePhoto(ctx context.Context, b *client.Bot, p *SendLivePhotoParams) (*Message, error) @@ -11135,7 +11824,7 @@ SendLivePhoto calls the sendLivePhoto Telegram Bot API method. Use this method to send live photos. On success, the sent Message is returned. -### func [SendLocation]() +### func [SendLocation]() ```go func SendLocation(ctx context.Context, b *client.Bot, p *SendLocationParams) (*Message, error) @@ -11143,10 +11832,10 @@ func SendLocation(ctx context.Context, b *client.Bot, p *SendLocationParams) (*M SendLocation calls the sendLocation Telegram Bot API method. -Use this method to send point on the map. On success, the sent Message is returned. +Use this method to send a point on the map. On success, the sent Message is returned. -### func [SendMediaGroup]() +### func [SendMediaGroup]() ```go func SendMediaGroup(ctx context.Context, b *client.Bot, p *SendMediaGroupParams) ([]Message, error) @@ -11154,7 +11843,7 @@ func SendMediaGroup(ctx context.Context, b *client.Bot, p *SendMediaGroupParams) SendMediaGroup calls the sendMediaGroup Telegram Bot API method. -Use 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 objects that were sent is returned. +Use this method to send a group of photos, live photos, videos, documents or audios as an album. Documents and audio files can only be grouped in an album with messages of the same type. On success, an Array of Message objects that were sent is returned. ### func [SendMessage]() @@ -11168,7 +11857,7 @@ SendMessage calls the sendMessage Telegram Bot API method. Use this method to send text messages. On success, the sent Message is returned. -### func [SendPaidMedia]() +### func [SendPaidMedia]() ```go func SendPaidMedia(ctx context.Context, b *client.Bot, p *SendPaidMediaParams) (*Message, error) @@ -11179,7 +11868,7 @@ SendPaidMedia calls the sendPaidMedia Telegram Bot API method. Use this method to send paid media. On success, the sent Message is returned. -### func [SendPhoto]() +### func [SendPhoto]() ```go func SendPhoto(ctx context.Context, b *client.Bot, p *SendPhotoParams) (*Message, error) @@ -11190,7 +11879,7 @@ SendPhoto calls the sendPhoto Telegram Bot API method. Use this method to send photos. On success, the sent Message is returned. -### func [SendPoll]() +### func [SendPoll]() ```go func SendPoll(ctx context.Context, b *client.Bot, p *SendPollParams) (*Message, error) @@ -11201,7 +11890,7 @@ SendPoll calls the sendPoll Telegram Bot API method. Use this method to send a native poll. On success, the sent Message is returned. -### func [SendRichMessage]() +### func [SendRichMessage]() ```go func SendRichMessage(ctx context.Context, b *client.Bot, p *SendRichMessageParams) (*Message, error) @@ -11211,8 +11900,19 @@ SendRichMessage calls the sendRichMessage Telegram Bot API method. Use 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. + +### func [SendSharedWidget]() + +```go +func SendSharedWidget(ctx context.Context, b *client.Bot, p *SendSharedWidgetParams) (*Message, error) +``` + +SendSharedWidget calls the sendSharedWidget Telegram Bot API method. + +Use this method to resend 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 can't be forwarded. On success, the sent Message is returned. + -### func [SendSticker]() +### func [SendSticker]() ```go func SendSticker(ctx context.Context, b *client.Bot, p *SendStickerParams) (*Message, error) @@ -11223,7 +11923,7 @@ SendSticker calls the sendSticker Telegram Bot API method. Use this method to send static .WEBP, animated .TGS, or video .WEBM stickers. On success, the sent Message is returned. -### func [SendVenue]() +### func [SendVenue]() ```go func SendVenue(ctx context.Context, b *client.Bot, p *SendVenueParams) (*Message, error) @@ -11234,7 +11934,7 @@ SendVenue calls the sendVenue Telegram Bot API method. Use this method to send information about a venue. On success, the sent Message is returned. -### func [SendVideo]() +### func [SendVideo]() ```go func SendVideo(ctx context.Context, b *client.Bot, p *SendVideoParams) (*Message, error) @@ -11242,10 +11942,10 @@ func SendVideo(ctx context.Context, b *client.Bot, p *SendVideoParams) (*Message SendVideo calls the sendVideo Telegram Bot API method. -Use 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, this limit may be changed in the future. +Use 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; this limit may be changed in the future. -### func [SendVideoNote]() +### func [SendVideoNote]() ```go func SendVideoNote(ctx context.Context, b *client.Bot, p *SendVideoNoteParams) (*Message, error) @@ -11253,10 +11953,10 @@ func SendVideoNote(ctx context.Context, b *client.Bot, p *SendVideoNoteParams) ( SendVideoNote calls the sendVideoNote Telegram Bot API method. -Use this method to send a rounded square MPEG4 video of up to 1 minute long. On success, the sent Message is returned. +Use this method to send a rounded square MPEG4 video up to 1 minute long. On success, the sent Message is returned. -### func [SendVoice]() +### func [SendVoice]() ```go func SendVoice(ctx context.Context, b *client.Bot, p *SendVoiceParams) (*Message, error) @@ -11264,7 +11964,18 @@ func SendVoice(ctx context.Context, b *client.Bot, p *SendVoiceParams) (*Message SendVoice calls the sendVoice Telegram Bot API method. -Use 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 format \(other formats may be sent as Audio or Document\). On success, the sent Message is returned. Bots can currently send voice messages of up to 50 MB in size, this limit may be changed in the future. +Use 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 format \(other formats may be sent as Audio or Document\). On success, the sent Message is returned. Bots can currently send voice messages of up to 50 MB in size; this limit may be changed in the future. + + +### func [SendWidget]() + +```go +func SendWidget(ctx context.Context, b *client.Bot, p *SendWidgetParams) (*Message, error) +``` + +SendWidget calls the sendWidget Telegram Bot API method. + +Use 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 forwarded. On success, the sent Message is returned. ### func \(\*Message\) [GetSender]() @@ -11276,7 +11987,7 @@ func (m *Message) GetSender() *Sender GetSender constructs a Sender for a Message. The result is never nil. -### func \(\*Message\) [UnmarshalJSON]() +### func \(\*Message\) [UnmarshalJSON]() ```go func (m *Message) UnmarshalJSON(data []byte) error @@ -11285,7 +11996,7 @@ func (m *Message) UnmarshalJSON(data []byte) error UnmarshalJSON decodes Message by dispatching union\-typed fields \(ForwardOrigin, PinnedMessage\) through their concrete UnmarshalXxx helpers. -## type [MessageAutoDeleteTimerChanged]() +## type [MessageAutoDeleteTimerChanged]() This object represents a service message about a change in auto\-delete timer settings. @@ -11297,19 +12008,19 @@ type MessageAutoDeleteTimerChanged struct { ``` -## type [MessageEntity]() +## type [MessageEntity]() This object represents one special entity in a text message. For example, hashtags, usernames, URLs, etc. ```go type MessageEntity struct { - // Type of the entity. Currently, can be “mention” (@username), “hashtag” (#hashtag or #hashtag@chatusername), “cashtag” ($USD or $USD@chatusername), “bot_command” (/start@jobs_bot), “url” (https://telegram.org), “email” (do-not-reply@telegram.org), “phone_number” (+1-212-555-0123), “bold” (bold text), “italic” (italic text), “underline” (underlined text), “strikethrough” (strikethrough text), “spoiler” (spoiler message), “blockquote” (block quotation), “expandable_blockquote” (collapsed-by-default block quotation), “code” (monowidth string), “pre” (monowidth block), “text_link” (for clickable text URLs), “text_mention” (for users without usernames), “custom_emoji” (for inline custom emoji stickers), or “date_time” (for formatted date and time). + // Type of the entity. Currently, can be “mention” (@username), “hashtag” (#hashtag or #hashtag@chatusername), “cashtag” ($USD or $USD@chatusername), “bot_command” (/start@jobs_bot), “url” (https://telegram.org), “email” (do-not-reply@telegram.org), “phone_number” (+1-212-555-0123), “bank_card_number” (bank card number), “ton_address” (address in the TON blockchain), “bold” (bold text), “italic” (italic text), “underline” (underlined text), “strikethrough” (strikethrough text), “spoiler” (spoiler message), “blockquote” (block quotation), “expandable_blockquote” (collapsed-by-default block quotation), “code” (monowidth string), “pre” (monowidth block), “text_link” (for clickable text URLs), “text_mention” (for users without usernames), “custom_emoji” (for inline custom emoji stickers), or “date_time” (for formatted date and time). Type MessageEntityType `json:"type"` // Offset in UTF-16 code units to the start of the entity Offset int64 `json:"offset"` // Length of the entity in UTF-16 code units Length int64 `json:"length"` - // Optional. For “text_link” only, URL that will be opened after user taps on the text + // Optional. For “text_link” only, URL that will be opened after the user taps on the text URL string `json:"url,omitempty"` // Optional. For “text_mention” only, the mentioned user User *User `json:"user,omitempty"` @@ -11325,7 +12036,7 @@ type MessageEntity struct { ``` -## type [MessageEntityType]() +## type [MessageEntityType]() @@ -11344,6 +12055,8 @@ const ( MessageEntityTypeURL MessageEntityType = "url" MessageEntityTypeEmail MessageEntityType = "email" MessageEntityTypePhoneNumber MessageEntityType = "phone_number" + MessageEntityTypeBankCardNumber MessageEntityType = "bank_card_number" + MessageEntityTypeTonAddress MessageEntityType = "ton_address" MessageEntityTypeBold MessageEntityType = "bold" MessageEntityTypeItalic MessageEntityType = "italic" MessageEntityTypeUnderline MessageEntityType = "underline" @@ -11361,7 +12074,7 @@ const ( ``` -## type [MessageGenerationStopped]() +## type [MessageGenerationStopped]() This object describes an update about a user stopping message generation. @@ -11377,13 +12090,13 @@ type MessageGenerationStopped struct { ``` -## type [MessageId]() +## type [MessageId]() This object represents a unique message identifier. ```go type MessageId struct { - // Unique message identifier. In specific instances (e.g., message containing a video sent to a big chat), the server might automatically schedule a message instead of sending it immediately. In such cases, this field will be 0 and the relevant message will be unusable until it is actually sent. + // Unique message identifier. In specific instances (e.g., a message containing a video sent to a big chat), the server might automatically schedule a message instead of sending it immediately. In such cases, this field will be 0 and the relevant message will be unusable until it is actually sent. MessageID int64 `json:"message_id"` } ``` @@ -11397,7 +12110,7 @@ func CopyMessage(ctx context.Context, b *client.Bot, p *CopyMessageParams) (*Mes CopyMessage calls the copyMessage Telegram Bot API method. -Use this method to copy messages of any kind. Service messages, paid media messages, giveaway messages, giveaway winners messages, and invoice messages can't be copied. A quiz poll can be copied only if the value of the field correct\_option\_ids is known to the bot. The method is analogous to the method forwardMessage, but the copied message doesn't have a link to the original message. Returns the MessageId of the sent message on success. +Use 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 the value of the field correct\_option\_ids is known to the bot. The method is analogous to the method forwardMessage, but the copied message doesn't have a link to the original message. Returns the MessageId of the sent message on success. ### func [CopyMessages]() @@ -11408,7 +12121,7 @@ func CopyMessages(ctx context.Context, b *client.Bot, p *CopyMessagesParams) ([] CopyMessages calls the copyMessages Telegram Bot API method. -Use 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, and invoice messages can't be copied. A quiz poll can be copied only if the value of the field correct\_option\_ids is known to the bot. The method is analogous to the method forwardMessages, but the copied messages don't have a link to the original message. Album grouping is kept for copied messages. On success, an Array of MessageId of the sent messages is returned. +Use 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 messages, and widget messages can't be copied. A quiz poll can be copied only if the value of the field correct\_option\_ids is known to the bot. The method is analogous to the method forwardMessages, but the copied messages don't have a link to the original message. Album grouping is kept for copied messages. On success, an Array of MessageId of the sent messages is returned. ### func [ForwardMessages]() @@ -11433,83 +12146,6 @@ type MessageOrBool struct { } ``` - -### func [EditMessageCaption]() - -```go -func EditMessageCaption(ctx context.Context, b *client.Bot, p *EditMessageCaptionParams) (*MessageOrBool, error) -``` - -EditMessageCaption calls the editMessageCaption Telegram Bot API method. - -Use 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 bot and do not contain an inline keyboard can only be edited within 48 hours from the time they were sent. - - -### func [EditMessageLiveLocation]() - -```go -func EditMessageLiveLocation(ctx context.Context, b *client.Bot, p *EditMessageLiveLocationParams) (*MessageOrBool, error) -``` - -EditMessageLiveLocation calls the editMessageLiveLocation Telegram Bot API method. - -Use 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 inline message, the edited Message is returned, otherwise True is returned. - - -### func [EditMessageMedia]() - -```go -func EditMessageMedia(ctx context.Context, b *client.Bot, p *EditMessageMediaParams) (*MessageOrBool, error) -``` - -EditMessageMedia calls the editMessageMedia Telegram Bot API method. - -Use 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 audio for audio albums, only to a document for document albums and to a photo, a live photo, or a video otherwise. When an inline message is edited, a new file can't be uploaded; use a previously uploaded file via its file\_id or specify a URL. 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 bot and do not contain an inline keyboard can only be edited within 48 hours from the time they were sent. - - -### func [EditMessageReplyMarkup]() - -```go -func EditMessageReplyMarkup(ctx context.Context, b *client.Bot, p *EditMessageReplyMarkupParams) (*MessageOrBool, error) -``` - -EditMessageReplyMarkup calls the editMessageReplyMarkup Telegram Bot API method. - -Use 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 not sent by the bot and do not contain an inline keyboard can only be edited within 48 hours from the time they were sent. - - -### func [EditMessageText]() - -```go -func EditMessageText(ctx context.Context, b *client.Bot, p *EditMessageTextParams) (*MessageOrBool, error) -``` - -EditMessageText calls the editMessageText Telegram Bot API method. - -Use 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 sent by the bot and do not contain an inline keyboard can only be edited within 48 hours from the time they were sent. - - -### func [SetGameScore]() - -```go -func SetGameScore(ctx context.Context, b *client.Bot, p *SetGameScoreParams) (*MessageOrBool, error) -``` - -SetGameScore calls the setGameScore Telegram Bot API method. - -Use 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 not greater than the user's current score in the chat and force is False. - - -### func [StopMessageLiveLocation]() - -```go -func StopMessageLiveLocation(ctx context.Context, b *client.Bot, p *StopMessageLiveLocationParams) (*MessageOrBool, error) -``` - -StopMessageLiveLocation calls the stopMessageLiveLocation Telegram Bot API method. - -Use 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. - ### func \(\*MessageOrBool\) [UnmarshalJSON]() @@ -11520,7 +12156,7 @@ func (m *MessageOrBool) UnmarshalJSON(data []byte) error UnmarshalJSON decodes either \{...\} into Message or \`true\`/\`false\` into OK. -## type [MessageOrigin]() +## type [MessageOrigin]() MessageOrigin is a union type. The following concrete variants implement it: @@ -11538,7 +12174,7 @@ type MessageOrigin interface { ``` -### func [UnmarshalMessageOrigin]() +### func [UnmarshalMessageOrigin]() ```go func UnmarshalMessageOrigin(data []byte) (MessageOrigin, error) @@ -11547,7 +12183,7 @@ func UnmarshalMessageOrigin(data []byte) (MessageOrigin, error) UnmarshalMessageOrigin decodes a MessageOrigin from JSON by inspecting the "type" field and dispatching to the correct concrete type. -## type [MessageOriginChannel]() +## type [MessageOriginChannel]() The message was originally sent to a channel chat. @@ -11567,7 +12203,7 @@ type MessageOriginChannel struct { ``` -### func \(\*MessageOriginChannel\) [MarshalJSON]() +### func \(\*MessageOriginChannel\) [MarshalJSON]() ```go func (v *MessageOriginChannel) MarshalJSON() ([]byte, error) @@ -11576,7 +12212,7 @@ func (v *MessageOriginChannel) MarshalJSON() ([]byte, error) MarshalJSON encodes MessageOriginChannel with the discriminator field "type" forced to "channel". The hardcoded value frees callers from setting Type by hand — any user\-supplied value on the struct literal is overridden so a typo can't slip through to Telegram. -## type [MessageOriginChat]() +## type [MessageOriginChat]() The message was originally sent on behalf of a chat to a group chat. @@ -11594,7 +12230,7 @@ type MessageOriginChat struct { ``` -### func \(\*MessageOriginChat\) [MarshalJSON]() +### func \(\*MessageOriginChat\) [MarshalJSON]() ```go func (v *MessageOriginChat) MarshalJSON() ([]byte, error) @@ -11603,7 +12239,7 @@ func (v *MessageOriginChat) MarshalJSON() ([]byte, error) MarshalJSON encodes MessageOriginChat with the discriminator field "type" forced to "chat". The hardcoded value frees callers from setting Type by hand — any user\-supplied value on the struct literal is overridden so a typo can't slip through to Telegram. -## type [MessageOriginHiddenUser]() +## type [MessageOriginHiddenUser]() The message was originally sent by an unknown user. @@ -11619,7 +12255,7 @@ type MessageOriginHiddenUser struct { ``` -### func \(\*MessageOriginHiddenUser\) [MarshalJSON]() +### func \(\*MessageOriginHiddenUser\) [MarshalJSON]() ```go func (v *MessageOriginHiddenUser) MarshalJSON() ([]byte, error) @@ -11628,7 +12264,7 @@ func (v *MessageOriginHiddenUser) MarshalJSON() ([]byte, error) MarshalJSON encodes MessageOriginHiddenUser with the discriminator field "type" forced to "hidden\_user". The hardcoded value frees callers from setting Type by hand — any user\-supplied value on the struct literal is overridden so a typo can't slip through to Telegram. -## type [MessageOriginType]() +## type [MessageOriginType]() @@ -11648,7 +12284,7 @@ const ( ``` -## type [MessageOriginUser]() +## type [MessageOriginUser]() The message was originally sent by a known user. @@ -11664,7 +12300,7 @@ type MessageOriginUser struct { ``` -### func \(\*MessageOriginUser\) [MarshalJSON]() +### func \(\*MessageOriginUser\) [MarshalJSON]() ```go func (v *MessageOriginUser) MarshalJSON() ([]byte, error) @@ -11673,7 +12309,7 @@ func (v *MessageOriginUser) MarshalJSON() ([]byte, error) MarshalJSON encodes MessageOriginUser with the discriminator field "type" forced to "user". The hardcoded value frees callers from setting Type by hand — any user\-supplied value on the struct literal is overridden so a typo can't slip through to Telegram. -## type [MessageReactionCountUpdated]() +## type [MessageReactionCountUpdated]() This object represents reaction changes on a message with anonymous reactions. @@ -11691,7 +12327,7 @@ type MessageReactionCountUpdated struct { ``` -## type [MessageReactionUpdated]() +## type [MessageReactionUpdated]() This object represents a change of a reaction on a message performed by a user. @@ -11724,7 +12360,7 @@ func (mru *MessageReactionUpdated) GetSender() *Sender GetSender constructs a Sender for a MessageReactionUpdated. -### func \(\*MessageReactionUpdated\) [UnmarshalJSON]() +### func \(\*MessageReactionUpdated\) [UnmarshalJSON]() ```go func (m *MessageReactionUpdated) UnmarshalJSON(data []byte) error @@ -11733,7 +12369,7 @@ func (m *MessageReactionUpdated) UnmarshalJSON(data []byte) error UnmarshalJSON decodes MessageReactionUpdated by dispatching union\-typed fields \(OldReaction, NewReaction\) through their concrete UnmarshalXxx helpers. -## type [OrderInfo]() +## type [OrderInfo]() This object represents information about an order. @@ -11751,7 +12387,7 @@ type OrderInfo struct { ``` -## type [OwnedGift]() +## type [OwnedGift]() OwnedGift is a union type. The following concrete variants implement it: @@ -11767,7 +12403,7 @@ type OwnedGift interface { ``` -### func [UnmarshalOwnedGift]() +### func [UnmarshalOwnedGift]() ```go func UnmarshalOwnedGift(data []byte) (OwnedGift, error) @@ -11776,7 +12412,7 @@ func UnmarshalOwnedGift(data []byte) (OwnedGift, error) UnmarshalOwnedGift decodes a OwnedGift from JSON by inspecting the "type" field and dispatching to the correct concrete type. -## type [OwnedGiftRegular]() +## type [OwnedGiftRegular]() Describes a regular gift owned by a user or a chat. @@ -11816,7 +12452,7 @@ type OwnedGiftRegular struct { ``` -### func \(\*OwnedGiftRegular\) [MarshalJSON]() +### func \(\*OwnedGiftRegular\) [MarshalJSON]() ```go func (v *OwnedGiftRegular) MarshalJSON() ([]byte, error) @@ -11825,7 +12461,7 @@ func (v *OwnedGiftRegular) MarshalJSON() ([]byte, error) MarshalJSON encodes OwnedGiftRegular with the discriminator field "type" forced to "regular". The hardcoded value frees callers from setting Type by hand — any user\-supplied value on the struct literal is overridden so a typo can't slip through to Telegram. -## type [OwnedGiftType]() +## type [OwnedGiftType]() @@ -11843,7 +12479,7 @@ const ( ``` -## type [OwnedGiftUnique]() +## type [OwnedGiftUnique]() Describes a unique gift received and owned by a user or a chat. @@ -11871,7 +12507,7 @@ type OwnedGiftUnique struct { ``` -### func \(\*OwnedGiftUnique\) [MarshalJSON]() +### func \(\*OwnedGiftUnique\) [MarshalJSON]() ```go func (v *OwnedGiftUnique) MarshalJSON() ([]byte, error) @@ -11880,7 +12516,7 @@ func (v *OwnedGiftUnique) MarshalJSON() ([]byte, error) MarshalJSON encodes OwnedGiftUnique with the discriminator field "type" forced to "unique". The hardcoded value frees callers from setting Type by hand — any user\-supplied value on the struct literal is overridden so a typo can't slip through to Telegram. -## type [OwnedGifts]() +## type [OwnedGifts]() Contains the list of gifts received and owned by a user or a chat. @@ -11896,7 +12532,7 @@ type OwnedGifts struct { ``` -### func [GetBusinessAccountGifts]() +### func [GetBusinessAccountGifts]() ```go func GetBusinessAccountGifts(ctx context.Context, b *client.Bot, p *GetBusinessAccountGiftsParams) (*OwnedGifts, error) @@ -11907,7 +12543,7 @@ GetBusinessAccountGifts calls the getBusinessAccountGifts Telegram Bot API metho Returns the gifts received and owned by a managed business account. Requires the can\_view\_gifts\_and\_stars business bot right. Returns OwnedGifts on success. -### func [GetChatGifts]() +### func [GetChatGifts]() ```go func GetChatGifts(ctx context.Context, b *client.Bot, p *GetChatGiftsParams) (*OwnedGifts, error) @@ -11918,7 +12554,7 @@ GetChatGifts calls the getChatGifts Telegram Bot API method. Returns the gifts owned by a chat. Returns OwnedGifts on success. -### func [GetUserGifts]() +### func [GetUserGifts]() ```go func GetUserGifts(ctx context.Context, b *client.Bot, p *GetUserGiftsParams) (*OwnedGifts, error) @@ -11929,7 +12565,7 @@ GetUserGifts calls the getUserGifts Telegram Bot API method. Returns the gifts owned and hosted by a user. Returns OwnedGifts on success. -### func \(\*OwnedGifts\) [UnmarshalJSON]() +### func \(\*OwnedGifts\) [UnmarshalJSON]() ```go func (m *OwnedGifts) UnmarshalJSON(data []byte) error @@ -11938,7 +12574,7 @@ func (m *OwnedGifts) UnmarshalJSON(data []byte) error UnmarshalJSON decodes OwnedGifts by dispatching union\-typed fields \(Gifts\) through their concrete UnmarshalXxx helpers. -## type [PaidMedia]() +## type [PaidMedia]() PaidMedia is a union type. The following concrete variants implement it: @@ -11956,7 +12592,7 @@ type PaidMedia interface { ``` -### func [UnmarshalPaidMedia]() +### func [UnmarshalPaidMedia]() ```go func UnmarshalPaidMedia(data []byte) (PaidMedia, error) @@ -11965,7 +12601,7 @@ func UnmarshalPaidMedia(data []byte) (PaidMedia, error) UnmarshalPaidMedia decodes a PaidMedia from JSON by inspecting the "type" field and dispatching to the correct concrete type. -## type [PaidMediaInfo]() +## type [PaidMediaInfo]() Describes the paid media added to a message. @@ -11979,7 +12615,7 @@ type PaidMediaInfo struct { ``` -### func \(\*PaidMediaInfo\) [UnmarshalJSON]() +### func \(\*PaidMediaInfo\) [UnmarshalJSON]() ```go func (m *PaidMediaInfo) UnmarshalJSON(data []byte) error @@ -11988,7 +12624,7 @@ func (m *PaidMediaInfo) UnmarshalJSON(data []byte) error UnmarshalJSON decodes PaidMediaInfo by dispatching union\-typed fields \(PaidMedia\) through their concrete UnmarshalXxx helpers. -## type [PaidMediaLivePhoto]() +## type [PaidMediaLivePhoto]() The paid media is a live photo. @@ -12002,7 +12638,7 @@ type PaidMediaLivePhoto struct { ``` -### func \(\*PaidMediaLivePhoto\) [MarshalJSON]() +### func \(\*PaidMediaLivePhoto\) [MarshalJSON]() ```go func (v *PaidMediaLivePhoto) MarshalJSON() ([]byte, error) @@ -12011,7 +12647,7 @@ func (v *PaidMediaLivePhoto) MarshalJSON() ([]byte, error) MarshalJSON encodes PaidMediaLivePhoto with the discriminator field "type" forced to "live\_photo". The hardcoded value frees callers from setting Type by hand — any user\-supplied value on the struct literal is overridden so a typo can't slip through to Telegram. -## type [PaidMediaPhoto]() +## type [PaidMediaPhoto]() The paid media is a photo. @@ -12025,7 +12661,7 @@ type PaidMediaPhoto struct { ``` -### func \(\*PaidMediaPhoto\) [MarshalJSON]() +### func \(\*PaidMediaPhoto\) [MarshalJSON]() ```go func (v *PaidMediaPhoto) MarshalJSON() ([]byte, error) @@ -12034,7 +12670,7 @@ func (v *PaidMediaPhoto) MarshalJSON() ([]byte, error) MarshalJSON encodes PaidMediaPhoto with the discriminator field "type" forced to "photo". The hardcoded value frees callers from setting Type by hand — any user\-supplied value on the struct literal is overridden so a typo can't slip through to Telegram. -## type [PaidMediaPreview]() +## type [PaidMediaPreview]() The paid media isn't available before the payment. @@ -12052,7 +12688,7 @@ type PaidMediaPreview struct { ``` -### func \(\*PaidMediaPreview\) [MarshalJSON]() +### func \(\*PaidMediaPreview\) [MarshalJSON]() ```go func (v *PaidMediaPreview) MarshalJSON() ([]byte, error) @@ -12061,7 +12697,7 @@ func (v *PaidMediaPreview) MarshalJSON() ([]byte, error) MarshalJSON encodes PaidMediaPreview with the discriminator field "type" forced to "preview". The hardcoded value frees callers from setting Type by hand — any user\-supplied value on the struct literal is overridden so a typo can't slip through to Telegram. -## type [PaidMediaPurchased]() +## type [PaidMediaPurchased]() This object contains information about a paid media purchase. @@ -12075,7 +12711,7 @@ type PaidMediaPurchased struct { ``` -## type [PaidMediaType]() +## type [PaidMediaType]() @@ -12095,7 +12731,7 @@ const ( ``` -## type [PaidMediaVideo]() +## type [PaidMediaVideo]() The paid media is a video. @@ -12109,7 +12745,7 @@ type PaidMediaVideo struct { ``` -### func \(\*PaidMediaVideo\) [MarshalJSON]() +### func \(\*PaidMediaVideo\) [MarshalJSON]() ```go func (v *PaidMediaVideo) MarshalJSON() ([]byte, error) @@ -12118,7 +12754,7 @@ func (v *PaidMediaVideo) MarshalJSON() ([]byte, error) MarshalJSON encodes PaidMediaVideo with the discriminator field "type" forced to "video". The hardcoded value frees callers from setting Type by hand — any user\-supplied value on the struct literal is overridden so a typo can't slip through to Telegram. -## type [PaidMessagePriceChanged]() +## type [PaidMessagePriceChanged]() Describes a service message about a change in the price of paid messages within a chat. @@ -12129,8 +12765,18 @@ type PaidMessagePriceChanged struct { } ``` + +## type [PaidMessagesWaived]() + +Describes 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. + +```go +type PaidMessagesWaived struct { +} +``` + -## type [ParseMode]() +## type [ParseMode]() @@ -12149,13 +12795,13 @@ const ( ``` -## type [PassportData]() +## type [PassportData]() Describes Telegram Passport data shared with the bot by the user. ```go type PassportData struct { - // Array with information about documents and other Telegram Passport elements that was shared with the bot + // Array with information shared with the bot about documents and other Telegram Passport elements Data []EncryptedPassportElement `json:"data"` // Encrypted credentials required to decrypt the data Credentials EncryptedCredentials `json:"credentials"` @@ -12163,7 +12809,7 @@ type PassportData struct { ``` -## type [PassportElementError]() +## type [PassportElementError]() PassportElementError is a union type. The following concrete variants implement it: @@ -12186,7 +12832,7 @@ type PassportElementError interface { ``` -### func [UnmarshalPassportElementError]() +### func [UnmarshalPassportElementError]() ```go func UnmarshalPassportElementError(data []byte) (PassportElementError, error) @@ -12195,7 +12841,7 @@ func UnmarshalPassportElementError(data []byte) (PassportElementError, error) UnmarshalPassportElementError decodes a PassportElementError from JSON by inspecting the "source" field and dispatching to the correct concrete type. -## type [PassportElementErrorDataField]() +## type [PassportElementErrorDataField]() Represents 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. @@ -12215,7 +12861,7 @@ type PassportElementErrorDataField struct { ``` -### func \(\*PassportElementErrorDataField\) [MarshalJSON]() +### func \(\*PassportElementErrorDataField\) [MarshalJSON]() ```go func (v *PassportElementErrorDataField) MarshalJSON() ([]byte, error) @@ -12224,7 +12870,7 @@ func (v *PassportElementErrorDataField) MarshalJSON() ([]byte, error) MarshalJSON encodes PassportElementErrorDataField with the discriminator field "source" forced to "data". The hardcoded value frees callers from setting Source by hand — any user\-supplied value on the struct literal is overridden so a typo can't slip through to Telegram. -## type [PassportElementErrorDataFieldType]() +## type [PassportElementErrorDataFieldType]() @@ -12246,7 +12892,7 @@ const ( ``` -## type [PassportElementErrorFile]() +## type [PassportElementErrorFile]() Represents an issue with a document scan. The error is considered resolved when the file with the document scan changes. @@ -12264,7 +12910,7 @@ type PassportElementErrorFile struct { ``` -### func \(\*PassportElementErrorFile\) [MarshalJSON]() +### func \(\*PassportElementErrorFile\) [MarshalJSON]() ```go func (v *PassportElementErrorFile) MarshalJSON() ([]byte, error) @@ -12273,7 +12919,7 @@ func (v *PassportElementErrorFile) MarshalJSON() ([]byte, error) MarshalJSON encodes PassportElementErrorFile with the discriminator field "source" forced to "file". The hardcoded value frees callers from setting Source by hand — any user\-supplied value on the struct literal is overridden so a typo can't slip through to Telegram. -## type [PassportElementErrorFileType]() +## type [PassportElementErrorFileType]() @@ -12294,7 +12940,7 @@ const ( ``` -## type [PassportElementErrorFiles]() +## type [PassportElementErrorFiles]() Represents an issue with a list of scans. The error is considered resolved when the list of files containing the scans changes. @@ -12312,7 +12958,7 @@ type PassportElementErrorFiles struct { ``` -### func \(\*PassportElementErrorFiles\) [MarshalJSON]() +### func \(\*PassportElementErrorFiles\) [MarshalJSON]() ```go func (v *PassportElementErrorFiles) MarshalJSON() ([]byte, error) @@ -12321,7 +12967,7 @@ func (v *PassportElementErrorFiles) MarshalJSON() ([]byte, error) MarshalJSON encodes PassportElementErrorFiles with the discriminator field "source" forced to "files". The hardcoded value frees callers from setting Source by hand — any user\-supplied value on the struct literal is overridden so a typo can't slip through to Telegram. -## type [PassportElementErrorFrontSide]() +## type [PassportElementErrorFrontSide]() Represents 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. @@ -12339,7 +12985,7 @@ type PassportElementErrorFrontSide struct { ``` -### func \(\*PassportElementErrorFrontSide\) [MarshalJSON]() +### func \(\*PassportElementErrorFrontSide\) [MarshalJSON]() ```go func (v *PassportElementErrorFrontSide) MarshalJSON() ([]byte, error) @@ -12348,9 +12994,9 @@ func (v *PassportElementErrorFrontSide) MarshalJSON() ([]byte, error) MarshalJSON encodes PassportElementErrorFrontSide with the discriminator field "source" forced to "front\_side". The hardcoded value frees callers from setting Source by hand — any user\-supplied value on the struct literal is overridden so a typo can't slip through to Telegram. -## type [PassportElementErrorReverseSide]() +## type [PassportElementErrorReverseSide]() -Represents an issue with the reverse side of a document. The error is considered resolved when the file with reverse side of the document changes. +Represents an issue with the reverse side of a document. The error is considered resolved when the file with the reverse side of the document changes. ```go type PassportElementErrorReverseSide struct { @@ -12366,7 +13012,7 @@ type PassportElementErrorReverseSide struct { ``` -### func \(\*PassportElementErrorReverseSide\) [MarshalJSON]() +### func \(\*PassportElementErrorReverseSide\) [MarshalJSON]() ```go func (v *PassportElementErrorReverseSide) MarshalJSON() ([]byte, error) @@ -12375,7 +13021,7 @@ func (v *PassportElementErrorReverseSide) MarshalJSON() ([]byte, error) MarshalJSON encodes PassportElementErrorReverseSide with the discriminator field "source" forced to "reverse\_side". The hardcoded value frees callers from setting Source by hand — any user\-supplied value on the struct literal is overridden so a typo can't slip through to Telegram. -## type [PassportElementErrorReverseSideType]() +## type [PassportElementErrorReverseSideType]() @@ -12393,7 +13039,7 @@ const ( ``` -## type [PassportElementErrorSelfie]() +## type [PassportElementErrorSelfie]() Represents an issue with the selfie with a document. The error is considered resolved when the file with the selfie changes. @@ -12411,7 +13057,7 @@ type PassportElementErrorSelfie struct { ``` -### func \(\*PassportElementErrorSelfie\) [MarshalJSON]() +### func \(\*PassportElementErrorSelfie\) [MarshalJSON]() ```go func (v *PassportElementErrorSelfie) MarshalJSON() ([]byte, error) @@ -12420,7 +13066,7 @@ func (v *PassportElementErrorSelfie) MarshalJSON() ([]byte, error) MarshalJSON encodes PassportElementErrorSelfie with the discriminator field "source" forced to "selfie". The hardcoded value frees callers from setting Source by hand — any user\-supplied value on the struct literal is overridden so a typo can't slip through to Telegram. -## type [PassportElementErrorSelfieType]() +## type [PassportElementErrorSelfieType]() @@ -12440,7 +13086,7 @@ const ( ``` -## type [PassportElementErrorSource]() +## type [PassportElementErrorSource]() @@ -12465,7 +13111,7 @@ const ( ``` -## type [PassportElementErrorTranslationFile]() +## type [PassportElementErrorTranslationFile]() Represents an issue with one of the files that constitute the translation of a document. The error is considered resolved when the file changes. @@ -12483,7 +13129,7 @@ type PassportElementErrorTranslationFile struct { ``` -### func \(\*PassportElementErrorTranslationFile\) [MarshalJSON]() +### func \(\*PassportElementErrorTranslationFile\) [MarshalJSON]() ```go func (v *PassportElementErrorTranslationFile) MarshalJSON() ([]byte, error) @@ -12492,7 +13138,7 @@ func (v *PassportElementErrorTranslationFile) MarshalJSON() ([]byte, error) MarshalJSON encodes PassportElementErrorTranslationFile with the discriminator field "source" forced to "translation\_file". The hardcoded value frees callers from setting Source by hand — any user\-supplied value on the struct literal is overridden so a typo can't slip through to Telegram. -## type [PassportElementErrorTranslationFileType]() +## type [PassportElementErrorTranslationFileType]() @@ -12517,9 +13163,9 @@ const ( ``` -## type [PassportElementErrorTranslationFiles]() +## type [PassportElementErrorTranslationFiles]() -Represents an issue with the translated version of a document. The error is considered resolved when a file with the document translation change. +Represents an issue with the translated version of a document. The error is considered resolved when a file with the document translation changes. ```go type PassportElementErrorTranslationFiles struct { @@ -12535,7 +13181,7 @@ type PassportElementErrorTranslationFiles struct { ``` -### func \(\*PassportElementErrorTranslationFiles\) [MarshalJSON]() +### func \(\*PassportElementErrorTranslationFiles\) [MarshalJSON]() ```go func (v *PassportElementErrorTranslationFiles) MarshalJSON() ([]byte, error) @@ -12544,7 +13190,7 @@ func (v *PassportElementErrorTranslationFiles) MarshalJSON() ([]byte, error) MarshalJSON encodes PassportElementErrorTranslationFiles with the discriminator field "source" forced to "translation\_files". The hardcoded value frees callers from setting Source by hand — any user\-supplied value on the struct literal is overridden so a typo can't slip through to Telegram. -## type [PassportElementErrorUnspecified]() +## type [PassportElementErrorUnspecified]() Represents an issue in an unspecified place. The error is considered resolved when new data is added. @@ -12562,7 +13208,7 @@ type PassportElementErrorUnspecified struct { ``` -### func \(\*PassportElementErrorUnspecified\) [MarshalJSON]() +### func \(\*PassportElementErrorUnspecified\) [MarshalJSON]() ```go func (v *PassportElementErrorUnspecified) MarshalJSON() ([]byte, error) @@ -12571,7 +13217,7 @@ func (v *PassportElementErrorUnspecified) MarshalJSON() ([]byte, error) MarshalJSON encodes PassportElementErrorUnspecified with the discriminator field "source" forced to "unspecified". The hardcoded value frees callers from setting Source by hand — any user\-supplied value on the struct literal is overridden so a typo can't slip through to Telegram. -## type [PassportFile]() +## type [PassportFile]() This object represents a file uploaded to Telegram Passport. Currently all Telegram Passport files are in JPEG format when decrypted and don't exceed 10MB. @@ -12589,7 +13235,7 @@ type PassportFile struct { ``` -## type [PhotoSize]() +## type [PhotoSize]() This object represents one size of a photo or a file / sticker thumbnail. @@ -12609,7 +13255,7 @@ type PhotoSize struct { ``` -## type [PinChatMessageParams]() +## type [PinChatMessageParams]() PinChatMessageParams is the parameter set for PinChatMessage. @@ -12629,7 +13275,7 @@ type PinChatMessageParams struct { ``` -## type [Poll]() +## type [Poll]() This object contains information about a poll. @@ -12653,9 +13299,9 @@ type Poll struct { Type PollType `json:"type"` // True, if the poll allows multiple answers AllowsMultipleAnswers bool `json:"allows_multiple_answers"` - // True, if the poll allows to change the chosen answer options + // True, if the poll allows changing the chosen answer options AllowsRevoting bool `json:"allows_revoting"` - // True if voting is limited to users who have been members of the chat where the poll was originally sent for more than 24 hours + // True, if voting is limited to users who have been members of the chat where the poll was originally sent for more than 24 hours MembersOnly bool `json:"members_only"` // Optional. A list of two-letter ISO 3166-1 alpha-2 country codes indicating the countries from which users can vote in the poll. The country code “FT” is used for users with anonymous numbers. If omitted, then users from any country can participate in the poll. CountryCodes []string `json:"country_codes,omitempty"` @@ -12681,7 +13327,7 @@ type Poll struct { ``` -### func [StopPoll]() +### func [StopPoll]() ```go func StopPoll(ctx context.Context, b *client.Bot, p *StopPollParams) (*Poll, error) @@ -12692,7 +13338,7 @@ StopPoll calls the stopPoll Telegram Bot API method. Use this method to stop a poll which was sent by the bot. On success, the stopped Poll is returned. -## type [PollAnswer]() +## type [PollAnswer]() This object represents an answer of a user in a non\-anonymous poll. @@ -12721,7 +13367,7 @@ func (pa *PollAnswer) GetSender() *Sender GetSender constructs a Sender for a PollAnswer. -## type [PollMedia]() +## type [PollMedia]() At most one of the optional fields can be present in any given object. @@ -12751,7 +13397,7 @@ type PollMedia struct { ``` -## type [PollOption]() +## type [PollOption]() This object contains information about one answer option in a poll. @@ -12777,7 +13423,7 @@ type PollOption struct { ``` -## type [PollOptionAdded]() +## type [PollOptionAdded]() Describes a service message about an option added to a poll. @@ -12795,7 +13441,7 @@ type PollOptionAdded struct { ``` -### func \(\*PollOptionAdded\) [UnmarshalJSON]() +### func \(\*PollOptionAdded\) [UnmarshalJSON]() ```go func (m *PollOptionAdded) UnmarshalJSON(data []byte) error @@ -12804,7 +13450,7 @@ func (m *PollOptionAdded) UnmarshalJSON(data []byte) error UnmarshalJSON decodes PollOptionAdded by dispatching union\-typed fields \(PollMessage\) through their concrete UnmarshalXxx helpers. -## type [PollOptionDeleted]() +## type [PollOptionDeleted]() Describes a service message about an option deleted from a poll. @@ -12822,7 +13468,7 @@ type PollOptionDeleted struct { ``` -### func \(\*PollOptionDeleted\) [UnmarshalJSON]() +### func \(\*PollOptionDeleted\) [UnmarshalJSON]() ```go func (m *PollOptionDeleted) UnmarshalJSON(data []byte) error @@ -12831,7 +13477,7 @@ func (m *PollOptionDeleted) UnmarshalJSON(data []byte) error UnmarshalJSON decodes PollOptionDeleted by dispatching union\-typed fields \(PollMessage\) through their concrete UnmarshalXxx helpers. -## type [PollType]() +## type [PollType]() @@ -12849,7 +13495,7 @@ const ( ``` -## type [PostStoryParams]() +## type [PostStoryParams]() PostStoryParams is the parameter set for PostStory. @@ -12879,7 +13525,7 @@ type PostStoryParams struct { ``` -## type [PreCheckoutQuery]() +## type [PreCheckoutQuery]() This object contains information about an incoming pre\-checkout query. @@ -12891,7 +13537,7 @@ type PreCheckoutQuery struct { From User `json:"from"` // Three-letter ISO 4217 currency code, or “XTR” for payments in Telegram Stars Currency string `json:"currency"` - // Total price in the smallest units of the currency (integer, not float/double). For example, for a price of US$ 1.45 pass amount = 145. See the exp parameter in currencies.json, it shows the number of digits past the decimal point for each currency (2 for the majority of currencies). + // Total price in the smallest units of the currency (integer, not float/double). For example, for a price of US$ 1.45, total_amount = 145. See the exp parameter in currencies.json; it shows the number of digits past the decimal point for each currency (2 for the majority of currencies). TotalAmount int64 `json:"total_amount"` // Bot-specified invoice payload InvoicePayload string `json:"invoice_payload"` @@ -12903,7 +13549,7 @@ type PreCheckoutQuery struct { ``` -## type [PreparedInlineMessage]() +## type [PreparedInlineMessage]() Describes an inline message to be sent by a user of a Mini App. @@ -12917,7 +13563,7 @@ type PreparedInlineMessage struct { ``` -### func [SavePreparedInlineMessage]() +### func [SavePreparedInlineMessage]() ```go func SavePreparedInlineMessage(ctx context.Context, b *client.Bot, p *SavePreparedInlineMessageParams) (*PreparedInlineMessage, error) @@ -12928,7 +13574,7 @@ SavePreparedInlineMessage calls the savePreparedInlineMessage Telegram Bot API m Stores a message that can be sent by a user of a Mini App. Returns a PreparedInlineMessage object. -## type [PreparedKeyboardButton]() +## type [PreparedKeyboardButton]() Describes a keyboard button to be used by a user of a Mini App. @@ -12940,7 +13586,7 @@ type PreparedKeyboardButton struct { ``` -### func [SavePreparedKeyboardButton]() +### func [SavePreparedKeyboardButton]() ```go func SavePreparedKeyboardButton(ctx context.Context, b *client.Bot, p *SavePreparedKeyboardButtonParams) (*PreparedKeyboardButton, error) @@ -12951,7 +13597,7 @@ SavePreparedKeyboardButton calls the savePreparedKeyboardButton Telegram Bot API Stores a keyboard button that can be used by a user within a Mini App. Returns a PreparedKeyboardButton object. -## type [PromoteChatMemberParams]() +## type [PromoteChatMemberParams]() PromoteChatMemberParams is the parameter set for PromoteChatMember. @@ -12975,7 +13621,7 @@ type PromoteChatMemberParams struct { CanRestrictMembers *bool `json:"can_restrict_members,omitempty"` // Pass True if the administrator can add new administrators with a subset of their own privileges or demote administrators that they have promoted, directly or indirectly (promoted by administrators that were appointed by him) CanPromoteMembers *bool `json:"can_promote_members,omitempty"` - // Pass True if the administrator can change chat title, photo and other settings + // Pass True if the administrator can change the chat title, photo and other settings CanChangeInfo *bool `json:"can_change_info,omitempty"` // Pass True if the administrator can invite new users to the chat CanInviteUsers *bool `json:"can_invite_users,omitempty"` @@ -13003,7 +13649,7 @@ type PromoteChatMemberParams struct { ``` -## type [ProximityAlertTriggered]() +## type [ProximityAlertTriggered]() This object represents the content of a service message, sent whenever a user in the chat triggers a proximity alert set by another user. @@ -13019,7 +13665,7 @@ type ProximityAlertTriggered struct { ``` -## type [ReactionCount]() +## type [ReactionCount]() Represents a reaction added to a message along with the number of times it was added. @@ -13033,7 +13679,7 @@ type ReactionCount struct { ``` -### func \(\*ReactionCount\) [UnmarshalJSON]() +### func \(\*ReactionCount\) [UnmarshalJSON]() ```go func (m *ReactionCount) UnmarshalJSON(data []byte) error @@ -13131,7 +13777,7 @@ const ( ``` -## type [ReactionType]() +## type [ReactionType]() ReactionType is a union type. The following concrete variants implement it: @@ -13148,7 +13794,7 @@ type ReactionType interface { ``` -### func [UnmarshalReactionType]() +### func [UnmarshalReactionType]() ```go func UnmarshalReactionType(data []byte) (ReactionType, error) @@ -13157,7 +13803,7 @@ func UnmarshalReactionType(data []byte) (ReactionType, error) UnmarshalReactionType decodes a ReactionType from JSON by inspecting the "type" field and dispatching to the correct concrete type. -## type [ReactionTypeCustomEmoji]() +## type [ReactionTypeCustomEmoji]() The reaction is based on a custom emoji. @@ -13171,7 +13817,7 @@ type ReactionTypeCustomEmoji struct { ``` -### func \(\*ReactionTypeCustomEmoji\) [MarshalJSON]() +### func \(\*ReactionTypeCustomEmoji\) [MarshalJSON]() ```go func (v *ReactionTypeCustomEmoji) MarshalJSON() ([]byte, error) @@ -13180,7 +13826,7 @@ func (v *ReactionTypeCustomEmoji) MarshalJSON() ([]byte, error) MarshalJSON encodes ReactionTypeCustomEmoji with the discriminator field "type" forced to "custom\_emoji". The hardcoded value frees callers from setting Type by hand — any user\-supplied value on the struct literal is overridden so a typo can't slip through to Telegram. -## type [ReactionTypeEmoji]() +## type [ReactionTypeEmoji]() The reaction is based on an emoji. @@ -13194,7 +13840,7 @@ type ReactionTypeEmoji struct { ``` -### func \(\*ReactionTypeEmoji\) [MarshalJSON]() +### func \(\*ReactionTypeEmoji\) [MarshalJSON]() ```go func (v *ReactionTypeEmoji) MarshalJSON() ([]byte, error) @@ -13203,7 +13849,7 @@ func (v *ReactionTypeEmoji) MarshalJSON() ([]byte, error) MarshalJSON encodes ReactionTypeEmoji with the discriminator field "type" forced to "emoji". The hardcoded value frees callers from setting Type by hand — any user\-supplied value on the struct literal is overridden so a typo can't slip through to Telegram. -## type [ReactionTypeKind]() +## type [ReactionTypeKind]() @@ -13222,7 +13868,7 @@ const ( ``` -## type [ReactionTypePaid]() +## type [ReactionTypePaid]() The reaction is paid. @@ -13234,7 +13880,7 @@ type ReactionTypePaid struct { ``` -### func \(\*ReactionTypePaid\) [MarshalJSON]() +### func \(\*ReactionTypePaid\) [MarshalJSON]() ```go func (v *ReactionTypePaid) MarshalJSON() ([]byte, error) @@ -13243,11 +13889,11 @@ func (v *ReactionTypePaid) MarshalJSON() ([]byte, error) MarshalJSON encodes ReactionTypePaid with the discriminator field "type" forced to "paid". The hardcoded value frees callers from setting Type by hand — any user\-supplied value on the struct literal is overridden so a typo can't slip through to Telegram. -## type [ReadBusinessMessageParams]() +## type [ReadBusinessMessageParams]() ReadBusinessMessageParams is the parameter set for ReadBusinessMessage. -Marks incoming message as read on behalf of a business account. Requires the can\_read\_messages business bot right. Returns True on success. +Marks an incoming message as read on behalf of a business account. Requires the can\_read\_messages business bot right. Returns True on success. ```go type ReadBusinessMessageParams struct { @@ -13261,7 +13907,7 @@ type ReadBusinessMessageParams struct { ``` -## type [RefundStarPaymentParams]() +## type [RefundStarPaymentParams]() RefundStarPaymentParams is the parameter set for RefundStarPayment. @@ -13277,7 +13923,7 @@ type RefundStarPaymentParams struct { ``` -## type [RefundedPayment]() +## type [RefundedPayment]() This object contains basic information about a refunded payment. @@ -13285,7 +13931,7 @@ This object contains basic information about a refunded payment. type RefundedPayment struct { // Three-letter ISO 4217 currency code, or “XTR” for payments in Telegram Stars. Currently, always “XTR”. Currency RefundedPaymentCurrency `json:"currency"` - // Total refunded price in the smallest units of the currency (integer, not float/double). For example, for a price of US$ 1.45, total_amount = 145. See the exp parameter in currencies.json, it shows the number of digits past the decimal point for each currency (2 for the majority of currencies). + // Total refunded price in the smallest units of the currency (integer, not float/double). For example, for a price of US$ 1.45, total_amount = 145. See the exp parameter in currencies.json; it shows the number of digits past the decimal point for each currency (2 for the majority of currencies). TotalAmount int64 `json:"total_amount"` // Bot-specified invoice payload InvoicePayload string `json:"invoice_payload"` @@ -13297,7 +13943,7 @@ type RefundedPayment struct { ``` -## type [RefundedPaymentCurrency]() +## type [RefundedPaymentCurrency]() @@ -13314,7 +13960,7 @@ const ( ``` -## type [RemoveBusinessAccountProfilePhotoParams]() +## type [RemoveBusinessAccountProfilePhotoParams]() RemoveBusinessAccountProfilePhotoParams is the parameter set for RemoveBusinessAccountProfilePhoto. @@ -13330,7 +13976,7 @@ type RemoveBusinessAccountProfilePhotoParams struct { ``` -## type [RemoveChatVerificationParams]() +## type [RemoveChatVerificationParams]() RemoveChatVerificationParams is the parameter set for RemoveChatVerification. @@ -13338,13 +13984,13 @@ Removes verification from a chat that is currently verified on behalf of the org ```go type RemoveChatVerificationParams struct { - // Unique identifier for the target chat or username of the target bot or channel in the format @username + // Unique identifier for the target chat or username of the target bot, supergroup, or channel in the format @username ChatID ChatID `json:"chat_id"` } ``` -## type [RemoveMyProfilePhotoParams]() +## type [RemoveMyProfilePhotoParams]() RemoveMyProfilePhotoParams is the parameter set for RemoveMyProfilePhoto. @@ -13356,7 +14002,7 @@ type RemoveMyProfilePhotoParams struct { ``` -## type [RemoveUserVerificationParams]() +## type [RemoveUserVerificationParams]() RemoveUserVerificationParams is the parameter set for RemoveUserVerification. @@ -13370,11 +14016,11 @@ type RemoveUserVerificationParams struct { ``` -## type [ReopenForumTopicParams]() +## type [ReopenForumTopicParams]() ReopenForumTopicParams is the parameter set for ReopenForumTopic. -Use 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 the topic. Returns True on success. +Use 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 right, unless it is the creator of the topic. Returns True on success. ```go type ReopenForumTopicParams struct { @@ -13386,11 +14032,11 @@ type ReopenForumTopicParams struct { ``` -## type [ReopenGeneralForumTopicParams]() +## type [ReopenGeneralForumTopicParams]() ReopenGeneralForumTopicParams is the parameter set for ReopenGeneralForumTopic. -Use 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 automatically unhidden if it was hidden. Returns True on success. +Use 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 right. The topic will be automatically unhidden if it was hidden. Returns True on success. ```go type ReopenGeneralForumTopicParams struct { @@ -13400,7 +14046,7 @@ type ReopenGeneralForumTopicParams struct { ``` -## type [ReplaceManagedBotTokenParams]() +## type [ReplaceManagedBotTokenParams]() ReplaceManagedBotTokenParams is the parameter set for ReplaceManagedBotToken. @@ -13414,7 +14060,7 @@ type ReplaceManagedBotTokenParams struct { ``` -## type [ReplaceStickerInSetParams]() +## type [ReplaceStickerInSetParams]() ReplaceStickerInSetParams is the parameter set for ReplaceStickerInSet. @@ -13434,7 +14080,7 @@ type ReplaceStickerInSetParams struct { ``` -## type [ReplyKeyboardMarkup]() +## type [ReplyKeyboardMarkup]() This 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. @@ -13450,7 +14096,7 @@ type ReplyKeyboardMarkup struct { OneTimeKeyboard *bool `json:"one_time_keyboard,omitempty"` // Optional. The placeholder to be shown in the input field when the keyboard is active; 1-64 characters InputFieldPlaceholder string `json:"input_field_placeholder,omitempty"` - // Optional. Use this parameter if you want to show the keyboard to specific users only. Targets: 1) users that are @mentioned in the text of the Message object; 2) if the bot's message is a reply to a message in the same chat and forum topic, sender of the original message.Example: A user requests to change the bot's language, bot replies to the request with a keyboard to select the new language. Other users in the group don't see the keyboard. + // Optional. Use this parameter if you want to show the keyboard to specific users only. Targets: 1) users that are @mentioned in the text of the Message object; 2) if the bot's message is a reply to a message in the same chat and forum topic, sender of the original message.Example: A user requests to change the bot's language, and the bot replies to the request with a keyboard to select the new language. Other users in the group don't see the keyboard. Selective *bool `json:"selective,omitempty"` // Optional. Pass True if the reply interface must be shown to the user, as if they had manually selected the bot's message and tapped 'Reply' ForceReply *bool `json:"force_reply,omitempty"` @@ -13458,21 +14104,21 @@ type ReplyKeyboardMarkup struct { ``` -## type [ReplyKeyboardRemove]() +## type [ReplyKeyboardRemove]() Upon 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 bot. An exception is made for one\-time keyboards that are hidden immediately after the user presses a button \(see ReplyKeyboardMarkup\). Not supported in channels and for messages sent on behalf of a business account. ```go type ReplyKeyboardRemove struct { - // Requests clients to remove the custom keyboard (user will not be able to summon this keyboard; if you want to hide the keyboard from sight but keep it accessible, use one_time_keyboard in ReplyKeyboardMarkup) + // Requests clients to remove the custom keyboard (the user will not be able to summon this keyboard; if you want to hide the keyboard from sight but keep it accessible, use one_time_keyboard in ReplyKeyboardMarkup) RemoveKeyboard bool `json:"remove_keyboard"` - // Optional. Use this parameter if you want to remove the keyboard for specific users only. Targets: 1) users that are @mentioned in the text of the Message object; 2) if the bot's message is a reply to a message in the same chat and forum topic, sender of the original message.Example: A user votes in a poll, bot returns confirmation message in reply to the vote and removes the keyboard for that user, while still showing the keyboard with poll options to users who haven't voted yet. + // Optional. Use this parameter if you want to remove the keyboard for specific users only. Targets: 1) users that are @mentioned in the text of the Message object; 2) if the bot's message is a reply to a message in the same chat and forum topic, sender of the original message.Example: A user votes in a poll, and the bot returns a confirmation message in reply to the vote and removes the keyboard for that user, while still showing the keyboard with poll options to users who haven't voted yet. Selective *bool `json:"selective,omitempty"` } ``` -## type [ReplyParameters]() +## type [ReplyParameters]() Describes reply parameters for the message that is being sent. @@ -13480,7 +14126,7 @@ Describes reply parameters for the message that is being sent. type ReplyParameters struct { // Optional. Identifier of the message that will be replied to in the current chat, or in the chat chat_id if it is specified. Required if ephemeral_message_id isn't specified. MessageID *int64 `json:"message_id,omitempty"` - // Optional. If the message to be replied to is from a different chat, unique identifier for the chat or username of the bot, supergroup or channel in the format @username. Not supported for messages sent on behalf of a business account, messages from channel direct messages chats and ephemeral messages. + // Optional. If the message to be replied to is from a different chat, unique identifier for the chat or username of the bot, supergroup, or channel in the format @username. Not supported for messages sent on behalf of a business account, messages from channel direct messages chats and ephemeral messages. ChatID *ChatID `json:"chat_id,omitempty"` // Optional. Identifier of the incoming ephemeral message that will be replied to in the current chat. A reply to an ephemeral message must itself be an ephemeral message. An ephemeral message may only be replied to within 15 seconds of being sent. Required if message_id isn't specified. EphemeralMessageID *int64 `json:"ephemeral_message_id,omitempty"` @@ -13492,7 +14138,9 @@ type ReplyParameters struct { QuoteParseMode ParseMode `json:"quote_parse_mode,omitempty"` // Optional. A JSON-serialized list of special entities that appear in the quote. It can be specified instead of quote_parse_mode. QuoteEntities []MessageEntity `json:"quote_entities,omitempty"` - // Optional. Position of the quote in the original message in UTF-16 code units + // Optional. A JSON-serialized list of quoted parts of the rich message to be replied to. Must contain one element for each quoted text of the message in the order of their appearance. Each of the following is a separate quoted text: the text of a paragraph, a heading, a preformatted block, a footer, or a mathematical expression; the text and the credit of a block quotation or a pull quotation; the summary of a details block; the caption and each cell of a table; the text and the credit of a caption of a media block, a collage, a slideshow, or a map. Texts of blocks nested in lists, block quotations, details, collages, and slideshows are separate quoted texts too. The first and the last elements can contain only a part of the corresponding text; all other elements must contain the whole text. Formatting of the quoted parts must be kept, and rich texts must be nested in the same way as in the message received from the server. Mathematical expressions must be quoted entirely. Buttons in RichBlockButtons, anchors and dividers can't be quoted. Up to 32 quoted texts with a total length of up to 1024 characters can be specified. Only plain text, RichTextBold, RichTextItalic, RichTextUnderline, RichTextStrikethrough, RichTextSpoiler, RichTextSubscript, RichTextSuperscript, RichTextDateTime, RichTextCustomEmoji, RichTextMathematicalExpression, and arrays of them are kept in the quote; other rich text types are replaced with their text. If non-empty, then quote, quote_parse_mode and quote_entities are ignored. + QuoteRichTexts []RichText `json:"quote_rich_texts,omitempty"` + // Optional. Position of the quote in the original message in UTF-16 code units. For quotes from rich messages, it is the position in the text formed by joining plain texts of all quotable texts of the message, separated by line feeds. QuotePosition *int64 `json:"quote_position,omitempty"` // Optional. Identifier of the specific checklist task to be replied to ChecklistTaskID *int64 `json:"checklist_task_id,omitempty"` @@ -13501,8 +14149,17 @@ type ReplyParameters struct { } ``` + +### func \(\*ReplyParameters\) [UnmarshalJSON]() + +```go +func (m *ReplyParameters) UnmarshalJSON(data []byte) error +``` + +UnmarshalJSON decodes ReplyParameters by dispatching union\-typed fields \(QuoteRichTexts\) through their concrete UnmarshalXxx helpers. + -## type [RepostStoryParams]() +## type [RepostStoryParams]() RepostStoryParams is the parameter set for RepostStory. @@ -13540,7 +14197,7 @@ type ResponseParameters struct { ``` -## type [RestrictChatMemberParams]() +## type [RestrictChatMemberParams]() RestrictChatMemberParams is the parameter set for RestrictChatMember. @@ -13556,13 +14213,13 @@ type RestrictChatMemberParams struct { Permissions ChatPermissions `json:"permissions"` // Pass True if chat permissions are set independently. Otherwise, the can_send_other_messages and can_add_web_page_previews permissions will imply the can_send_messages, can_send_audios, can_send_documents, can_send_photos, can_send_videos, can_send_video_notes, and can_send_voice_notes permissions; the can_send_polls permission will imply the can_send_messages permission. UseIndependentChatPermissions *bool `json:"use_independent_chat_permissions,omitempty"` - // Date when restrictions will be lifted for the user; Unix time. If user is restricted for more than 366 days or less than 30 seconds from the current time, they are considered to be restricted forever. + // Date when restrictions will be lifted for the user; Unix time. If the user is restricted for more than 366 days or less than 30 seconds from the current time, they are considered to be restricted forever. UntilDate *int64 `json:"until_date,omitempty"` } ``` -## type [Result]() +## type [Result]() @@ -13581,7 +14238,7 @@ const ( ``` -## type [RevenueWithdrawalState]() +## type [RevenueWithdrawalState]() RevenueWithdrawalState is a union type. The following concrete variants implement it: @@ -13598,7 +14255,7 @@ type RevenueWithdrawalState interface { ``` -### func [UnmarshalRevenueWithdrawalState]() +### func [UnmarshalRevenueWithdrawalState]() ```go func UnmarshalRevenueWithdrawalState(data []byte) (RevenueWithdrawalState, error) @@ -13607,7 +14264,7 @@ func UnmarshalRevenueWithdrawalState(data []byte) (RevenueWithdrawalState, error UnmarshalRevenueWithdrawalState decodes a RevenueWithdrawalState from JSON by inspecting the "type" field and dispatching to the correct concrete type. -## type [RevenueWithdrawalStateFailed]() +## type [RevenueWithdrawalStateFailed]() The withdrawal failed and the transaction was refunded. @@ -13619,7 +14276,7 @@ type RevenueWithdrawalStateFailed struct { ``` -### func \(\*RevenueWithdrawalStateFailed\) [MarshalJSON]() +### func \(\*RevenueWithdrawalStateFailed\) [MarshalJSON]() ```go func (v *RevenueWithdrawalStateFailed) MarshalJSON() ([]byte, error) @@ -13628,7 +14285,7 @@ func (v *RevenueWithdrawalStateFailed) MarshalJSON() ([]byte, error) MarshalJSON encodes RevenueWithdrawalStateFailed with the discriminator field "type" forced to "failed". The hardcoded value frees callers from setting Type by hand — any user\-supplied value on the struct literal is overridden so a typo can't slip through to Telegram. -## type [RevenueWithdrawalStateKind]() +## type [RevenueWithdrawalStateKind]() @@ -13647,7 +14304,7 @@ const ( ``` -## type [RevenueWithdrawalStatePending]() +## type [RevenueWithdrawalStatePending]() The withdrawal is in progress. @@ -13659,7 +14316,7 @@ type RevenueWithdrawalStatePending struct { ``` -### func \(\*RevenueWithdrawalStatePending\) [MarshalJSON]() +### func \(\*RevenueWithdrawalStatePending\) [MarshalJSON]() ```go func (v *RevenueWithdrawalStatePending) MarshalJSON() ([]byte, error) @@ -13668,7 +14325,7 @@ func (v *RevenueWithdrawalStatePending) MarshalJSON() ([]byte, error) MarshalJSON encodes RevenueWithdrawalStatePending with the discriminator field "type" forced to "pending". The hardcoded value frees callers from setting Type by hand — any user\-supplied value on the struct literal is overridden so a typo can't slip through to Telegram. -## type [RevenueWithdrawalStateSucceeded]() +## type [RevenueWithdrawalStateSucceeded]() The withdrawal succeeded. @@ -13684,7 +14341,7 @@ type RevenueWithdrawalStateSucceeded struct { ``` -### func \(\*RevenueWithdrawalStateSucceeded\) [MarshalJSON]() +### func \(\*RevenueWithdrawalStateSucceeded\) [MarshalJSON]() ```go func (v *RevenueWithdrawalStateSucceeded) MarshalJSON() ([]byte, error) @@ -13693,11 +14350,11 @@ func (v *RevenueWithdrawalStateSucceeded) MarshalJSON() ([]byte, error) MarshalJSON encodes RevenueWithdrawalStateSucceeded with the discriminator field "type" forced to "succeeded". The hardcoded value frees callers from setting Type by hand — any user\-supplied value on the struct literal is overridden so a typo can't slip through to Telegram. -## type [RevokeChatInviteLinkParams]() +## type [RevokeChatInviteLinkParams]() RevokeChatInviteLinkParams is the parameter set for RevokeChatInviteLink. -Use 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 appropriate administrator rights. Returns the revoked invite link as ChatInviteLink object. +Use 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 appropriate administrator rights. Returns the revoked invite link as a ChatInviteLink object. ```go type RevokeChatInviteLinkParams struct { @@ -13709,7 +14366,7 @@ type RevokeChatInviteLinkParams struct { ``` -## type [RichBlock]() +## type [RichBlock]() RichBlock is a union type. The following concrete variants implement it: @@ -13747,7 +14404,7 @@ type RichBlock interface { ``` -### func [UnmarshalRichBlock]() +### func [UnmarshalRichBlock]() ```go func UnmarshalRichBlock(data []byte) (RichBlock, error) @@ -13756,7 +14413,7 @@ func UnmarshalRichBlock(data []byte) (RichBlock, error) UnmarshalRichBlock decodes a RichBlock from JSON by inspecting the "type" field and dispatching to the correct concrete type. -## type [RichBlockAnchor]() +## type [RichBlockAnchor]() A block with an anchor, corresponding to the HTML tag \ with the attribute name. @@ -13770,7 +14427,7 @@ type RichBlockAnchor struct { ``` -### func \(\*RichBlockAnchor\) [MarshalJSON]() +### func \(\*RichBlockAnchor\) [MarshalJSON]() ```go func (v *RichBlockAnchor) MarshalJSON() ([]byte, error) @@ -13779,7 +14436,7 @@ func (v *RichBlockAnchor) MarshalJSON() ([]byte, error) MarshalJSON encodes RichBlockAnchor with the discriminator field "type" forced to "anchor". The hardcoded value frees callers from setting Type by hand — any user\-supplied value on the struct literal is overridden so a typo can't slip through to Telegram. -## type [RichBlockAnimation]() +## type [RichBlockAnimation]() A block with an animation, corresponding to the HTML tag \. @@ -13797,7 +14454,7 @@ type RichBlockAnimation struct { ``` -### func \(\*RichBlockAnimation\) [MarshalJSON]() +### func \(\*RichBlockAnimation\) [MarshalJSON]() ```go func (v *RichBlockAnimation) MarshalJSON() ([]byte, error) @@ -13806,7 +14463,7 @@ func (v *RichBlockAnimation) MarshalJSON() ([]byte, error) MarshalJSON encodes RichBlockAnimation with the discriminator field "type" forced to "animation". The hardcoded value frees callers from setting Type by hand — any user\-supplied value on the struct literal is overridden so a typo can't slip through to Telegram. -## type [RichBlockAudio]() +## type [RichBlockAudio]() A block with a music file, corresponding to the HTML tag \. @@ -13822,7 +14479,7 @@ type RichBlockAudio struct { ``` -### func \(\*RichBlockAudio\) [MarshalJSON]() +### func \(\*RichBlockAudio\) [MarshalJSON]() ```go func (v *RichBlockAudio) MarshalJSON() ([]byte, error) @@ -13831,7 +14488,7 @@ func (v *RichBlockAudio) MarshalJSON() ([]byte, error) MarshalJSON encodes RichBlockAudio with the discriminator field "type" forced to "audio". The hardcoded value frees callers from setting Type by hand — any user\-supplied value on the struct literal is overridden so a typo can't slip through to Telegram. -## type [RichBlockBlockQuotation]() +## type [RichBlockBlockQuotation]() A block quotation, corresponding to the HTML tag \. @@ -13847,7 +14504,7 @@ type RichBlockBlockQuotation struct { ``` -### func \(\*RichBlockBlockQuotation\) [MarshalJSON]() +### func \(\*RichBlockBlockQuotation\) [MarshalJSON]() ```go func (v *RichBlockBlockQuotation) MarshalJSON() ([]byte, error) @@ -13856,7 +14513,7 @@ func (v *RichBlockBlockQuotation) MarshalJSON() ([]byte, error) MarshalJSON encodes RichBlockBlockQuotation with the discriminator field "type" forced to "blockquote". The hardcoded value frees callers from setting Type by hand — any user\-supplied value on the struct literal is overridden so a typo can't slip through to Telegram. -### func \(\*RichBlockBlockQuotation\) [UnmarshalJSON]() +### func \(\*RichBlockBlockQuotation\) [UnmarshalJSON]() ```go func (m *RichBlockBlockQuotation) UnmarshalJSON(data []byte) error @@ -13865,7 +14522,7 @@ func (m *RichBlockBlockQuotation) UnmarshalJSON(data []byte) error UnmarshalJSON decodes RichBlockBlockQuotation by dispatching union\-typed fields \(Blocks, Credit\) through their concrete UnmarshalXxx helpers. -## type [RichBlockButtons]() +## type [RichBlockButtons]() A block containing a list of buttons that are shown in one row, corresponding to the custom HTML tag \. @@ -13881,7 +14538,7 @@ type RichBlockButtons struct { ``` -### func \(\*RichBlockButtons\) [MarshalJSON]() +### func \(\*RichBlockButtons\) [MarshalJSON]() ```go func (v *RichBlockButtons) MarshalJSON() ([]byte, error) @@ -13890,7 +14547,7 @@ func (v *RichBlockButtons) MarshalJSON() ([]byte, error) MarshalJSON encodes RichBlockButtons with the discriminator field "type" forced to "buttons". The hardcoded value frees callers from setting Type by hand — any user\-supplied value on the struct literal is overridden so a typo can't slip through to Telegram. -## type [RichBlockButtonsAlign]() +## type [RichBlockButtonsAlign]() @@ -13909,7 +14566,7 @@ const ( ``` -## type [RichBlockCaption]() +## type [RichBlockCaption]() Caption of a rich formatted block. @@ -13923,7 +14580,7 @@ type RichBlockCaption struct { ``` -### func \(\*RichBlockCaption\) [UnmarshalJSON]() +### func \(\*RichBlockCaption\) [UnmarshalJSON]() ```go func (m *RichBlockCaption) UnmarshalJSON(data []byte) error @@ -13932,7 +14589,7 @@ func (m *RichBlockCaption) UnmarshalJSON(data []byte) error UnmarshalJSON decodes RichBlockCaption by dispatching union\-typed fields \(Text, Credit\) through their concrete UnmarshalXxx helpers. -## type [RichBlockCollage]() +## type [RichBlockCollage]() A collage, corresponding to the custom HTML tag \. @@ -13948,7 +14605,7 @@ type RichBlockCollage struct { ``` -### func \(\*RichBlockCollage\) [MarshalJSON]() +### func \(\*RichBlockCollage\) [MarshalJSON]() ```go func (v *RichBlockCollage) MarshalJSON() ([]byte, error) @@ -13957,7 +14614,7 @@ func (v *RichBlockCollage) MarshalJSON() ([]byte, error) MarshalJSON encodes RichBlockCollage with the discriminator field "type" forced to "collage". The hardcoded value frees callers from setting Type by hand — any user\-supplied value on the struct literal is overridden so a typo can't slip through to Telegram. -### func \(\*RichBlockCollage\) [UnmarshalJSON]() +### func \(\*RichBlockCollage\) [UnmarshalJSON]() ```go func (m *RichBlockCollage) UnmarshalJSON(data []byte) error @@ -13966,7 +14623,7 @@ func (m *RichBlockCollage) UnmarshalJSON(data []byte) error UnmarshalJSON decodes RichBlockCollage by dispatching union\-typed fields \(Blocks\) through their concrete UnmarshalXxx helpers. -## type [RichBlockDetails]() +## type [RichBlockDetails]() An expandable block for details disclosure, corresponding to the HTML tag \. @@ -13984,7 +14641,7 @@ type RichBlockDetails struct { ``` -### func \(\*RichBlockDetails\) [MarshalJSON]() +### func \(\*RichBlockDetails\) [MarshalJSON]() ```go func (v *RichBlockDetails) MarshalJSON() ([]byte, error) @@ -13993,7 +14650,7 @@ func (v *RichBlockDetails) MarshalJSON() ([]byte, error) MarshalJSON encodes RichBlockDetails with the discriminator field "type" forced to "details". The hardcoded value frees callers from setting Type by hand — any user\-supplied value on the struct literal is overridden so a typo can't slip through to Telegram. -### func \(\*RichBlockDetails\) [UnmarshalJSON]() +### func \(\*RichBlockDetails\) [UnmarshalJSON]() ```go func (m *RichBlockDetails) UnmarshalJSON(data []byte) error @@ -14002,7 +14659,7 @@ func (m *RichBlockDetails) UnmarshalJSON(data []byte) error UnmarshalJSON decodes RichBlockDetails by dispatching union\-typed fields \(Summary, Blocks\) through their concrete UnmarshalXxx helpers. -## type [RichBlockDivider]() +## type [RichBlockDivider]() A divider, corresponding to the HTML tag \
. @@ -14014,7 +14671,7 @@ type RichBlockDivider struct { ``` -### func \(\*RichBlockDivider\) [MarshalJSON]() +### func \(\*RichBlockDivider\) [MarshalJSON]() ```go func (v *RichBlockDivider) MarshalJSON() ([]byte, error) @@ -14023,7 +14680,7 @@ func (v *RichBlockDivider) MarshalJSON() ([]byte, error) MarshalJSON encodes RichBlockDivider with the discriminator field "type" forced to "divider". The hardcoded value frees callers from setting Type by hand — any user\-supplied value on the struct literal is overridden so a typo can't slip through to Telegram. -## type [RichBlockDocument]() +## type [RichBlockDocument]() A block with a general file, corresponding to the custom HTML tag \. @@ -14039,7 +14696,7 @@ type RichBlockDocument struct { ``` -### func \(\*RichBlockDocument\) [MarshalJSON]() +### func \(\*RichBlockDocument\) [MarshalJSON]() ```go func (v *RichBlockDocument) MarshalJSON() ([]byte, error) @@ -14048,23 +14705,23 @@ func (v *RichBlockDocument) MarshalJSON() ([]byte, error) MarshalJSON encodes RichBlockDocument with the discriminator field "type" forced to "document". The hardcoded value frees callers from setting Type by hand — any user\-supplied value on the struct literal is overridden so a typo can't slip through to Telegram. -## type [RichBlockExpandableBlockQuotation]() +## type [RichBlockExpandableBlockQuotation]() -A block quotation, corresponding to the HTML tag \ with custom attribute "expandable". +A block quotation, corresponding to the HTML tag \ with the custom attribute "expandable". ```go type RichBlockExpandableBlockQuotation struct { // Type of the block, always “expandable_blockquote” Type RichBlockType `json:"type"` // Content of the block - Text RichText `json:"text"` + Blocks []RichBlock `json:"blocks"` // Optional. Credit of the block Credit RichText `json:"credit,omitempty"` } ``` -### func \(\*RichBlockExpandableBlockQuotation\) [MarshalJSON]() +### func \(\*RichBlockExpandableBlockQuotation\) [MarshalJSON]() ```go func (v *RichBlockExpandableBlockQuotation) MarshalJSON() ([]byte, error) @@ -14073,16 +14730,16 @@ func (v *RichBlockExpandableBlockQuotation) MarshalJSON() ([]byte, error) MarshalJSON encodes RichBlockExpandableBlockQuotation with the discriminator field "type" forced to "expandable\_blockquote". The hardcoded value frees callers from setting Type by hand — any user\-supplied value on the struct literal is overridden so a typo can't slip through to Telegram. -### func \(\*RichBlockExpandableBlockQuotation\) [UnmarshalJSON]() +### func \(\*RichBlockExpandableBlockQuotation\) [UnmarshalJSON]() ```go func (m *RichBlockExpandableBlockQuotation) UnmarshalJSON(data []byte) error ``` -UnmarshalJSON decodes RichBlockExpandableBlockQuotation by dispatching union\-typed fields \(Text, Credit\) through their concrete UnmarshalXxx helpers. +UnmarshalJSON decodes RichBlockExpandableBlockQuotation by dispatching union\-typed fields \(Blocks, Credit\) through their concrete UnmarshalXxx helpers. -## type [RichBlockFooter]() +## type [RichBlockFooter]() A footer, corresponding to the HTML tag \. @@ -14096,7 +14753,7 @@ type RichBlockFooter struct { ``` -### func \(\*RichBlockFooter\) [MarshalJSON]() +### func \(\*RichBlockFooter\) [MarshalJSON]() ```go func (v *RichBlockFooter) MarshalJSON() ([]byte, error) @@ -14105,7 +14762,7 @@ func (v *RichBlockFooter) MarshalJSON() ([]byte, error) MarshalJSON encodes RichBlockFooter with the discriminator field "type" forced to "footer". The hardcoded value frees callers from setting Type by hand — any user\-supplied value on the struct literal is overridden so a typo can't slip through to Telegram. -### func \(\*RichBlockFooter\) [UnmarshalJSON]() +### func \(\*RichBlockFooter\) [UnmarshalJSON]() ```go func (m *RichBlockFooter) UnmarshalJSON(data []byte) error @@ -14114,7 +14771,7 @@ func (m *RichBlockFooter) UnmarshalJSON(data []byte) error UnmarshalJSON decodes RichBlockFooter by dispatching union\-typed fields \(Text\) through their concrete UnmarshalXxx helpers. -## type [RichBlockList]() +## type [RichBlockList]() A list of blocks, corresponding to the HTML tag \ or \ with multiple nested tags \. @@ -14128,7 +14785,7 @@ type RichBlockList struct { ``` -### func \(\*RichBlockList\) [MarshalJSON]() +### func \(\*RichBlockList\) [MarshalJSON]() ```go func (v *RichBlockList) MarshalJSON() ([]byte, error) @@ -14137,7 +14794,7 @@ func (v *RichBlockList) MarshalJSON() ([]byte, error) MarshalJSON encodes RichBlockList with the discriminator field "type" forced to "list". The hardcoded value frees callers from setting Type by hand — any user\-supplied value on the struct literal is overridden so a typo can't slip through to Telegram. -## type [RichBlockListItem]() +## type [RichBlockListItem]() An item of a list. @@ -14159,7 +14816,7 @@ type RichBlockListItem struct { ``` -### func \(\*RichBlockListItem\) [UnmarshalJSON]() +### func \(\*RichBlockListItem\) [UnmarshalJSON]() ```go func (m *RichBlockListItem) UnmarshalJSON(data []byte) error @@ -14168,7 +14825,7 @@ func (m *RichBlockListItem) UnmarshalJSON(data []byte) error UnmarshalJSON decodes RichBlockListItem by dispatching union\-typed fields \(Blocks\) through their concrete UnmarshalXxx helpers. -## type [RichBlockListItemType]() +## type [RichBlockListItemType]() @@ -14189,7 +14846,7 @@ const ( ``` -## type [RichBlockMap]() +## type [RichBlockMap]() A block with a map, corresponding to the custom HTML tag \. @@ -14211,7 +14868,7 @@ type RichBlockMap struct { ``` -### func \(\*RichBlockMap\) [MarshalJSON]() +### func \(\*RichBlockMap\) [MarshalJSON]() ```go func (v *RichBlockMap) MarshalJSON() ([]byte, error) @@ -14220,7 +14877,7 @@ func (v *RichBlockMap) MarshalJSON() ([]byte, error) MarshalJSON encodes RichBlockMap with the discriminator field "type" forced to "map". The hardcoded value frees callers from setting Type by hand — any user\-supplied value on the struct literal is overridden so a typo can't slip through to Telegram. -## type [RichBlockMathematicalExpression]() +## type [RichBlockMathematicalExpression]() A block with a mathematical expression in LaTeX format, corresponding to the custom HTML tag \. @@ -14234,7 +14891,7 @@ type RichBlockMathematicalExpression struct { ``` -### func \(\*RichBlockMathematicalExpression\) [MarshalJSON]() +### func \(\*RichBlockMathematicalExpression\) [MarshalJSON]() ```go func (v *RichBlockMathematicalExpression) MarshalJSON() ([]byte, error) @@ -14243,7 +14900,7 @@ func (v *RichBlockMathematicalExpression) MarshalJSON() ([]byte, error) MarshalJSON encodes RichBlockMathematicalExpression with the discriminator field "type" forced to "mathematical\_expression". The hardcoded value frees callers from setting Type by hand — any user\-supplied value on the struct literal is overridden so a typo can't slip through to Telegram. -## type [RichBlockParagraph]() +## type [RichBlockParagraph]() A text paragraph, corresponding to the HTML tag \. @@ -14257,7 +14914,7 @@ type RichBlockParagraph struct { ``` -### func \(\*RichBlockParagraph\) [MarshalJSON]() +### func \(\*RichBlockParagraph\) [MarshalJSON]() ```go func (v *RichBlockParagraph) MarshalJSON() ([]byte, error) @@ -14266,7 +14923,7 @@ func (v *RichBlockParagraph) MarshalJSON() ([]byte, error) MarshalJSON encodes RichBlockParagraph with the discriminator field "type" forced to "paragraph". The hardcoded value frees callers from setting Type by hand — any user\-supplied value on the struct literal is overridden so a typo can't slip through to Telegram. -### func \(\*RichBlockParagraph\) [UnmarshalJSON]() +### func \(\*RichBlockParagraph\) [UnmarshalJSON]() ```go func (m *RichBlockParagraph) UnmarshalJSON(data []byte) error @@ -14275,7 +14932,7 @@ func (m *RichBlockParagraph) UnmarshalJSON(data []byte) error UnmarshalJSON decodes RichBlockParagraph by dispatching union\-typed fields \(Text\) through their concrete UnmarshalXxx helpers. -## type [RichBlockPhoto]() +## type [RichBlockPhoto]() A block with a photo, corresponding to the HTML tag \. @@ -14293,7 +14950,7 @@ type RichBlockPhoto struct { ``` -### func \(\*RichBlockPhoto\) [MarshalJSON]() +### func \(\*RichBlockPhoto\) [MarshalJSON]() ```go func (v *RichBlockPhoto) MarshalJSON() ([]byte, error) @@ -14302,7 +14959,7 @@ func (v *RichBlockPhoto) MarshalJSON() ([]byte, error) MarshalJSON encodes RichBlockPhoto with the discriminator field "type" forced to "photo". The hardcoded value frees callers from setting Type by hand — any user\-supplied value on the struct literal is overridden so a typo can't slip through to Telegram. -## type [RichBlockPreformatted]() +## type [RichBlockPreformatted]() A preformatted text block, corresponding to the nested HTML tags \ and \. @@ -14318,7 +14975,7 @@ type RichBlockPreformatted struct { ``` -### func \(\*RichBlockPreformatted\) [MarshalJSON]() +### func \(\*RichBlockPreformatted\) [MarshalJSON]() ```go func (v *RichBlockPreformatted) MarshalJSON() ([]byte, error) @@ -14327,7 +14984,7 @@ func (v *RichBlockPreformatted) MarshalJSON() ([]byte, error) MarshalJSON encodes RichBlockPreformatted with the discriminator field "type" forced to "pre". The hardcoded value frees callers from setting Type by hand — any user\-supplied value on the struct literal is overridden so a typo can't slip through to Telegram. -### func \(\*RichBlockPreformatted\) [UnmarshalJSON]() +### func \(\*RichBlockPreformatted\) [UnmarshalJSON]() ```go func (m *RichBlockPreformatted) UnmarshalJSON(data []byte) error @@ -14336,7 +14993,7 @@ func (m *RichBlockPreformatted) UnmarshalJSON(data []byte) error UnmarshalJSON decodes RichBlockPreformatted by dispatching union\-typed fields \(Text\) through their concrete UnmarshalXxx helpers. -## type [RichBlockPullQuotation]() +## type [RichBlockPullQuotation]() A quotation with centered text, loosely corresponding to the HTML tag \. @@ -14352,7 +15009,7 @@ type RichBlockPullQuotation struct { ``` -### func \(\*RichBlockPullQuotation\) [MarshalJSON]() +### func \(\*RichBlockPullQuotation\) [MarshalJSON]() ```go func (v *RichBlockPullQuotation) MarshalJSON() ([]byte, error) @@ -14361,7 +15018,7 @@ func (v *RichBlockPullQuotation) MarshalJSON() ([]byte, error) MarshalJSON encodes RichBlockPullQuotation with the discriminator field "type" forced to "pullquote". The hardcoded value frees callers from setting Type by hand — any user\-supplied value on the struct literal is overridden so a typo can't slip through to Telegram. -### func \(\*RichBlockPullQuotation\) [UnmarshalJSON]() +### func \(\*RichBlockPullQuotation\) [UnmarshalJSON]() ```go func (m *RichBlockPullQuotation) UnmarshalJSON(data []byte) error @@ -14370,7 +15027,7 @@ func (m *RichBlockPullQuotation) UnmarshalJSON(data []byte) error UnmarshalJSON decodes RichBlockPullQuotation by dispatching union\-typed fields \(Text, Credit\) through their concrete UnmarshalXxx helpers. -## type [RichBlockSectionHeading]() +## type [RichBlockSectionHeading]() A section heading, corresponding to the HTML tags \, \, \, \, \, or \. @@ -14386,7 +15043,7 @@ type RichBlockSectionHeading struct { ``` -### func \(\*RichBlockSectionHeading\) [MarshalJSON]() +### func \(\*RichBlockSectionHeading\) [MarshalJSON]() ```go func (v *RichBlockSectionHeading) MarshalJSON() ([]byte, error) @@ -14395,7 +15052,7 @@ func (v *RichBlockSectionHeading) MarshalJSON() ([]byte, error) MarshalJSON encodes RichBlockSectionHeading with the discriminator field "type" forced to "heading". The hardcoded value frees callers from setting Type by hand — any user\-supplied value on the struct literal is overridden so a typo can't slip through to Telegram. -### func \(\*RichBlockSectionHeading\) [UnmarshalJSON]() +### func \(\*RichBlockSectionHeading\) [UnmarshalJSON]() ```go func (m *RichBlockSectionHeading) UnmarshalJSON(data []byte) error @@ -14404,7 +15061,7 @@ func (m *RichBlockSectionHeading) UnmarshalJSON(data []byte) error UnmarshalJSON decodes RichBlockSectionHeading by dispatching union\-typed fields \(Text\) through their concrete UnmarshalXxx helpers. -## type [RichBlockSlideshow]() +## type [RichBlockSlideshow]() A slideshow, corresponding to the custom HTML tag \. @@ -14420,7 +15077,7 @@ type RichBlockSlideshow struct { ``` -### func \(\*RichBlockSlideshow\) [MarshalJSON]() +### func \(\*RichBlockSlideshow\) [MarshalJSON]() ```go func (v *RichBlockSlideshow) MarshalJSON() ([]byte, error) @@ -14429,7 +15086,7 @@ func (v *RichBlockSlideshow) MarshalJSON() ([]byte, error) MarshalJSON encodes RichBlockSlideshow with the discriminator field "type" forced to "slideshow". The hardcoded value frees callers from setting Type by hand — any user\-supplied value on the struct literal is overridden so a typo can't slip through to Telegram. -### func \(\*RichBlockSlideshow\) [UnmarshalJSON]() +### func \(\*RichBlockSlideshow\) [UnmarshalJSON]() ```go func (m *RichBlockSlideshow) UnmarshalJSON(data []byte) error @@ -14438,7 +15095,7 @@ func (m *RichBlockSlideshow) UnmarshalJSON(data []byte) error UnmarshalJSON decodes RichBlockSlideshow by dispatching union\-typed fields \(Blocks\) through their concrete UnmarshalXxx helpers. -## type [RichBlockTable]() +## type [RichBlockTable]() A table, corresponding to the HTML tag \. @@ -14460,7 +15117,7 @@ type RichBlockTable struct { ``` -### func \(\*RichBlockTable\) [MarshalJSON]() +### func \(\*RichBlockTable\) [MarshalJSON]() ```go func (v *RichBlockTable) MarshalJSON() ([]byte, error) @@ -14469,7 +15126,7 @@ func (v *RichBlockTable) MarshalJSON() ([]byte, error) MarshalJSON encodes RichBlockTable with the discriminator field "type" forced to "table". The hardcoded value frees callers from setting Type by hand — any user\-supplied value on the struct literal is overridden so a typo can't slip through to Telegram. -### func \(\*RichBlockTable\) [UnmarshalJSON]() +### func \(\*RichBlockTable\) [UnmarshalJSON]() ```go func (m *RichBlockTable) UnmarshalJSON(data []byte) error @@ -14478,7 +15135,7 @@ func (m *RichBlockTable) UnmarshalJSON(data []byte) error UnmarshalJSON decodes RichBlockTable by dispatching union\-typed fields \(Caption\) through their concrete UnmarshalXxx helpers. -## type [RichBlockTableCell]() +## type [RichBlockTableCell]() Cell in a table. @@ -14500,7 +15157,7 @@ type RichBlockTableCell struct { ``` -### func \(\*RichBlockTableCell\) [UnmarshalJSON]() +### func \(\*RichBlockTableCell\) [UnmarshalJSON]() ```go func (m *RichBlockTableCell) UnmarshalJSON(data []byte) error @@ -14509,7 +15166,7 @@ func (m *RichBlockTableCell) UnmarshalJSON(data []byte) error UnmarshalJSON decodes RichBlockTableCell by dispatching union\-typed fields \(Text\) through their concrete UnmarshalXxx helpers. -## type [RichBlockTableCellValign]() +## type [RichBlockTableCellValign]() @@ -14528,9 +15185,9 @@ const ( ``` -## type [RichBlockThinking]() +## type [RichBlockThinking]() -A block with a “Thinking…” placeholder, corresponding to the custom HTML tag \. The block may be used only in sendRichMessageDraft, therefore it can't be received in messages. See https://t.me/addemoji/AIActions for examples of custom emoji that are recommended for usage in the block. +A block with a “Thinking…” placeholder, corresponding to the custom HTML tag \. The block may be used only in sendRichMessageDraft; therefore, it can't be received in messages. See https://t.me/addemoji/AIActions for examples of custom emoji that are recommended for usage in the block. ```go type RichBlockThinking struct { @@ -14542,7 +15199,7 @@ type RichBlockThinking struct { ``` -### func \(\*RichBlockThinking\) [MarshalJSON]() +### func \(\*RichBlockThinking\) [MarshalJSON]() ```go func (v *RichBlockThinking) MarshalJSON() ([]byte, error) @@ -14551,7 +15208,7 @@ func (v *RichBlockThinking) MarshalJSON() ([]byte, error) MarshalJSON encodes RichBlockThinking with the discriminator field "type" forced to "thinking". The hardcoded value frees callers from setting Type by hand — any user\-supplied value on the struct literal is overridden so a typo can't slip through to Telegram. -### func \(\*RichBlockThinking\) [UnmarshalJSON]() +### func \(\*RichBlockThinking\) [UnmarshalJSON]() ```go func (m *RichBlockThinking) UnmarshalJSON(data []byte) error @@ -14560,7 +15217,7 @@ func (m *RichBlockThinking) UnmarshalJSON(data []byte) error UnmarshalJSON decodes RichBlockThinking by dispatching union\-typed fields \(Text\) through their concrete UnmarshalXxx helpers. -## type [RichBlockType]() +## type [RichBlockType]() @@ -14600,7 +15257,7 @@ const ( ``` -## type [RichBlockVideo]() +## type [RichBlockVideo]() A block with a video, corresponding to the HTML tag \. @@ -14618,7 +15275,7 @@ type RichBlockVideo struct { ``` -### func \(\*RichBlockVideo\) [MarshalJSON]() +### func \(\*RichBlockVideo\) [MarshalJSON]() ```go func (v *RichBlockVideo) MarshalJSON() ([]byte, error) @@ -14627,7 +15284,7 @@ func (v *RichBlockVideo) MarshalJSON() ([]byte, error) MarshalJSON encodes RichBlockVideo with the discriminator field "type" forced to "video". The hardcoded value frees callers from setting Type by hand — any user\-supplied value on the struct literal is overridden so a typo can't slip through to Telegram. -## type [RichBlockVoiceNote]() +## type [RichBlockVoiceNote]() A block with a voice note, corresponding to the HTML tag \. @@ -14643,7 +15300,7 @@ type RichBlockVoiceNote struct { ``` -### func \(\*RichBlockVoiceNote\) [MarshalJSON]() +### func \(\*RichBlockVoiceNote\) [MarshalJSON]() ```go func (v *RichBlockVoiceNote) MarshalJSON() ([]byte, error) @@ -14652,7 +15309,7 @@ func (v *RichBlockVoiceNote) MarshalJSON() ([]byte, error) MarshalJSON encodes RichBlockVoiceNote with the discriminator field "type" forced to "voice\_note". The hardcoded value frees callers from setting Type by hand — any user\-supplied value on the struct literal is overridden so a typo can't slip through to Telegram. -## type [RichMessage]() +## type [RichMessage]() Rich formatted message. @@ -14666,7 +15323,7 @@ type RichMessage struct { ``` -### func \(\*RichMessage\) [UnmarshalJSON]() +### func \(\*RichMessage\) [UnmarshalJSON]() ```go func (m *RichMessage) UnmarshalJSON(data []byte) error @@ -14675,7 +15332,7 @@ func (m *RichMessage) UnmarshalJSON(data []byte) error UnmarshalJSON decodes RichMessage by dispatching union\-typed fields \(Blocks\) through their concrete UnmarshalXxx helpers. -## type [RichMessageButton]() +## type [RichMessageButton]() This 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. @@ -14707,7 +15364,7 @@ type RichMessageButton struct { ``` -### func \(\*RichMessageButton\) [UnmarshalJSON]() +### func \(\*RichMessageButton\) [UnmarshalJSON]() ```go func (m *RichMessageButton) UnmarshalJSON(data []byte) error @@ -14716,7 +15373,7 @@ func (m *RichMessageButton) UnmarshalJSON(data []byte) error UnmarshalJSON decodes RichMessageButton by dispatching union\-typed fields \(Text\) through their concrete UnmarshalXxx helpers. -## type [RichMessageButtonStyle]() +## type [RichMessageButtonStyle]() @@ -14736,7 +15393,7 @@ const ( ``` -## type [RichText]() +## type [RichText]() RichText is a union type. The following concrete variants implement it: @@ -14757,6 +15414,7 @@ RichText is a union type. The following concrete variants implement it: - RichTextEmailAddress - RichTextPhoneNumber - RichTextBankCardNumber +- RichTextTonAddress - RichTextMention - RichTextHashtag - RichTextCashtag @@ -14778,7 +15436,7 @@ type RichText interface { ``` -### func [UnmarshalRichText]() +### func [UnmarshalRichText]() ```go func UnmarshalRichText(data []byte) (RichText, error) @@ -14787,7 +15445,7 @@ func UnmarshalRichText(data []byte) (RichText, error) UnmarshalRichText decodes a RichText from JSON. Telegram documents this type as either a bare JSON string, a JSON array of RichText, or an object dispatched by its "type" field; leading whitespace is trimmed and the first remaining byte selects the shape. -## type [RichTextAnchor]() +## type [RichTextAnchor]() An anchor. @@ -14801,7 +15459,7 @@ type RichTextAnchor struct { ``` -### func \(\*RichTextAnchor\) [MarshalJSON]() +### func \(\*RichTextAnchor\) [MarshalJSON]() ```go func (v *RichTextAnchor) MarshalJSON() ([]byte, error) @@ -14810,7 +15468,7 @@ func (v *RichTextAnchor) MarshalJSON() ([]byte, error) MarshalJSON encodes RichTextAnchor with the discriminator field "type" forced to "anchor". The hardcoded value frees callers from setting Type by hand — any user\-supplied value on the struct literal is overridden so a typo can't slip through to Telegram. -## type [RichTextAnchorLink]() +## type [RichTextAnchorLink]() A link to an anchor. @@ -14820,13 +15478,13 @@ type RichTextAnchorLink struct { Type RichTextType `json:"type"` // The link text Text RichText `json:"text"` - // The name of the anchor. If the name is empty, then the link brings back to the top of the message. + // The name of the anchor. If the name is empty, then the link brings the user back to the top of the message. AnchorName string `json:"anchor_name"` } ``` -### func \(\*RichTextAnchorLink\) [MarshalJSON]() +### func \(\*RichTextAnchorLink\) [MarshalJSON]() ```go func (v *RichTextAnchorLink) MarshalJSON() ([]byte, error) @@ -14835,7 +15493,7 @@ func (v *RichTextAnchorLink) MarshalJSON() ([]byte, error) MarshalJSON encodes RichTextAnchorLink with the discriminator field "type" forced to "anchor\_link". The hardcoded value frees callers from setting Type by hand — any user\-supplied value on the struct literal is overridden so a typo can't slip through to Telegram. -### func \(\*RichTextAnchorLink\) [UnmarshalJSON]() +### func \(\*RichTextAnchorLink\) [UnmarshalJSON]() ```go func (m *RichTextAnchorLink) UnmarshalJSON(data []byte) error @@ -14844,7 +15502,7 @@ func (m *RichTextAnchorLink) UnmarshalJSON(data []byte) error UnmarshalJSON decodes RichTextAnchorLink by dispatching union\-typed fields \(Text\) through their concrete UnmarshalXxx helpers. -## type [RichTextBankCardNumber]() +## type [RichTextBankCardNumber]() A text with a bank card number. @@ -14860,7 +15518,7 @@ type RichTextBankCardNumber struct { ``` -### func \(\*RichTextBankCardNumber\) [MarshalJSON]() +### func \(\*RichTextBankCardNumber\) [MarshalJSON]() ```go func (v *RichTextBankCardNumber) MarshalJSON() ([]byte, error) @@ -14869,7 +15527,7 @@ func (v *RichTextBankCardNumber) MarshalJSON() ([]byte, error) MarshalJSON encodes RichTextBankCardNumber with the discriminator field "type" forced to "bank\_card\_number". The hardcoded value frees callers from setting Type by hand — any user\-supplied value on the struct literal is overridden so a typo can't slip through to Telegram. -### func \(\*RichTextBankCardNumber\) [UnmarshalJSON]() +### func \(\*RichTextBankCardNumber\) [UnmarshalJSON]() ```go func (m *RichTextBankCardNumber) UnmarshalJSON(data []byte) error @@ -14878,7 +15536,7 @@ func (m *RichTextBankCardNumber) UnmarshalJSON(data []byte) error UnmarshalJSON decodes RichTextBankCardNumber by dispatching union\-typed fields \(Text\) through their concrete UnmarshalXxx helpers. -## type [RichTextBold]() +## type [RichTextBold]() A bold text. @@ -14892,7 +15550,7 @@ type RichTextBold struct { ``` -### func \(\*RichTextBold\) [MarshalJSON]() +### func \(\*RichTextBold\) [MarshalJSON]() ```go func (v *RichTextBold) MarshalJSON() ([]byte, error) @@ -14901,7 +15559,7 @@ func (v *RichTextBold) MarshalJSON() ([]byte, error) MarshalJSON encodes RichTextBold with the discriminator field "type" forced to "bold". The hardcoded value frees callers from setting Type by hand — any user\-supplied value on the struct literal is overridden so a typo can't slip through to Telegram. -### func \(\*RichTextBold\) [UnmarshalJSON]() +### func \(\*RichTextBold\) [UnmarshalJSON]() ```go func (m *RichTextBold) UnmarshalJSON(data []byte) error @@ -14910,7 +15568,7 @@ func (m *RichTextBold) UnmarshalJSON(data []byte) error UnmarshalJSON decodes RichTextBold by dispatching union\-typed fields \(Text\) through their concrete UnmarshalXxx helpers. -## type [RichTextBotCommand]() +## type [RichTextBotCommand]() A bot command. @@ -14926,7 +15584,7 @@ type RichTextBotCommand struct { ``` -### func \(\*RichTextBotCommand\) [MarshalJSON]() +### func \(\*RichTextBotCommand\) [MarshalJSON]() ```go func (v *RichTextBotCommand) MarshalJSON() ([]byte, error) @@ -14935,7 +15593,7 @@ func (v *RichTextBotCommand) MarshalJSON() ([]byte, error) MarshalJSON encodes RichTextBotCommand with the discriminator field "type" forced to "bot\_command". The hardcoded value frees callers from setting Type by hand — any user\-supplied value on the struct literal is overridden so a typo can't slip through to Telegram. -### func \(\*RichTextBotCommand\) [UnmarshalJSON]() +### func \(\*RichTextBotCommand\) [UnmarshalJSON]() ```go func (m *RichTextBotCommand) UnmarshalJSON(data []byte) error @@ -14944,7 +15602,7 @@ func (m *RichTextBotCommand) UnmarshalJSON(data []byte) error UnmarshalJSON decodes RichTextBotCommand by dispatching union\-typed fields \(Text\) through their concrete UnmarshalXxx helpers. -## type [RichTextButton]() +## type [RichTextButton]() A button. @@ -14958,7 +15616,7 @@ type RichTextButton struct { ``` -### func \(\*RichTextButton\) [MarshalJSON]() +### func \(\*RichTextButton\) [MarshalJSON]() ```go func (v *RichTextButton) MarshalJSON() ([]byte, error) @@ -14967,7 +15625,7 @@ func (v *RichTextButton) MarshalJSON() ([]byte, error) MarshalJSON encodes RichTextButton with the discriminator field "type" forced to "button". The hardcoded value frees callers from setting Type by hand — any user\-supplied value on the struct literal is overridden so a typo can't slip through to Telegram. -## type [RichTextCashtag]() +## type [RichTextCashtag]() A cashtag. @@ -14983,7 +15641,7 @@ type RichTextCashtag struct { ``` -### func \(\*RichTextCashtag\) [MarshalJSON]() +### func \(\*RichTextCashtag\) [MarshalJSON]() ```go func (v *RichTextCashtag) MarshalJSON() ([]byte, error) @@ -14992,7 +15650,7 @@ func (v *RichTextCashtag) MarshalJSON() ([]byte, error) MarshalJSON encodes RichTextCashtag with the discriminator field "type" forced to "cashtag". The hardcoded value frees callers from setting Type by hand — any user\-supplied value on the struct literal is overridden so a typo can't slip through to Telegram. -### func \(\*RichTextCashtag\) [UnmarshalJSON]() +### func \(\*RichTextCashtag\) [UnmarshalJSON]() ```go func (m *RichTextCashtag) UnmarshalJSON(data []byte) error @@ -15001,7 +15659,7 @@ func (m *RichTextCashtag) UnmarshalJSON(data []byte) error UnmarshalJSON decodes RichTextCashtag by dispatching union\-typed fields \(Text\) through their concrete UnmarshalXxx helpers. -## type [RichTextCode]() +## type [RichTextCode]() A monowidth text. @@ -15015,7 +15673,7 @@ type RichTextCode struct { ``` -### func \(\*RichTextCode\) [MarshalJSON]() +### func \(\*RichTextCode\) [MarshalJSON]() ```go func (v *RichTextCode) MarshalJSON() ([]byte, error) @@ -15024,7 +15682,7 @@ func (v *RichTextCode) MarshalJSON() ([]byte, error) MarshalJSON encodes RichTextCode with the discriminator field "type" forced to "code". The hardcoded value frees callers from setting Type by hand — any user\-supplied value on the struct literal is overridden so a typo can't slip through to Telegram. -### func \(\*RichTextCode\) [UnmarshalJSON]() +### func \(\*RichTextCode\) [UnmarshalJSON]() ```go func (m *RichTextCode) UnmarshalJSON(data []byte) error @@ -15033,7 +15691,7 @@ func (m *RichTextCode) UnmarshalJSON(data []byte) error UnmarshalJSON decodes RichTextCode by dispatching union\-typed fields \(Text\) through their concrete UnmarshalXxx helpers. -## type [RichTextCustomEmoji]() +## type [RichTextCustomEmoji]() A custom emoji. @@ -15049,7 +15707,7 @@ type RichTextCustomEmoji struct { ``` -### func \(\*RichTextCustomEmoji\) [MarshalJSON]() +### func \(\*RichTextCustomEmoji\) [MarshalJSON]() ```go func (v *RichTextCustomEmoji) MarshalJSON() ([]byte, error) @@ -15058,7 +15716,7 @@ func (v *RichTextCustomEmoji) MarshalJSON() ([]byte, error) MarshalJSON encodes RichTextCustomEmoji with the discriminator field "type" forced to "custom\_emoji". The hardcoded value frees callers from setting Type by hand — any user\-supplied value on the struct literal is overridden so a typo can't slip through to Telegram. -## type [RichTextDateTime]() +## type [RichTextDateTime]() Formatted date and time. @@ -15076,7 +15734,7 @@ type RichTextDateTime struct { ``` -### func \(\*RichTextDateTime\) [MarshalJSON]() +### func \(\*RichTextDateTime\) [MarshalJSON]() ```go func (v *RichTextDateTime) MarshalJSON() ([]byte, error) @@ -15085,7 +15743,7 @@ func (v *RichTextDateTime) MarshalJSON() ([]byte, error) MarshalJSON encodes RichTextDateTime with the discriminator field "type" forced to "date\_time". The hardcoded value frees callers from setting Type by hand — any user\-supplied value on the struct literal is overridden so a typo can't slip through to Telegram. -### func \(\*RichTextDateTime\) [UnmarshalJSON]() +### func \(\*RichTextDateTime\) [UnmarshalJSON]() ```go func (m *RichTextDateTime) UnmarshalJSON(data []byte) error @@ -15094,7 +15752,7 @@ func (m *RichTextDateTime) UnmarshalJSON(data []byte) error UnmarshalJSON decodes RichTextDateTime by dispatching union\-typed fields \(Text\) through their concrete UnmarshalXxx helpers. -## type [RichTextEmailAddress]() +## type [RichTextEmailAddress]() A text with an email address. @@ -15110,7 +15768,7 @@ type RichTextEmailAddress struct { ``` -### func \(\*RichTextEmailAddress\) [MarshalJSON]() +### func \(\*RichTextEmailAddress\) [MarshalJSON]() ```go func (v *RichTextEmailAddress) MarshalJSON() ([]byte, error) @@ -15119,7 +15777,7 @@ func (v *RichTextEmailAddress) MarshalJSON() ([]byte, error) MarshalJSON encodes RichTextEmailAddress with the discriminator field "type" forced to "email\_address". The hardcoded value frees callers from setting Type by hand — any user\-supplied value on the struct literal is overridden so a typo can't slip through to Telegram. -### func \(\*RichTextEmailAddress\) [UnmarshalJSON]() +### func \(\*RichTextEmailAddress\) [UnmarshalJSON]() ```go func (m *RichTextEmailAddress) UnmarshalJSON(data []byte) error @@ -15128,7 +15786,7 @@ func (m *RichTextEmailAddress) UnmarshalJSON(data []byte) error UnmarshalJSON decodes RichTextEmailAddress by dispatching union\-typed fields \(Text\) through their concrete UnmarshalXxx helpers. -## type [RichTextHashtag]() +## type [RichTextHashtag]() A hashtag. @@ -15144,7 +15802,7 @@ type RichTextHashtag struct { ``` -### func \(\*RichTextHashtag\) [MarshalJSON]() +### func \(\*RichTextHashtag\) [MarshalJSON]() ```go func (v *RichTextHashtag) MarshalJSON() ([]byte, error) @@ -15153,7 +15811,7 @@ func (v *RichTextHashtag) MarshalJSON() ([]byte, error) MarshalJSON encodes RichTextHashtag with the discriminator field "type" forced to "hashtag". The hardcoded value frees callers from setting Type by hand — any user\-supplied value on the struct literal is overridden so a typo can't slip through to Telegram. -### func \(\*RichTextHashtag\) [UnmarshalJSON]() +### func \(\*RichTextHashtag\) [UnmarshalJSON]() ```go func (m *RichTextHashtag) UnmarshalJSON(data []byte) error @@ -15162,7 +15820,7 @@ func (m *RichTextHashtag) UnmarshalJSON(data []byte) error UnmarshalJSON decodes RichTextHashtag by dispatching union\-typed fields \(Text\) through their concrete UnmarshalXxx helpers. -## type [RichTextItalic]() +## type [RichTextItalic]() An italicized text. @@ -15176,7 +15834,7 @@ type RichTextItalic struct { ``` -### func \(\*RichTextItalic\) [MarshalJSON]() +### func \(\*RichTextItalic\) [MarshalJSON]() ```go func (v *RichTextItalic) MarshalJSON() ([]byte, error) @@ -15185,7 +15843,7 @@ func (v *RichTextItalic) MarshalJSON() ([]byte, error) MarshalJSON encodes RichTextItalic with the discriminator field "type" forced to "italic". The hardcoded value frees callers from setting Type by hand — any user\-supplied value on the struct literal is overridden so a typo can't slip through to Telegram. -### func \(\*RichTextItalic\) [UnmarshalJSON]() +### func \(\*RichTextItalic\) [UnmarshalJSON]() ```go func (m *RichTextItalic) UnmarshalJSON(data []byte) error @@ -15194,7 +15852,7 @@ func (m *RichTextItalic) UnmarshalJSON(data []byte) error UnmarshalJSON decodes RichTextItalic by dispatching union\-typed fields \(Text\) through their concrete UnmarshalXxx helpers. -## type [RichTextMarked]() +## type [RichTextMarked]() A marked text. @@ -15208,7 +15866,7 @@ type RichTextMarked struct { ``` -### func \(\*RichTextMarked\) [MarshalJSON]() +### func \(\*RichTextMarked\) [MarshalJSON]() ```go func (v *RichTextMarked) MarshalJSON() ([]byte, error) @@ -15217,7 +15875,7 @@ func (v *RichTextMarked) MarshalJSON() ([]byte, error) MarshalJSON encodes RichTextMarked with the discriminator field "type" forced to "marked". The hardcoded value frees callers from setting Type by hand — any user\-supplied value on the struct literal is overridden so a typo can't slip through to Telegram. -### func \(\*RichTextMarked\) [UnmarshalJSON]() +### func \(\*RichTextMarked\) [UnmarshalJSON]() ```go func (m *RichTextMarked) UnmarshalJSON(data []byte) error @@ -15226,7 +15884,7 @@ func (m *RichTextMarked) UnmarshalJSON(data []byte) error UnmarshalJSON decodes RichTextMarked by dispatching union\-typed fields \(Text\) through their concrete UnmarshalXxx helpers. -## type [RichTextMathematicalExpression]() +## type [RichTextMathematicalExpression]() A mathematical expression. @@ -15240,7 +15898,7 @@ type RichTextMathematicalExpression struct { ``` -### func \(\*RichTextMathematicalExpression\) [MarshalJSON]() +### func \(\*RichTextMathematicalExpression\) [MarshalJSON]() ```go func (v *RichTextMathematicalExpression) MarshalJSON() ([]byte, error) @@ -15249,7 +15907,7 @@ func (v *RichTextMathematicalExpression) MarshalJSON() ([]byte, error) MarshalJSON encodes RichTextMathematicalExpression with the discriminator field "type" forced to "mathematical\_expression". The hardcoded value frees callers from setting Type by hand — any user\-supplied value on the struct literal is overridden so a typo can't slip through to Telegram. -## type [RichTextMention]() +## type [RichTextMention]() A mention by a username. @@ -15265,7 +15923,7 @@ type RichTextMention struct { ``` -### func \(\*RichTextMention\) [MarshalJSON]() +### func \(\*RichTextMention\) [MarshalJSON]() ```go func (v *RichTextMention) MarshalJSON() ([]byte, error) @@ -15274,7 +15932,7 @@ func (v *RichTextMention) MarshalJSON() ([]byte, error) MarshalJSON encodes RichTextMention with the discriminator field "type" forced to "mention". The hardcoded value frees callers from setting Type by hand — any user\-supplied value on the struct literal is overridden so a typo can't slip through to Telegram. -### func \(\*RichTextMention\) [UnmarshalJSON]() +### func \(\*RichTextMention\) [UnmarshalJSON]() ```go func (m *RichTextMention) UnmarshalJSON(data []byte) error @@ -15283,7 +15941,7 @@ func (m *RichTextMention) UnmarshalJSON(data []byte) error UnmarshalJSON decodes RichTextMention by dispatching union\-typed fields \(Text\) through their concrete UnmarshalXxx helpers. -## type [RichTextPhoneNumber]() +## type [RichTextPhoneNumber]() A text with a phone number. @@ -15299,7 +15957,7 @@ type RichTextPhoneNumber struct { ``` -### func \(\*RichTextPhoneNumber\) [MarshalJSON]() +### func \(\*RichTextPhoneNumber\) [MarshalJSON]() ```go func (v *RichTextPhoneNumber) MarshalJSON() ([]byte, error) @@ -15308,7 +15966,7 @@ func (v *RichTextPhoneNumber) MarshalJSON() ([]byte, error) MarshalJSON encodes RichTextPhoneNumber with the discriminator field "type" forced to "phone\_number". The hardcoded value frees callers from setting Type by hand — any user\-supplied value on the struct literal is overridden so a typo can't slip through to Telegram. -### func \(\*RichTextPhoneNumber\) [UnmarshalJSON]() +### func \(\*RichTextPhoneNumber\) [UnmarshalJSON]() ```go func (m *RichTextPhoneNumber) UnmarshalJSON(data []byte) error @@ -15317,7 +15975,7 @@ func (m *RichTextPhoneNumber) UnmarshalJSON(data []byte) error UnmarshalJSON decodes RichTextPhoneNumber by dispatching union\-typed fields \(Text\) through their concrete UnmarshalXxx helpers. -## type [RichTextPlain]() +## type [RichTextPlain]() RichTextPlain implements RichText for the bare JSON string wire shape Telegram documents for this union, alongside its object variants. @@ -15328,7 +15986,7 @@ type RichTextPlain struct { ``` -### func \(\*RichTextPlain\) [MarshalJSON]() +### func \(\*RichTextPlain\) [MarshalJSON]() ```go func (v *RichTextPlain) MarshalJSON() ([]byte, error) @@ -15337,7 +15995,7 @@ func (v *RichTextPlain) MarshalJSON() ([]byte, error) MarshalJSON encodes RichTextPlain back to its bare JSON string wire shape. -## type [RichTextReference]() +## type [RichTextReference]() A reference. @@ -15353,7 +16011,7 @@ type RichTextReference struct { ``` -### func \(\*RichTextReference\) [MarshalJSON]() +### func \(\*RichTextReference\) [MarshalJSON]() ```go func (v *RichTextReference) MarshalJSON() ([]byte, error) @@ -15362,7 +16020,7 @@ func (v *RichTextReference) MarshalJSON() ([]byte, error) MarshalJSON encodes RichTextReference with the discriminator field "type" forced to "reference". The hardcoded value frees callers from setting Type by hand — any user\-supplied value on the struct literal is overridden so a typo can't slip through to Telegram. -### func \(\*RichTextReference\) [UnmarshalJSON]() +### func \(\*RichTextReference\) [UnmarshalJSON]() ```go func (m *RichTextReference) UnmarshalJSON(data []byte) error @@ -15371,7 +16029,7 @@ func (m *RichTextReference) UnmarshalJSON(data []byte) error UnmarshalJSON decodes RichTextReference by dispatching union\-typed fields \(Text\) through their concrete UnmarshalXxx helpers. -## type [RichTextReferenceLink]() +## type [RichTextReferenceLink]() A link to a reference. @@ -15387,7 +16045,7 @@ type RichTextReferenceLink struct { ``` -### func \(\*RichTextReferenceLink\) [MarshalJSON]() +### func \(\*RichTextReferenceLink\) [MarshalJSON]() ```go func (v *RichTextReferenceLink) MarshalJSON() ([]byte, error) @@ -15396,7 +16054,7 @@ func (v *RichTextReferenceLink) MarshalJSON() ([]byte, error) MarshalJSON encodes RichTextReferenceLink with the discriminator field "type" forced to "reference\_link". The hardcoded value frees callers from setting Type by hand — any user\-supplied value on the struct literal is overridden so a typo can't slip through to Telegram. -### func \(\*RichTextReferenceLink\) [UnmarshalJSON]() +### func \(\*RichTextReferenceLink\) [UnmarshalJSON]() ```go func (m *RichTextReferenceLink) UnmarshalJSON(data []byte) error @@ -15405,7 +16063,7 @@ func (m *RichTextReferenceLink) UnmarshalJSON(data []byte) error UnmarshalJSON decodes RichTextReferenceLink by dispatching union\-typed fields \(Text\) through their concrete UnmarshalXxx helpers. -## type [RichTextSequence]() +## type [RichTextSequence]() RichTextSequence implements RichText for the JSON array of RichText wire shape Telegram documents for this union, alongside its object variants. @@ -15416,7 +16074,7 @@ type RichTextSequence struct { ``` -### func \(\*RichTextSequence\) [MarshalJSON]() +### func \(\*RichTextSequence\) [MarshalJSON]() ```go func (v *RichTextSequence) MarshalJSON() ([]byte, error) @@ -15425,7 +16083,7 @@ func (v *RichTextSequence) MarshalJSON() ([]byte, error) MarshalJSON encodes RichTextSequence back to its bare JSON array wire shape. -## type [RichTextSpoiler]() +## type [RichTextSpoiler]() A text covered by a spoiler. @@ -15439,7 +16097,7 @@ type RichTextSpoiler struct { ``` -### func \(\*RichTextSpoiler\) [MarshalJSON]() +### func \(\*RichTextSpoiler\) [MarshalJSON]() ```go func (v *RichTextSpoiler) MarshalJSON() ([]byte, error) @@ -15448,7 +16106,7 @@ func (v *RichTextSpoiler) MarshalJSON() ([]byte, error) MarshalJSON encodes RichTextSpoiler with the discriminator field "type" forced to "spoiler". The hardcoded value frees callers from setting Type by hand — any user\-supplied value on the struct literal is overridden so a typo can't slip through to Telegram. -### func \(\*RichTextSpoiler\) [UnmarshalJSON]() +### func \(\*RichTextSpoiler\) [UnmarshalJSON]() ```go func (m *RichTextSpoiler) UnmarshalJSON(data []byte) error @@ -15457,7 +16115,7 @@ func (m *RichTextSpoiler) UnmarshalJSON(data []byte) error UnmarshalJSON decodes RichTextSpoiler by dispatching union\-typed fields \(Text\) through their concrete UnmarshalXxx helpers. -## type [RichTextStrikethrough]() +## type [RichTextStrikethrough]() A strikethrough text. @@ -15471,7 +16129,7 @@ type RichTextStrikethrough struct { ``` -### func \(\*RichTextStrikethrough\) [MarshalJSON]() +### func \(\*RichTextStrikethrough\) [MarshalJSON]() ```go func (v *RichTextStrikethrough) MarshalJSON() ([]byte, error) @@ -15480,7 +16138,7 @@ func (v *RichTextStrikethrough) MarshalJSON() ([]byte, error) MarshalJSON encodes RichTextStrikethrough with the discriminator field "type" forced to "strikethrough". The hardcoded value frees callers from setting Type by hand — any user\-supplied value on the struct literal is overridden so a typo can't slip through to Telegram. -### func \(\*RichTextStrikethrough\) [UnmarshalJSON]() +### func \(\*RichTextStrikethrough\) [UnmarshalJSON]() ```go func (m *RichTextStrikethrough) UnmarshalJSON(data []byte) error @@ -15489,7 +16147,7 @@ func (m *RichTextStrikethrough) UnmarshalJSON(data []byte) error UnmarshalJSON decodes RichTextStrikethrough by dispatching union\-typed fields \(Text\) through their concrete UnmarshalXxx helpers. -## type [RichTextSubscript]() +## type [RichTextSubscript]() A subscript text. @@ -15503,7 +16161,7 @@ type RichTextSubscript struct { ``` -### func \(\*RichTextSubscript\) [MarshalJSON]() +### func \(\*RichTextSubscript\) [MarshalJSON]() ```go func (v *RichTextSubscript) MarshalJSON() ([]byte, error) @@ -15512,7 +16170,7 @@ func (v *RichTextSubscript) MarshalJSON() ([]byte, error) MarshalJSON encodes RichTextSubscript with the discriminator field "type" forced to "subscript". The hardcoded value frees callers from setting Type by hand — any user\-supplied value on the struct literal is overridden so a typo can't slip through to Telegram. -### func \(\*RichTextSubscript\) [UnmarshalJSON]() +### func \(\*RichTextSubscript\) [UnmarshalJSON]() ```go func (m *RichTextSubscript) UnmarshalJSON(data []byte) error @@ -15521,7 +16179,7 @@ func (m *RichTextSubscript) UnmarshalJSON(data []byte) error UnmarshalJSON decodes RichTextSubscript by dispatching union\-typed fields \(Text\) through their concrete UnmarshalXxx helpers. -## type [RichTextSuperscript]() +## type [RichTextSuperscript]() A superscript text. @@ -15535,7 +16193,7 @@ type RichTextSuperscript struct { ``` -### func \(\*RichTextSuperscript\) [MarshalJSON]() +### func \(\*RichTextSuperscript\) [MarshalJSON]() ```go func (v *RichTextSuperscript) MarshalJSON() ([]byte, error) @@ -15544,7 +16202,7 @@ func (v *RichTextSuperscript) MarshalJSON() ([]byte, error) MarshalJSON encodes RichTextSuperscript with the discriminator field "type" forced to "superscript". The hardcoded value frees callers from setting Type by hand — any user\-supplied value on the struct literal is overridden so a typo can't slip through to Telegram. -### func \(\*RichTextSuperscript\) [UnmarshalJSON]() +### func \(\*RichTextSuperscript\) [UnmarshalJSON]() ```go func (m *RichTextSuperscript) UnmarshalJSON(data []byte) error @@ -15553,7 +16211,7 @@ func (m *RichTextSuperscript) UnmarshalJSON(data []byte) error UnmarshalJSON decodes RichTextSuperscript by dispatching union\-typed fields \(Text\) through their concrete UnmarshalXxx helpers. -## type [RichTextTextMention]() +## type [RichTextTextMention]() A mention of a Telegram user by their identifier. @@ -15569,7 +16227,7 @@ type RichTextTextMention struct { ``` -### func \(\*RichTextTextMention\) [MarshalJSON]() +### func \(\*RichTextTextMention\) [MarshalJSON]() ```go func (v *RichTextTextMention) MarshalJSON() ([]byte, error) @@ -15578,7 +16236,7 @@ func (v *RichTextTextMention) MarshalJSON() ([]byte, error) MarshalJSON encodes RichTextTextMention with the discriminator field "type" forced to "text\_mention". The hardcoded value frees callers from setting Type by hand — any user\-supplied value on the struct literal is overridden so a typo can't slip through to Telegram. -### func \(\*RichTextTextMention\) [UnmarshalJSON]() +### func \(\*RichTextTextMention\) [UnmarshalJSON]() ```go func (m *RichTextTextMention) UnmarshalJSON(data []byte) error @@ -15586,8 +16244,42 @@ func (m *RichTextTextMention) UnmarshalJSON(data []byte) error UnmarshalJSON decodes RichTextTextMention by dispatching union\-typed fields \(Text\) through their concrete UnmarshalXxx helpers. + +## type [RichTextTonAddress]() + +An address in the TON blockchain. + +```go +type RichTextTonAddress struct { + // Type of the rich text, always “ton_address” + Type RichTextType `json:"type"` + // Text of the address + Text RichText `json:"text"` + // The address + Address string `json:"address"` +} +``` + + +### func \(\*RichTextTonAddress\) [MarshalJSON]() + +```go +func (v *RichTextTonAddress) MarshalJSON() ([]byte, error) +``` + +MarshalJSON encodes RichTextTonAddress with the discriminator field "type" forced to "ton\_address". The hardcoded value frees callers from setting Type by hand — any user\-supplied value on the struct literal is overridden so a typo can't slip through to Telegram. + + +### func \(\*RichTextTonAddress\) [UnmarshalJSON]() + +```go +func (m *RichTextTonAddress) UnmarshalJSON(data []byte) error +``` + +UnmarshalJSON decodes RichTextTonAddress by dispatching union\-typed fields \(Text\) through their concrete UnmarshalXxx helpers. + -## type [RichTextType]() +## type [RichTextType]() @@ -15616,6 +16308,7 @@ const ( RichTextTypeEmailAddress RichTextType = "email_address" RichTextTypePhoneNumber RichTextType = "phone_number" RichTextTypeBankCardNumber RichTextType = "bank_card_number" + RichTextTypeTonAddress RichTextType = "ton_address" RichTextTypeMention RichTextType = "mention" RichTextTypeHashtag RichTextType = "hashtag" RichTextTypeCashtag RichTextType = "cashtag" @@ -15629,7 +16322,7 @@ const ( ``` -## type [RichTextUnderline]() +## type [RichTextUnderline]() An underlined text. @@ -15643,7 +16336,7 @@ type RichTextUnderline struct { ``` -### func \(\*RichTextUnderline\) [MarshalJSON]() +### func \(\*RichTextUnderline\) [MarshalJSON]() ```go func (v *RichTextUnderline) MarshalJSON() ([]byte, error) @@ -15652,7 +16345,7 @@ func (v *RichTextUnderline) MarshalJSON() ([]byte, error) MarshalJSON encodes RichTextUnderline with the discriminator field "type" forced to "underline". The hardcoded value frees callers from setting Type by hand — any user\-supplied value on the struct literal is overridden so a typo can't slip through to Telegram. -### func \(\*RichTextUnderline\) [UnmarshalJSON]() +### func \(\*RichTextUnderline\) [UnmarshalJSON]() ```go func (m *RichTextUnderline) UnmarshalJSON(data []byte) error @@ -15661,7 +16354,7 @@ func (m *RichTextUnderline) UnmarshalJSON(data []byte) error UnmarshalJSON decodes RichTextUnderline by dispatching union\-typed fields \(Text\) through their concrete UnmarshalXxx helpers. -## type [RichTextUrl]() +## type [RichTextUrl]() A text with a link. @@ -15677,7 +16370,7 @@ type RichTextUrl struct { ``` -### func \(\*RichTextUrl\) [MarshalJSON]() +### func \(\*RichTextUrl\) [MarshalJSON]() ```go func (v *RichTextUrl) MarshalJSON() ([]byte, error) @@ -15686,7 +16379,7 @@ func (v *RichTextUrl) MarshalJSON() ([]byte, error) MarshalJSON encodes RichTextUrl with the discriminator field "type" forced to "url". The hardcoded value frees callers from setting Type by hand — any user\-supplied value on the struct literal is overridden so a typo can't slip through to Telegram. -### func \(\*RichTextUrl\) [UnmarshalJSON]() +### func \(\*RichTextUrl\) [UnmarshalJSON]() ```go func (m *RichTextUrl) UnmarshalJSON(data []byte) error @@ -15695,7 +16388,7 @@ func (m *RichTextUrl) UnmarshalJSON(data []byte) error UnmarshalJSON decodes RichTextUrl by dispatching union\-typed fields \(Text\) through their concrete UnmarshalXxx helpers. -## type [SavePreparedInlineMessageParams]() +## type [SavePreparedInlineMessageParams]() SavePreparedInlineMessageParams is the parameter set for SavePreparedInlineMessage. @@ -15719,7 +16412,7 @@ type SavePreparedInlineMessageParams struct { ``` -## type [SavePreparedKeyboardButtonParams]() +## type [SavePreparedKeyboardButtonParams]() SavePreparedKeyboardButtonParams is the parameter set for SavePreparedKeyboardButton. @@ -15735,18 +16428,18 @@ type SavePreparedKeyboardButtonParams struct { ``` -## type [SendAnimationParams]() +## type [SendAnimationParams]() SendAnimationParams is the parameter set for SendAnimation. -Use 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 in the future. +Use 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 in the future. ```go type SendAnimationParams struct { // Unique identifier of the business connection on behalf of which the message will be sent BusinessConnectionID string `json:"business_connection_id,omitempty"` - // Unique identifier for the target chat or username of the target bot, supergroup or channel in the format @username - ChatID ChatID `json:"chat_id"` + // Unique identifier for the target chat or username of the target bot, supergroup, or channel in the format @username; required unless the message is sent as an ephemeral reply to a callback query + ChatID *ChatID `json:"chat_id,omitempty"` // Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only MessageThreadID *int64 `json:"message_thread_id,omitempty"` // Identifier of the direct messages topic to which the message will be sent; required if the message is sent to a direct messages chat @@ -15761,9 +16454,9 @@ type SendAnimationParams struct { Width *int64 `json:"width,omitempty"` // Animation height Height *int64 `json:"height,omitempty"` - // Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass “attach://” if the thumbnail was uploaded using multipart/form-data under . More information on Sending Files » + // Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can only be uploaded as a new file, so you can pass “attach://” if the thumbnail was uploaded using multipart/form-data under . More information on Sending Files » Thumbnail *InputFile `json:"thumbnail,omitempty"` - // Animation caption (may also be used when resending animation by file_id), 0-1024 characters after entities parsing + // Animation caption (may also be used when resending animations by file_id), 0-1024 characters after entities parsing Caption string `json:"caption,omitempty"` // Mode for parsing entities in the animation caption. See formatting options for more details. ParseMode ParseMode `json:"parse_mode,omitempty"` @@ -15791,7 +16484,7 @@ type SendAnimationParams struct { ``` -### func \(\*SendAnimationParams\) [HasFile]() +### func \(\*SendAnimationParams\) [HasFile]() ```go func (p *SendAnimationParams) HasFile() bool @@ -15800,7 +16493,7 @@ func (p *SendAnimationParams) HasFile() bool HasFile reports whether a multipart upload is required. -### func \(\*SendAnimationParams\) [MultipartFields]() +### func \(\*SendAnimationParams\) [MultipartFields]() ```go func (p *SendAnimationParams) MultipartFields() map[string]string @@ -15809,7 +16502,7 @@ func (p *SendAnimationParams) MultipartFields() map[string]string MultipartFields returns the non\-file fields used in the multipart body. -### func \(\*SendAnimationParams\) [MultipartFiles]() +### func \(\*SendAnimationParams\) [MultipartFiles]() ```go func (p *SendAnimationParams) MultipartFiles() []client.MultipartFile @@ -15818,18 +16511,18 @@ func (p *SendAnimationParams) MultipartFiles() []client.MultipartFile MultipartFiles returns the file parts. -## type [SendAudioParams]() +## type [SendAudioParams]() SendAudioParams is the parameter set for SendAudio. -Use 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 audio files of up to 50 MB in size, this limit may be changed in the future. For sending voice messages, use the sendVoice method instead. +Use 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 audio files of up to 50 MB in size; this limit may be changed in the future. For sending voice messages, use the sendVoice method instead. ```go type SendAudioParams struct { // Unique identifier of the business connection on behalf of which the message will be sent BusinessConnectionID string `json:"business_connection_id,omitempty"` - // Unique identifier for the target chat or username of the target bot, supergroup or channel in the format @username - ChatID ChatID `json:"chat_id"` + // Unique identifier for the target chat or username of the target bot, supergroup, or channel in the format @username; required unless the message is sent as an ephemeral reply to a callback query + ChatID *ChatID `json:"chat_id,omitempty"` // Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only MessageThreadID *int64 `json:"message_thread_id,omitempty"` // Identifier of the direct messages topic to which the message will be sent; required if the message is sent to a direct messages chat @@ -15850,7 +16543,7 @@ type SendAudioParams struct { Performer string `json:"performer,omitempty"` // Track name Title string `json:"title,omitempty"` - // Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass “attach://” if the thumbnail was uploaded using multipart/form-data under . More information on Sending Files » + // Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can only be uploaded as a new file, so you can pass “attach://” if the thumbnail was uploaded using multipart/form-data under . More information on Sending Files » Thumbnail *InputFile `json:"thumbnail,omitempty"` // Sends the message silently. Users will receive a notification with no sound. DisableNotification *bool `json:"disable_notification,omitempty"` @@ -15870,7 +16563,7 @@ type SendAudioParams struct { ``` -### func \(\*SendAudioParams\) [HasFile]() +### func \(\*SendAudioParams\) [HasFile]() ```go func (p *SendAudioParams) HasFile() bool @@ -15879,7 +16572,7 @@ func (p *SendAudioParams) HasFile() bool HasFile reports whether a multipart upload is required. -### func \(\*SendAudioParams\) [MultipartFields]() +### func \(\*SendAudioParams\) [MultipartFields]() ```go func (p *SendAudioParams) MultipartFields() map[string]string @@ -15888,7 +16581,7 @@ func (p *SendAudioParams) MultipartFields() map[string]string MultipartFields returns the non\-file fields used in the multipart body. -### func \(\*SendAudioParams\) [MultipartFiles]() +### func \(\*SendAudioParams\) [MultipartFiles]() ```go func (p *SendAudioParams) MultipartFiles() []client.MultipartFile @@ -15897,7 +16590,7 @@ func (p *SendAudioParams) MultipartFiles() []client.MultipartFile MultipartFiles returns the file parts. -## type [SendChatActionParams]() +## type [SendChatActionParams]() SendChatActionParams is the parameter set for SendChatAction. @@ -15917,7 +16610,7 @@ type SendChatActionParams struct { ``` -## type [SendChatJoinRequestWebAppParams]() +## type [SendChatJoinRequestWebAppParams]() SendChatJoinRequestWebAppParams is the parameter set for SendChatJoinRequestWebApp. @@ -15933,7 +16626,7 @@ type SendChatJoinRequestWebAppParams struct { ``` -## type [SendChecklistParams]() +## type [SendChecklistParams]() SendChecklistParams is the parameter set for SendChecklist. @@ -15961,7 +16654,7 @@ type SendChecklistParams struct { ``` -## type [SendContactParams]() +## type [SendContactParams]() SendContactParams is the parameter set for SendContact. @@ -15971,8 +16664,8 @@ Use this method to send phone contacts. On success, the sent Message is returned type SendContactParams struct { // Unique identifier of the business connection on behalf of which the message will be sent BusinessConnectionID string `json:"business_connection_id,omitempty"` - // Unique identifier for the target chat or username of the target bot, supergroup or channel in the format @username - ChatID ChatID `json:"chat_id"` + // Unique identifier for the target chat or username of the target bot, supergroup, or channel in the format @username; required unless the message is sent as an ephemeral reply to a callback query + ChatID *ChatID `json:"chat_id,omitempty"` // Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only MessageThreadID *int64 `json:"message_thread_id,omitempty"` // Identifier of the direct messages topic to which the message will be sent; required if the message is sent to a direct messages chat @@ -16005,7 +16698,7 @@ type SendContactParams struct { ``` -## type [SendDiceParams]() +## type [SendDiceParams]() SendDiceParams is the parameter set for SendDice. @@ -16015,7 +16708,7 @@ Use this method to send an animated emoji that will display a random value. On s type SendDiceParams struct { // Unique identifier of the business connection on behalf of which the message will be sent BusinessConnectionID string `json:"business_connection_id,omitempty"` - // Unique identifier for the target chat or username of the target bot, supergroup or channel in the format @username + // Unique identifier for the target chat or username of the target bot, supergroup, or channel in the format @username ChatID ChatID `json:"chat_id"` // Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only MessageThreadID *int64 `json:"message_thread_id,omitempty"` @@ -16041,18 +16734,18 @@ type SendDiceParams struct { ``` -## type [SendDocumentParams]() +## type [SendDocumentParams]() SendDocumentParams is the parameter set for SendDocument. -Use 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. +Use 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. ```go type SendDocumentParams struct { // Unique identifier of the business connection on behalf of which the message will be sent BusinessConnectionID string `json:"business_connection_id,omitempty"` - // Unique identifier for the target chat or username of the target bot, supergroup or channel in the format @username - ChatID ChatID `json:"chat_id"` + // Unique identifier for the target chat or username of the target bot, supergroup, or channel in the format @username; required unless the message is sent as an ephemeral reply to a callback query + ChatID *ChatID `json:"chat_id,omitempty"` // Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only MessageThreadID *int64 `json:"message_thread_id,omitempty"` // Identifier of the direct messages topic to which the message will be sent; required if the message is sent to a direct messages chat @@ -16061,7 +16754,7 @@ type SendDocumentParams struct { EphemeralMessageParameters *EphemeralMessageParameters `json:"ephemeral_message_parameters,omitempty"` // File to send. Pass a file_id as String to send a file that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get a file from the Internet, or upload a new one using multipart/form-data. More information on Sending Files » Document *InputFile `json:"document"` - // Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass “attach://” if the thumbnail was uploaded using multipart/form-data under . More information on Sending Files » + // Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can only be uploaded as a new file, so you can pass “attach://” if the thumbnail was uploaded using multipart/form-data under . More information on Sending Files » Thumbnail *InputFile `json:"thumbnail,omitempty"` // Document caption (may also be used when resending documents by file_id), 0-1024 characters after entities parsing Caption string `json:"caption,omitempty"` @@ -16089,7 +16782,7 @@ type SendDocumentParams struct { ``` -### func \(\*SendDocumentParams\) [HasFile]() +### func \(\*SendDocumentParams\) [HasFile]() ```go func (p *SendDocumentParams) HasFile() bool @@ -16098,7 +16791,7 @@ func (p *SendDocumentParams) HasFile() bool HasFile reports whether a multipart upload is required. -### func \(\*SendDocumentParams\) [MultipartFields]() +### func \(\*SendDocumentParams\) [MultipartFields]() ```go func (p *SendDocumentParams) MultipartFields() map[string]string @@ -16107,7 +16800,7 @@ func (p *SendDocumentParams) MultipartFields() map[string]string MultipartFields returns the non\-file fields used in the multipart body. -### func \(\*SendDocumentParams\) [MultipartFiles]() +### func \(\*SendDocumentParams\) [MultipartFiles]() ```go func (p *SendDocumentParams) MultipartFiles() []client.MultipartFile @@ -16116,7 +16809,7 @@ func (p *SendDocumentParams) MultipartFiles() []client.MultipartFile MultipartFiles returns the file parts. -## type [SendGameParams]() +## type [SendGameParams]() SendGameParams is the parameter set for SendGame. @@ -16148,7 +16841,7 @@ type SendGameParams struct { ``` -## type [SendGiftParams]() +## type [SendGiftParams]() SendGiftParams is the parameter set for SendGift. @@ -16158,7 +16851,7 @@ Sends a gift to the given user or channel chat. The gift can't be converted to T type SendGiftParams struct { // Required if chat_id is not specified. Unique identifier of the target user who will receive the gift. UserID *int64 `json:"user_id,omitempty"` - // Required if user_id is not specified. Unique identifier for the chat or username of the channel (in the format @username) that will receive the gift. + // Required if user_id is not specified. Unique identifier for the chat that will receive the gift or username of the channel in the format @username. ChatID *ChatID `json:"chat_id,omitempty"` // Identifier of the gift; limited gifts can't be sent to channel chats GiftID string `json:"gift_id"` @@ -16174,7 +16867,7 @@ type SendGiftParams struct { ``` -## type [SendInvoiceParams]() +## type [SendInvoiceParams]() SendInvoiceParams is the parameter set for SendInvoice. @@ -16182,7 +16875,7 @@ Use this method to send invoices. On success, the sent Message is returned. ```go type SendInvoiceParams struct { - // Unique identifier for the target chat or username of the target bot, supergroup or channel in the format @username + // Unique identifier for the target chat or username of the target bot, supergroup, or channel in the format @username ChatID ChatID `json:"chat_id"` // Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only MessageThreadID *int64 `json:"message_thread_id,omitempty"` @@ -16192,7 +16885,7 @@ type SendInvoiceParams struct { Title string `json:"title"` // Product description, 1-255 characters Description string `json:"description"` - // Bot-defined invoice payload, 1-128 bytes. This will not be displayed to the user, use it for your internal processes. + // Bot-defined invoice payload, 1-128 bytes. This will not be displayed to the user; use it for your internal processes. Payload string `json:"payload"` // Payment provider token, obtained via @BotFather. Pass an empty string for payments in Telegram Stars. ProviderToken string `json:"provider_token,omitempty"` @@ -16200,13 +16893,13 @@ type SendInvoiceParams struct { Currency string `json:"currency"` // Price breakdown, a JSON-serialized list of components (e.g. product price, tax, discount, delivery cost, delivery tax, bonus, etc.). Must contain exactly one item for payments in Telegram Stars. Prices []LabeledPrice `json:"prices"` - // The maximum accepted amount for tips in the smallest units of the currency (integer, not float/double). For example, for a maximum tip of US$ 1.45 pass max_tip_amount = 145. See the exp parameter in currencies.json, it shows the number of digits past the decimal point for each currency (2 for the majority of currencies). Defaults to 0. Not supported for payments in Telegram Stars. + // The maximum accepted amount for tips in the smallest units of the currency (integer, not float/double). For example, for a maximum tip of US$ 1.45 pass max_tip_amount = 145. See the exp parameter in currencies.json; it shows the number of digits past the decimal point for each currency (2 for the majority of currencies). Defaults to 0. Not supported for payments in Telegram Stars. MaxTipAmount *int64 `json:"max_tip_amount,omitempty"` - // A JSON-serialized Array of suggested amounts of tips in the smallest units of the currency (integer, not float/double). At most 4 suggested tip amounts can be specified. The suggested tip amounts must be positive, passed in a strictly increased order and must not exceed max_tip_amount. + // A JSON-serialized Array of suggested amounts of tips in the smallest units of the currency (integer, not float/double). At most 4 suggested tip amounts can be specified. The suggested tip amounts must be positive, passed in a strictly increasing order and must not exceed max_tip_amount. SuggestedTipAmounts []int64 `json:"suggested_tip_amounts,omitempty"` // Unique deep-linking parameter. If left empty, forwarded copies of the sent message will have a Pay button, allowing multiple users to pay directly from the forwarded message, using the same invoice. If non-empty, forwarded copies of the sent message will have a URL button with a deep link to the bot (instead of a Pay button), with the value used as the start parameter. StartParameter string `json:"start_parameter,omitempty"` - // JSON-serialized data about the invoice, which will be shared with the payment provider. A detailed description of required fields should be provided by the payment provider. + // JSON-serialized data about the invoice, which will be shared with the payment provider. A detailed description of the required fields should be provided by the payment provider. ProviderData string `json:"provider_data,omitempty"` // URL of the product photo for the invoice. Can be a photo of the goods or a marketing image for a service. People like it better when they see what they are paying for. PhotoURL string `json:"photo_url,omitempty"` @@ -16248,7 +16941,7 @@ type SendInvoiceParams struct { ``` -## type [SendLivePhotoParams]() +## type [SendLivePhotoParams]() SendLivePhotoParams is the parameter set for SendLivePhoto. @@ -16258,8 +16951,8 @@ Use this method to send live photos. On success, the sent Message is returned. type SendLivePhotoParams struct { // Unique identifier of the business connection on behalf of which the message will be sent BusinessConnectionID string `json:"business_connection_id,omitempty"` - // Unique identifier for the target chat or username of the target channel (in the format @channelusername) - ChatID ChatID `json:"chat_id"` + // Unique identifier for the target chat or username of the target bot, supergroup, or channel in the format @username; required unless the message is sent as an ephemeral reply to a callback query + ChatID *ChatID `json:"chat_id,omitempty"` // Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only MessageThreadID *int64 `json:"message_thread_id,omitempty"` // Identifier of the direct messages topic to which the message will be sent; required if the message is sent to a direct messages chat @@ -16268,17 +16961,17 @@ type SendLivePhotoParams struct { EphemeralMessageParameters *EphemeralMessageParameters `json:"ephemeral_message_parameters,omitempty"` // Live photo video to send. The video must be no longer than 10 seconds and must not exceed 10 MB in size. Pass a file_id as String to send a video that exists on the Telegram servers (recommended) or upload a new video using multipart/form-data. More information on Sending Files ». Sending live photos by a URL is currently unsupported. LivePhoto *InputFile `json:"live_photo"` - // The static photo to send. Pass a file_id as String to send a photo that exists on the Telegram servers (recommended) or upload a new video using multipart/form-data. More information on Sending Files ». Sending live photos by a URL is currently unsupported. + // The static photo to send. Pass a file_id as String to send a photo that exists on the Telegram servers (recommended) or upload a new photo using multipart/form-data. More information on Sending Files ». Sending live photos by a URL is currently unsupported. Photo *InputFile `json:"photo"` - // Video caption (may also be used when resending videos by file_id), 0-1024 characters after entities parsing + // Live photo caption (may also be used when resending live photos by file_id), 0-1024 characters after entities parsing Caption string `json:"caption,omitempty"` - // Mode for parsing entities in the video caption. See formatting options for more details. + // Mode for parsing entities in the live photo caption. See formatting options for more details. ParseMode ParseMode `json:"parse_mode,omitempty"` // A JSON-serialized list of special entities that appear in the caption, which can be specified instead of parse_mode CaptionEntities []MessageEntity `json:"caption_entities,omitempty"` // Pass True if the caption must be shown above the message media ShowCaptionAboveMedia *bool `json:"show_caption_above_media,omitempty"` - // Pass True if the video needs to be covered with a spoiler animation + // Pass True if the live photo needs to be covered with a spoiler animation HasSpoiler *bool `json:"has_spoiler,omitempty"` // Sends the message silently. Users will receive a notification with no sound. DisableNotification *bool `json:"disable_notification,omitempty"` @@ -16298,7 +16991,7 @@ type SendLivePhotoParams struct { ``` -### func \(\*SendLivePhotoParams\) [HasFile]() +### func \(\*SendLivePhotoParams\) [HasFile]() ```go func (p *SendLivePhotoParams) HasFile() bool @@ -16307,7 +17000,7 @@ func (p *SendLivePhotoParams) HasFile() bool HasFile reports whether a multipart upload is required. -### func \(\*SendLivePhotoParams\) [MultipartFields]() +### func \(\*SendLivePhotoParams\) [MultipartFields]() ```go func (p *SendLivePhotoParams) MultipartFields() map[string]string @@ -16316,7 +17009,7 @@ func (p *SendLivePhotoParams) MultipartFields() map[string]string MultipartFields returns the non\-file fields used in the multipart body. -### func \(\*SendLivePhotoParams\) [MultipartFiles]() +### func \(\*SendLivePhotoParams\) [MultipartFiles]() ```go func (p *SendLivePhotoParams) MultipartFiles() []client.MultipartFile @@ -16325,18 +17018,18 @@ func (p *SendLivePhotoParams) MultipartFiles() []client.MultipartFile MultipartFiles returns the file parts. -## type [SendLocationParams]() +## type [SendLocationParams]() SendLocationParams is the parameter set for SendLocation. -Use this method to send point on the map. On success, the sent Message is returned. +Use this method to send a point on the map. On success, the sent Message is returned. ```go type SendLocationParams struct { // Unique identifier of the business connection on behalf of which the message will be sent BusinessConnectionID string `json:"business_connection_id,omitempty"` - // Unique identifier for the target chat or username of the target bot, supergroup or channel in the format @username - ChatID ChatID `json:"chat_id"` + // Unique identifier for the target chat or username of the target bot, supergroup, or channel in the format @username; required unless the message is sent as an ephemeral reply to a callback query + ChatID *ChatID `json:"chat_id,omitempty"` // Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only MessageThreadID *int64 `json:"message_thread_id,omitempty"` // Identifier of the direct messages topic to which the message will be sent; required if the message is sent to a direct messages chat @@ -16373,17 +17066,17 @@ type SendLocationParams struct { ``` -## type [SendMediaGroupParams]() +## type [SendMediaGroupParams]() SendMediaGroupParams is the parameter set for SendMediaGroup. -Use 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 objects that were sent is returned. +Use this method to send a group of photos, live photos, videos, documents or audios as an album. Documents and audio files can only be grouped in an album with messages of the same type. On success, an Array of Message objects that were sent is returned. ```go type SendMediaGroupParams struct { // Unique identifier of the business connection on behalf of which the message will be sent BusinessConnectionID string `json:"business_connection_id,omitempty"` - // Unique identifier for the target chat or username of the target bot, supergroup or channel in the format @username + // Unique identifier for the target chat or username of the target bot, supergroup, or channel in the format @username ChatID ChatID `json:"chat_id"` // Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only MessageThreadID *int64 `json:"message_thread_id,omitempty"` @@ -16405,7 +17098,7 @@ type SendMediaGroupParams struct { ``` -### func \(\*SendMediaGroupParams\) [HasFile]() +### func \(\*SendMediaGroupParams\) [HasFile]() ```go func (p *SendMediaGroupParams) HasFile() bool @@ -16414,7 +17107,7 @@ func (p *SendMediaGroupParams) HasFile() bool HasFile reports whether a multipart upload is required. -### func \(\*SendMediaGroupParams\) [MultipartFields]() +### func \(\*SendMediaGroupParams\) [MultipartFields]() ```go func (p *SendMediaGroupParams) MultipartFields() map[string]string @@ -16423,7 +17116,7 @@ func (p *SendMediaGroupParams) MultipartFields() map[string]string MultipartFields returns the non\-file fields used in the multipart body. -### func \(\*SendMediaGroupParams\) [MultipartFiles]() +### func \(\*SendMediaGroupParams\) [MultipartFiles]() ```go func (p *SendMediaGroupParams) MultipartFiles() []client.MultipartFile @@ -16432,7 +17125,7 @@ func (p *SendMediaGroupParams) MultipartFiles() []client.MultipartFile MultipartFiles returns the file parts. -## type [SendMessageDraftParams]() +## type [SendMessageDraftParams]() SendMessageDraftParams is the parameter set for SendMessageDraft. @@ -16470,8 +17163,8 @@ Use this method to send text messages. On success, the sent Message is returned. type SendMessageParams struct { // Unique identifier of the business connection on behalf of which the message will be sent BusinessConnectionID string `json:"business_connection_id,omitempty"` - // Unique identifier for the target chat or username of the target bot, supergroup or channel in the format @username - ChatID ChatID `json:"chat_id"` + // Unique identifier for the target chat or username of the target bot, supergroup, or channel in the format @username; required unless the message is sent as an ephemeral reply to a callback query + ChatID *ChatID `json:"chat_id,omitempty"` // Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only MessageThreadID *int64 `json:"message_thread_id,omitempty"` // Identifier of the direct messages topic to which the message will be sent; required if the message is sent to a direct messages chat @@ -16504,7 +17197,7 @@ type SendMessageParams struct { ``` -## type [SendPaidMediaParams]() +## type [SendPaidMediaParams]() SendPaidMediaParams is the parameter set for SendPaidMedia. @@ -16514,7 +17207,7 @@ Use this method to send paid media. On success, the sent Message is returned. type SendPaidMediaParams struct { // Unique identifier of the business connection on behalf of which the message will be sent BusinessConnectionID string `json:"business_connection_id,omitempty"` - // Unique identifier for the target chat or username of the target bot, supergroup or channel in the format @username. If the chat is a channel, all Telegram Star proceeds from this media will be credited to the chat's balance. Otherwise, they will be credited to the bot's balance. + // Unique identifier for the target chat or username of the target bot, supergroup, or channel in the format @username. If the chat is a channel, all Telegram Star proceeds from this media will be credited to the chat's balance. Otherwise, they will be credited to the bot's balance. ChatID ChatID `json:"chat_id"` // Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only MessageThreadID *int64 `json:"message_thread_id,omitempty"` @@ -16524,7 +17217,7 @@ type SendPaidMediaParams struct { StarCount int64 `json:"star_count"` // A JSON-serialized Array describing the media to be sent; up to 10 items Media []InputPaidMedia `json:"media"` - // Bot-defined paid media payload, 0-128 bytes. This will not be displayed to the user, use it for your internal processes. + // Bot-defined paid media payload, 0-128 bytes. This will not be displayed to the user; use it for your internal processes. Payload string `json:"payload,omitempty"` // Media caption, 0-1024 characters after entities parsing Caption string `json:"caption,omitempty"` @@ -16550,7 +17243,7 @@ type SendPaidMediaParams struct { ``` -### func \(\*SendPaidMediaParams\) [HasFile]() +### func \(\*SendPaidMediaParams\) [HasFile]() ```go func (p *SendPaidMediaParams) HasFile() bool @@ -16559,7 +17252,7 @@ func (p *SendPaidMediaParams) HasFile() bool HasFile reports whether a multipart upload is required. -### func \(\*SendPaidMediaParams\) [MultipartFields]() +### func \(\*SendPaidMediaParams\) [MultipartFields]() ```go func (p *SendPaidMediaParams) MultipartFields() map[string]string @@ -16568,7 +17261,7 @@ func (p *SendPaidMediaParams) MultipartFields() map[string]string MultipartFields returns the non\-file fields used in the multipart body. -### func \(\*SendPaidMediaParams\) [MultipartFiles]() +### func \(\*SendPaidMediaParams\) [MultipartFiles]() ```go func (p *SendPaidMediaParams) MultipartFiles() []client.MultipartFile @@ -16587,8 +17280,8 @@ Use this method to send photos. On success, the sent Message is returned. type SendPhotoParams struct { // Unique identifier of the business connection on behalf of which the message will be sent BusinessConnectionID string `json:"business_connection_id,omitempty"` - // Unique identifier for the target chat or username of the target bot, supergroup or channel in the format @username - ChatID ChatID `json:"chat_id"` + // Unique identifier for the target chat or username of the target bot, supergroup, or channel in the format @username; required unless the message is sent as an ephemeral reply to a callback query + ChatID *ChatID `json:"chat_id,omitempty"` // Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only MessageThreadID *int64 `json:"message_thread_id,omitempty"` // Identifier of the direct messages topic to which the message will be sent; required if the message is sent to a direct messages chat @@ -16643,7 +17336,7 @@ func (p *SendPhotoParams) MultipartFields() map[string]string MultipartFields returns the non\-file fields used in the multipart body. -### func \(\*SendPhotoParams\) [MultipartFiles]() +### func \(\*SendPhotoParams\) [MultipartFiles]() ```go func (p *SendPhotoParams) MultipartFiles() []client.MultipartFile @@ -16652,7 +17345,7 @@ func (p *SendPhotoParams) MultipartFiles() []client.MultipartFile MultipartFiles returns the file parts. -## type [SendPollParams]() +## type [SendPollParams]() SendPollParams is the parameter set for SendPoll. @@ -16662,7 +17355,7 @@ Use this method to send a native poll. On success, the sent Message is returned. type SendPollParams struct { // Unique identifier of the business connection on behalf of which the message will be sent BusinessConnectionID string `json:"business_connection_id,omitempty"` - // Unique identifier for the target chat or username of the target bot, supergroup or channel in the format @username. Polls can't be sent to channel direct messages chats. + // Unique identifier for the target chat or username of the target bot, supergroup, or channel in the format @username. Polls can't be sent to channel direct messages chats. ChatID ChatID `json:"chat_id"` // Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only MessageThreadID *int64 `json:"message_thread_id,omitempty"` @@ -16680,7 +17373,7 @@ type SendPollParams struct { Type string `json:"type,omitempty"` // Pass True if the poll allows multiple answers, defaults to False AllowsMultipleAnswers *bool `json:"allows_multiple_answers,omitempty"` - // Pass True if the poll allows to change chosen answer options, defaults to False for quizzes and to True for regular polls + // Pass True if the poll allows changing the chosen answer options, defaults to False for quizzes and to True for regular polls AllowsRevoting *bool `json:"allows_revoting,omitempty"` // Pass True if the poll options must be shown in random order ShuffleOptions *bool `json:"shuffle_options,omitempty"` @@ -16732,7 +17425,7 @@ type SendPollParams struct { ``` -## type [SendRichMessageDraftParams]() +## type [SendRichMessageDraftParams]() SendRichMessageDraftParams is the parameter set for SendRichMessageDraft. @@ -16746,7 +17439,7 @@ type SendRichMessageDraftParams struct { MessageThreadID *int64 `json:"message_thread_id,omitempty"` // Unique identifier of the message draft; must be non-zero. Changes to drafts with the same identifier are animated. Otherwise, the draft is replaced without animation. DraftID int64 `json:"draft_id"` - // The partial message to be streamed. Direct upload of new files and explicit upload of files by a URL isn't supported. + // The partial message to be streamed. Direct upload of new files and explicit upload of files by a URL aren't supported. RichMessage InputRichMessage `json:"rich_message"` // Pass True to show the user a button to stop further drafts. The bot will receive an Update “stopped_message_generation” if the user presses the button. CanStop *bool `json:"can_stop,omitempty"` @@ -16756,7 +17449,7 @@ type SendRichMessageDraftParams struct { ``` -## type [SendRichMessageParams]() +## type [SendRichMessageParams]() SendRichMessageParams is the parameter set for SendRichMessage. @@ -16764,10 +17457,10 @@ Use this method to send rich messages. If the message contains a block with a me ```go type SendRichMessageParams struct { - // Unique identifier of the business connection on behalf of which the message will be sent. Bot can send rich messages on behalf of a business account only if the corresponding user can send rich messages. + // Unique identifier of the business connection on behalf of which the message will be sent. The bot can send rich messages on behalf of a business account only if the corresponding user can send rich messages. BusinessConnectionID string `json:"business_connection_id,omitempty"` - // Unique identifier for the target chat or username of the target bot, supergroup or channel in the format @username - ChatID ChatID `json:"chat_id"` + // Unique identifier for the target chat or username of the target bot, supergroup, or channel in the format @username; required unless the message is sent as an ephemeral reply to a callback query + ChatID *ChatID `json:"chat_id,omitempty"` // Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only MessageThreadID *int64 `json:"message_thread_id,omitempty"` // Identifier of the direct messages topic to which the message will be sent; required if the message is sent to a direct messages chat @@ -16793,8 +17486,48 @@ type SendRichMessageParams struct { } ``` + +## type [SendSharedWidgetParams]() + +SendSharedWidgetParams is the parameter set for SendSharedWidget. + +Use this method to resend 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 can't be forwarded. On success, the sent Message is returned. + +```go +type SendSharedWidgetParams struct { + // Unique identifier for the target chat or username of the target supergroup in the format @username + ChatID ChatID `json:"chat_id"` + // Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only + MessageThreadID *int64 `json:"message_thread_id,omitempty"` + // Unique identifier of the shared widget + WidgetID string `json:"widget_id"` + // Data of the widget, which is specific to the message, 0-1024 bytes + ChatData string `json:"chat_data,omitempty"` + // Widget caption, 0-1024 characters after entities parsing + Caption string `json:"caption,omitempty"` + // Mode for parsing entities in the widget caption. See formatting options for more details. + ParseMode ParseMode `json:"parse_mode,omitempty"` + // A JSON-serialized list of special entities that appear in the caption, which can be specified instead of parse_mode + CaptionEntities []MessageEntity `json:"caption_entities,omitempty"` + // Pass True if the caption must be shown above the widget + ShowCaptionAboveMedia *bool `json:"show_caption_above_media,omitempty"` + // Sends the message silently. Users will receive a notification with no sound. + DisableNotification *bool `json:"disable_notification,omitempty"` + // Protects the contents of the sent message from forwarding and saving + ProtectContent *bool `json:"protect_content,omitempty"` + // Pass True to allow up to 1000 messages per second, ignoring broadcasting limits for a fee of 0.1 Telegram Stars per message. The relevant Stars will be withdrawn from the bot's balance. + AllowPaidBroadcast *bool `json:"allow_paid_broadcast,omitempty"` + // Unique identifier of the message effect to be added to the message; for private chats only + MessageEffectID string `json:"message_effect_id,omitempty"` + // Description of the message to reply to + ReplyParameters *ReplyParameters `json:"reply_parameters,omitempty"` + // Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove a reply keyboard or to force a reply from the user. + ReplyMarkup any `json:"reply_markup,omitempty"` +} +``` + -## type [SendStickerParams]() +## type [SendStickerParams]() SendStickerParams is the parameter set for SendSticker. @@ -16804,8 +17537,8 @@ Use this method to send static .WEBP, animated .TGS, or video .WEBM stickers. On type SendStickerParams struct { // Unique identifier of the business connection on behalf of which the message will be sent BusinessConnectionID string `json:"business_connection_id,omitempty"` - // Unique identifier for the target chat or username of the target bot, supergroup or channel in the format @username - ChatID ChatID `json:"chat_id"` + // Unique identifier for the target chat or username of the target bot, supergroup, or channel in the format @username; required unless the message is sent as an ephemeral reply to a callback query + ChatID *ChatID `json:"chat_id,omitempty"` // Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only MessageThreadID *int64 `json:"message_thread_id,omitempty"` // Identifier of the direct messages topic to which the message will be sent; required if the message is sent to a direct messages chat @@ -16834,7 +17567,7 @@ type SendStickerParams struct { ``` -### func \(\*SendStickerParams\) [HasFile]() +### func \(\*SendStickerParams\) [HasFile]() ```go func (p *SendStickerParams) HasFile() bool @@ -16843,7 +17576,7 @@ func (p *SendStickerParams) HasFile() bool HasFile reports whether a multipart upload is required. -### func \(\*SendStickerParams\) [MultipartFields]() +### func \(\*SendStickerParams\) [MultipartFields]() ```go func (p *SendStickerParams) MultipartFields() map[string]string @@ -16852,7 +17585,7 @@ func (p *SendStickerParams) MultipartFields() map[string]string MultipartFields returns the non\-file fields used in the multipart body. -### func \(\*SendStickerParams\) [MultipartFiles]() +### func \(\*SendStickerParams\) [MultipartFiles]() ```go func (p *SendStickerParams) MultipartFiles() []client.MultipartFile @@ -16861,7 +17594,7 @@ func (p *SendStickerParams) MultipartFiles() []client.MultipartFile MultipartFiles returns the file parts. -## type [SendVenueParams]() +## type [SendVenueParams]() SendVenueParams is the parameter set for SendVenue. @@ -16871,8 +17604,8 @@ Use this method to send information about a venue. On success, the sent Message type SendVenueParams struct { // Unique identifier of the business connection on behalf of which the message will be sent BusinessConnectionID string `json:"business_connection_id,omitempty"` - // Unique identifier for the target chat or username of the target bot, supergroup or channel in the format @username - ChatID ChatID `json:"chat_id"` + // Unique identifier for the target chat or username of the target bot, supergroup, or channel in the format @username; required unless the message is sent as an ephemeral reply to a callback query + ChatID *ChatID `json:"chat_id,omitempty"` // Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only MessageThreadID *int64 `json:"message_thread_id,omitempty"` // Identifier of the direct messages topic to which the message will be sent; required if the message is sent to a direct messages chat @@ -16913,18 +17646,18 @@ type SendVenueParams struct { ``` -## type [SendVideoNoteParams]() +## type [SendVideoNoteParams]() SendVideoNoteParams is the parameter set for SendVideoNote. -Use this method to send a rounded square MPEG4 video of up to 1 minute long. On success, the sent Message is returned. +Use this method to send a rounded square MPEG4 video up to 1 minute long. On success, the sent Message is returned. ```go type SendVideoNoteParams struct { // Unique identifier of the business connection on behalf of which the message will be sent BusinessConnectionID string `json:"business_connection_id,omitempty"` - // Unique identifier for the target chat or username of the target bot, supergroup or channel in the format @username - ChatID ChatID `json:"chat_id"` + // Unique identifier for the target chat or username of the target bot, supergroup, or channel in the format @username; required unless the message is sent as an ephemeral reply to a callback query + ChatID *ChatID `json:"chat_id,omitempty"` // Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only MessageThreadID *int64 `json:"message_thread_id,omitempty"` // Identifier of the direct messages topic to which the message will be sent; required if the message is sent to a direct messages chat @@ -16937,7 +17670,7 @@ type SendVideoNoteParams struct { Duration *int64 `json:"duration,omitempty"` // Video width and height, i.e. diameter of the video message Length *int64 `json:"length,omitempty"` - // Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass “attach://” if the thumbnail was uploaded using multipart/form-data under . More information on Sending Files » + // Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can only be uploaded as a new file, so you can pass “attach://” if the thumbnail was uploaded using multipart/form-data under . More information on Sending Files » Thumbnail *InputFile `json:"thumbnail,omitempty"` // Sends the message silently. Users will receive a notification with no sound. DisableNotification *bool `json:"disable_notification,omitempty"` @@ -16957,7 +17690,7 @@ type SendVideoNoteParams struct { ``` -### func \(\*SendVideoNoteParams\) [HasFile]() +### func \(\*SendVideoNoteParams\) [HasFile]() ```go func (p *SendVideoNoteParams) HasFile() bool @@ -16966,7 +17699,7 @@ func (p *SendVideoNoteParams) HasFile() bool HasFile reports whether a multipart upload is required. -### func \(\*SendVideoNoteParams\) [MultipartFields]() +### func \(\*SendVideoNoteParams\) [MultipartFields]() ```go func (p *SendVideoNoteParams) MultipartFields() map[string]string @@ -16975,7 +17708,7 @@ func (p *SendVideoNoteParams) MultipartFields() map[string]string MultipartFields returns the non\-file fields used in the multipart body. -### func \(\*SendVideoNoteParams\) [MultipartFiles]() +### func \(\*SendVideoNoteParams\) [MultipartFiles]() ```go func (p *SendVideoNoteParams) MultipartFiles() []client.MultipartFile @@ -16984,18 +17717,18 @@ func (p *SendVideoNoteParams) MultipartFiles() []client.MultipartFile MultipartFiles returns the file parts. -## type [SendVideoParams]() +## type [SendVideoParams]() SendVideoParams is the parameter set for SendVideo. -Use 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, this limit may be changed in the future. +Use 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; this limit may be changed in the future. ```go type SendVideoParams struct { // Unique identifier of the business connection on behalf of which the message will be sent BusinessConnectionID string `json:"business_connection_id,omitempty"` - // Unique identifier for the target chat or username of the target bot, supergroup or channel in the format @username - ChatID ChatID `json:"chat_id"` + // Unique identifier for the target chat or username of the target bot, supergroup, or channel in the format @username; required unless the message is sent as an ephemeral reply to a callback query + ChatID *ChatID `json:"chat_id,omitempty"` // Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only MessageThreadID *int64 `json:"message_thread_id,omitempty"` // Identifier of the direct messages topic to which the message will be sent; required if the message is sent to a direct messages chat @@ -17010,7 +17743,7 @@ type SendVideoParams struct { Width *int64 `json:"width,omitempty"` // Video height Height *int64 `json:"height,omitempty"` - // Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass “attach://” if the thumbnail was uploaded using multipart/form-data under . More information on Sending Files » + // Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can only be uploaded as a new file, so you can pass “attach://” if the thumbnail was uploaded using multipart/form-data under . More information on Sending Files » Thumbnail *InputFile `json:"thumbnail,omitempty"` // Cover for the video in the message. Pass a file_id to send a file that exists on the Telegram servers (recommended), pass an HTTP URL for Telegram to get a file from the Internet, or pass “attach://” to upload a new one using multipart/form-data under name. More information on Sending Files » Cover *InputFile `json:"cover,omitempty"` @@ -17046,7 +17779,7 @@ type SendVideoParams struct { ``` -### func \(\*SendVideoParams\) [HasFile]() +### func \(\*SendVideoParams\) [HasFile]() ```go func (p *SendVideoParams) HasFile() bool @@ -17055,7 +17788,7 @@ func (p *SendVideoParams) HasFile() bool HasFile reports whether a multipart upload is required. -### func \(\*SendVideoParams\) [MultipartFields]() +### func \(\*SendVideoParams\) [MultipartFields]() ```go func (p *SendVideoParams) MultipartFields() map[string]string @@ -17064,7 +17797,7 @@ func (p *SendVideoParams) MultipartFields() map[string]string MultipartFields returns the non\-file fields used in the multipart body. -### func \(\*SendVideoParams\) [MultipartFiles]() +### func \(\*SendVideoParams\) [MultipartFiles]() ```go func (p *SendVideoParams) MultipartFiles() []client.MultipartFile @@ -17073,18 +17806,18 @@ func (p *SendVideoParams) MultipartFiles() []client.MultipartFile MultipartFiles returns the file parts. -## type [SendVoiceParams]() +## type [SendVoiceParams]() SendVoiceParams is the parameter set for SendVoice. -Use 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 format \(other formats may be sent as Audio or Document\). On success, the sent Message is returned. Bots can currently send voice messages of up to 50 MB in size, this limit may be changed in the future. +Use 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 format \(other formats may be sent as Audio or Document\). On success, the sent Message is returned. Bots can currently send voice messages of up to 50 MB in size; this limit may be changed in the future. ```go type SendVoiceParams struct { // Unique identifier of the business connection on behalf of which the message will be sent BusinessConnectionID string `json:"business_connection_id,omitempty"` - // Unique identifier for the target chat or username of the target bot, supergroup or channel in the format @username - ChatID ChatID `json:"chat_id"` + // Unique identifier for the target chat or username of the target bot, supergroup, or channel in the format @username; required unless the message is sent as an ephemeral reply to a callback query + ChatID *ChatID `json:"chat_id,omitempty"` // Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only MessageThreadID *int64 `json:"message_thread_id,omitempty"` // Identifier of the direct messages topic to which the message will be sent; required if the message is sent to a direct messages chat @@ -17119,7 +17852,7 @@ type SendVoiceParams struct { ``` -### func \(\*SendVoiceParams\) [HasFile]() +### func \(\*SendVoiceParams\) [HasFile]() ```go func (p *SendVoiceParams) HasFile() bool @@ -17128,7 +17861,7 @@ func (p *SendVoiceParams) HasFile() bool HasFile reports whether a multipart upload is required. -### func \(\*SendVoiceParams\) [MultipartFields]() +### func \(\*SendVoiceParams\) [MultipartFields]() ```go func (p *SendVoiceParams) MultipartFields() map[string]string @@ -17137,7 +17870,7 @@ func (p *SendVoiceParams) MultipartFields() map[string]string MultipartFields returns the non\-file fields used in the multipart body. -### func \(\*SendVoiceParams\) [MultipartFiles]() +### func \(\*SendVoiceParams\) [MultipartFiles]() ```go func (p *SendVoiceParams) MultipartFiles() []client.MultipartFile @@ -17145,6 +17878,56 @@ func (p *SendVoiceParams) MultipartFiles() []client.MultipartFile MultipartFiles returns the file parts. + +## type [SendWidgetParams]() + +SendWidgetParams is the parameter set for SendWidget. + +Use 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 forwarded. On success, the sent Message is returned. + +```go +type SendWidgetParams struct { + // Unique identifier for the target chat or username of the target supergroup in the format @username + ChatID ChatID `json:"chat_id"` + // Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only + MessageThreadID *int64 `json:"message_thread_id,omitempty"` + // HTML code of the widget, 1-32768 bytes. The code must not exceed 4096 bytes when compressed by zlib with the maximum compression level. + HTML string `json:"html"` + // Width of the widget in logical pixels; omit if the widget must occupy the whole width of the message bubble. The width is clamped by the app to the range from 200 to the maximum width of the message bubble. + Width *int64 `json:"width,omitempty"` + // Height of the widget in logical pixels; omit if the height of the widget isn't fixed. The height is clamped by the app to the range 50-600. + Height *int64 `json:"height,omitempty"` + // Public data of the widget, 0-1024 bytes, which will be available wherever the widget is shown. If the widget is shared, then all messages with it will have the same public data. + PublicData string `json:"public_data,omitempty"` + // Data of the widget, which is specific to the message, 0-1024 bytes + ChatData string `json:"chat_data,omitempty"` + // Widget caption, 0-1024 characters after entities parsing + Caption string `json:"caption,omitempty"` + // Mode for parsing entities in the widget caption. See formatting options for more details. + ParseMode ParseMode `json:"parse_mode,omitempty"` + // A JSON-serialized list of special entities that appear in the caption, which can be specified instead of parse_mode + CaptionEntities []MessageEntity `json:"caption_entities,omitempty"` + // Pass True if the caption must be shown above the widget + ShowCaptionAboveMedia *bool `json:"show_caption_above_media,omitempty"` + // Pass True to allow the widget to send queries to the bot + AllowQueries *bool `json:"allow_queries,omitempty"` + // Pass True to create a shared widget, which can be sent again using the method sendSharedWidget + IsShared *bool `json:"is_shared,omitempty"` + // Sends the message silently. Users will receive a notification with no sound. + DisableNotification *bool `json:"disable_notification,omitempty"` + // Protects the contents of the sent message from forwarding and saving + ProtectContent *bool `json:"protect_content,omitempty"` + // Pass True to allow up to 1000 messages per second, ignoring broadcasting limits for a fee of 0.1 Telegram Stars per message. The relevant Stars will be withdrawn from the bot's balance. + AllowPaidBroadcast *bool `json:"allow_paid_broadcast,omitempty"` + // Unique identifier of the message effect to be added to the message; for private chats only + MessageEffectID string `json:"message_effect_id,omitempty"` + // Description of the message to reply to + ReplyParameters *ReplyParameters `json:"reply_parameters,omitempty"` + // Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove a reply keyboard or to force a reply from the user. + ReplyMarkup any `json:"reply_markup,omitempty"` +} +``` + ## type [Sender]() @@ -17198,7 +17981,7 @@ func (s *Sender) IsAnonymousChannel() bool IsAnonymousChannel reports whether the sender is an anonymous channel post \(Chat differs from the message's own chat\). -## type [SentGuestMessage]() +## type [SentGuestMessage]() Describes an inline message sent by a guest bot. @@ -17210,7 +17993,7 @@ type SentGuestMessage struct { ``` -### func [AnswerGuestQuery]() +### func [AnswerGuestQuery]() ```go func AnswerGuestQuery(ctx context.Context, b *client.Bot, p *AnswerGuestQueryParams) (*SentGuestMessage, error) @@ -17221,7 +18004,7 @@ AnswerGuestQuery calls the answerGuestQuery Telegram Bot API method. Use this method to reply to a received guest message. On success, a SentGuestMessage object is returned. -## type [SentWebAppMessage]() +## type [SentWebAppMessage]() Describes an inline message sent by a Web App on behalf of a user. @@ -17233,7 +18016,7 @@ type SentWebAppMessage struct { ``` -### func [AnswerWebAppQuery]() +### func [AnswerWebAppQuery]() ```go func AnswerWebAppQuery(ctx context.Context, b *client.Bot, p *AnswerWebAppQueryParams) (*SentWebAppMessage, error) @@ -17244,11 +18027,11 @@ AnswerWebAppQuery calls the answerWebAppQuery Telegram Bot API method. Use 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. -## type [SetBusinessAccountBioParams]() +## type [SetBusinessAccountBioParams]() SetBusinessAccountBioParams is the parameter set for SetBusinessAccountBio. -Changes the bio of a managed business account. Requires the can\_change\_bio business bot right. Returns True on success. +Changes the bio of a managed business account. Requires the can\_edit\_bio business bot right. Returns True on success. ```go type SetBusinessAccountBioParams struct { @@ -17260,7 +18043,7 @@ type SetBusinessAccountBioParams struct { ``` -## type [SetBusinessAccountGiftSettingsParams]() +## type [SetBusinessAccountGiftSettingsParams]() SetBusinessAccountGiftSettingsParams is the parameter set for SetBusinessAccountGiftSettings. @@ -17278,11 +18061,11 @@ type SetBusinessAccountGiftSettingsParams struct { ``` -## type [SetBusinessAccountNameParams]() +## type [SetBusinessAccountNameParams]() SetBusinessAccountNameParams is the parameter set for SetBusinessAccountName. -Changes the first and last name of a managed business account. Requires the can\_change\_name business bot right. Returns True on success. +Changes the first and last name of a managed business account. Requires the can\_edit\_name business bot right. Returns True on success. ```go type SetBusinessAccountNameParams struct { @@ -17296,7 +18079,7 @@ type SetBusinessAccountNameParams struct { ``` -## type [SetBusinessAccountProfilePhotoParams]() +## type [SetBusinessAccountProfilePhotoParams]() SetBusinessAccountProfilePhotoParams is the parameter set for SetBusinessAccountProfilePhoto. @@ -17314,11 +18097,11 @@ type SetBusinessAccountProfilePhotoParams struct { ``` -## type [SetBusinessAccountUsernameParams]() +## type [SetBusinessAccountUsernameParams]() SetBusinessAccountUsernameParams is the parameter set for SetBusinessAccountUsername. -Changes the username of a managed business account. Requires the can\_change\_username business bot right. Returns True on success. +Changes the username of a managed business account. Requires the can\_edit\_username business bot right. Returns True on success. ```go type SetBusinessAccountUsernameParams struct { @@ -17330,7 +18113,7 @@ type SetBusinessAccountUsernameParams struct { ``` -## type [SetChatAdministratorCustomTitleParams]() +## type [SetChatAdministratorCustomTitleParams]() SetChatAdministratorCustomTitleParams is the parameter set for SetChatAdministratorCustomTitle. @@ -17348,7 +18131,7 @@ type SetChatAdministratorCustomTitleParams struct { ``` -## type [SetChatDescriptionParams]() +## type [SetChatDescriptionParams]() SetChatDescriptionParams is the parameter set for SetChatDescription. @@ -17364,7 +18147,7 @@ type SetChatDescriptionParams struct { ``` -## type [SetChatMemberTagParams]() +## type [SetChatMemberTagParams]() SetChatMemberTagParams is the parameter set for SetChatMemberTag. @@ -17382,7 +18165,7 @@ type SetChatMemberTagParams struct { ``` -## type [SetChatMenuButtonParams]() +## type [SetChatMenuButtonParams]() SetChatMenuButtonParams is the parameter set for SetChatMenuButton. @@ -17398,11 +18181,11 @@ type SetChatMenuButtonParams struct { ``` -## type [SetChatPermissionsParams]() +## type [SetChatPermissionsParams]() SetChatPermissionsParams is the parameter set for SetChatPermissions. -Use 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 on success. +Use 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 right. Returns True on success. ```go type SetChatPermissionsParams struct { @@ -17416,7 +18199,7 @@ type SetChatPermissionsParams struct { ``` -## type [SetChatPhotoParams]() +## type [SetChatPhotoParams]() SetChatPhotoParams is the parameter set for SetChatPhoto. @@ -17432,7 +18215,7 @@ type SetChatPhotoParams struct { ``` -### func \(\*SetChatPhotoParams\) [HasFile]() +### func \(\*SetChatPhotoParams\) [HasFile]() ```go func (p *SetChatPhotoParams) HasFile() bool @@ -17441,7 +18224,7 @@ func (p *SetChatPhotoParams) HasFile() bool HasFile reports whether a multipart upload is required. -### func \(\*SetChatPhotoParams\) [MultipartFields]() +### func \(\*SetChatPhotoParams\) [MultipartFields]() ```go func (p *SetChatPhotoParams) MultipartFields() map[string]string @@ -17450,7 +18233,7 @@ func (p *SetChatPhotoParams) MultipartFields() map[string]string MultipartFields returns the non\-file fields used in the multipart body. -### func \(\*SetChatPhotoParams\) [MultipartFiles]() +### func \(\*SetChatPhotoParams\) [MultipartFiles]() ```go func (p *SetChatPhotoParams) MultipartFiles() []client.MultipartFile @@ -17459,7 +18242,7 @@ func (p *SetChatPhotoParams) MultipartFiles() []client.MultipartFile MultipartFiles returns the file parts. -## type [SetChatStickerSetParams]() +## type [SetChatStickerSetParams]() SetChatStickerSetParams is the parameter set for SetChatStickerSet. @@ -17475,7 +18258,7 @@ type SetChatStickerSetParams struct { ``` -## type [SetChatTitleParams]() +## type [SetChatTitleParams]() SetChatTitleParams is the parameter set for SetChatTitle. @@ -17491,7 +18274,7 @@ type SetChatTitleParams struct { ``` -## type [SetCustomEmojiStickerSetThumbnailParams]() +## type [SetCustomEmojiStickerSetThumbnailParams]() SetCustomEmojiStickerSetThumbnailParams is the parameter set for SetCustomEmojiStickerSetThumbnail. @@ -17507,11 +18290,11 @@ type SetCustomEmojiStickerSetThumbnailParams struct { ``` -## type [SetGameScoreParams]() +## type [SetGameScoreParams]() SetGameScoreParams is the parameter set for SetGameScore. -Use 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 not greater than the user's current score in the chat and force is False. +Use 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 not greater than the user's current score in the chat and force is False. ```go type SetGameScoreParams struct { @@ -17533,7 +18316,7 @@ type SetGameScoreParams struct { ``` -## type [SetManagedBotAccessSettingsParams]() +## type [SetManagedBotAccessSettingsParams]() SetManagedBotAccessSettingsParams is the parameter set for SetManagedBotAccessSettings. @@ -17551,7 +18334,7 @@ type SetManagedBotAccessSettingsParams struct { ``` -## type [SetMessageReactionParams]() +## type [SetMessageReactionParams]() SetMessageReactionParams is the parameter set for SetMessageReaction. @@ -17559,7 +18342,7 @@ Use this method to change the chosen reactions on a message. Service messages of ```go type SetMessageReactionParams struct { - // Unique identifier for the target chat or username of the target bot, supergroup or channel in the format @username + // Unique identifier for the target chat or username of the target bot, supergroup, or channel in the format @username ChatID ChatID `json:"chat_id"` // Identifier of the target message. If the message belongs to a media group, the reaction is set to the first non-deleted message in the group instead. MessageID int64 `json:"message_id"` @@ -17571,7 +18354,7 @@ type SetMessageReactionParams struct { ``` -## type [SetMyCommandsParams]() +## type [SetMyCommandsParams]() SetMyCommandsParams is the parameter set for SetMyCommands. @@ -17589,7 +18372,7 @@ type SetMyCommandsParams struct { ``` -## type [SetMyDefaultAdministratorRightsParams]() +## type [SetMyDefaultAdministratorRightsParams]() SetMyDefaultAdministratorRightsParams is the parameter set for SetMyDefaultAdministratorRights. @@ -17605,7 +18388,7 @@ type SetMyDefaultAdministratorRightsParams struct { ``` -## type [SetMyDescriptionParams]() +## type [SetMyDescriptionParams]() SetMyDescriptionParams is the parameter set for SetMyDescription. @@ -17621,7 +18404,7 @@ type SetMyDescriptionParams struct { ``` -## type [SetMyNameParams]() +## type [SetMyNameParams]() SetMyNameParams is the parameter set for SetMyName. @@ -17637,7 +18420,7 @@ type SetMyNameParams struct { ``` -## type [SetMyProfilePhotoParams]() +## type [SetMyProfilePhotoParams]() SetMyProfilePhotoParams is the parameter set for SetMyProfilePhoto. @@ -17650,8 +18433,50 @@ type SetMyProfilePhotoParams struct { } ``` + +## type [SetMySettingsParams]() + +SetMySettingsParams is the parameter set for SetMySettings. + +Use this method to change the settings of the bot. Settings that aren't specified remain unchanged. Returns True on success. + +```go +type SetMySettingsParams struct { + // Pass True to enable inline mode for the bot or False to disable it + SupportsInlineQueries *bool `json:"supports_inline_queries,omitempty"` + // New placeholder for inline queries, which is shown in the input field after the bot's username. Pass an empty string to use the default placeholder. + InlineQueryPlaceholder string `json:"inline_query_placeholder,omitempty"` + // Pass True to request the location of the user with every inline query to the bot or False to stop requesting it + NeedsInlineQueryLocation *bool `json:"needs_inline_query_location,omitempty"` + // Denominator of the share of chosen inline results received by the bot; the bot receives 1 out of inline_feedback_share_denominator chosen results. Must be one of 1, 10, 100, or 1000. Pass 0 to stop receiving chosen inline results. + InlineFeedbackShareDenominator *int64 `json:"inline_feedback_share_denominator,omitempty"` + // Pass True to allow adding the bot to groups or False to disallow it + CanJoinGroups *bool `json:"can_join_groups,omitempty"` + // Pass True to disable privacy mode for the bot or False to enable it + CanReadAllGroupMessages *bool `json:"can_read_all_group_messages,omitempty"` + // Pass True to allow connecting the bot to user accounts to manage them or False to disallow it + CanConnectToBusiness *bool `json:"can_connect_to_business,omitempty"` + // Pass True to allow creating other bots that will be controlled by the bot or False to disallow it + CanManageBots *bool `json:"can_manage_bots,omitempty"` + // Pass True to allow guest queries to the bot from chats it isn't a member of or False to disallow them + SupportsGuestQueries *bool `json:"supports_guest_queries,omitempty"` + // Pass True to allow assigning the bot to process join request queries or False to disallow it + SupportsJoinRequestQueries *bool `json:"supports_join_request_queries,omitempty"` + // Pass True to enable forum topic mode in private chats with the bot or False to disable it + HasTopicsEnabled *bool `json:"has_topics_enabled,omitempty"` + // Pass True to allow users to create and delete topics in private chats with the bot or False to disallow it + AllowsUsersToCreateTopics *bool `json:"allows_users_to_create_topics,omitempty"` + // Pass True to show topics in private chats with the bot in a sidebar or False to stop showing them in a sidebar + HasTopicSidebar *bool `json:"has_topic_sidebar,omitempty"` + // Pass True to allow the bot to communicate with other bots in groups, private chats, and through business accounts or False to disallow it + CanCommunicateWithBots *bool `json:"can_communicate_with_bots,omitempty"` + // Mode in which the bot receives callback queries from buttons in messages sent by the bot. Must be one of “default” (the field message is always used and contains an InaccessibleMessage if the message is inaccessible to the bot), “auto” (the field inline_message_id is used instead of the field message if the message is inaccessible to the bot; the field message can still contain an inaccessible message if the message has just been deleted), or “inline” (the field inline_message_id is always used instead of the field message). + CallbackQueryMode CallbackQueryMode `json:"callback_query_mode,omitempty"` +} +``` + -## type [SetMyShortDescriptionParams]() +## type [SetMyShortDescriptionParams]() SetMyShortDescriptionParams is the parameter set for SetMyShortDescription. @@ -17667,11 +18492,11 @@ type SetMyShortDescriptionParams struct { ``` -## type [SetPassportDataErrorsParams]() +## type [SetPassportDataErrorsParams]() SetPassportDataErrorsParams is the parameter set for SetPassportDataErrors. -Informs 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 returned the error must change\). Returns True on success. Use this if the data submitted by the user doesn't satisfy the standards your service requires for any reason. For example, if a birthday date seems invalid, a submitted document is blurry, a scan shows evidence of tampering, etc. Supply some details in the error message to make sure the user knows how to correct the issues. +Informs a user that some of the Telegram Passport elements they provided contain 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 returned the error must change\). Returns True on success. Use this if the data submitted by the user doesn't satisfy the standards your service requires for any reason. For example, if a birthday date seems invalid, a submitted document is blurry, a scan shows evidence of tampering, etc. Supply some details in the error message to make sure the user knows how to correct the issues. ```go type SetPassportDataErrorsParams struct { @@ -17683,7 +18508,7 @@ type SetPassportDataErrorsParams struct { ``` -## type [SetStickerEmojiListParams]() +## type [SetStickerEmojiListParams]() SetStickerEmojiListParams is the parameter set for SetStickerEmojiList. @@ -17699,7 +18524,7 @@ type SetStickerEmojiListParams struct { ``` -## type [SetStickerKeywordsParams]() +## type [SetStickerKeywordsParams]() SetStickerKeywordsParams is the parameter set for SetStickerKeywords. @@ -17709,13 +18534,13 @@ Use this method to change search keywords assigned to a regular or custom emoji type SetStickerKeywordsParams struct { // File identifier of the sticker Sticker string `json:"sticker"` - // A JSON-serialized list of 0-20 search keywords for the sticker with total length of up to 64 characters + // A JSON-serialized list of 0-20 search keywords for the sticker with a total length of up to 64 characters Keywords []string `json:"keywords,omitempty"` } ``` -## type [SetStickerMaskPositionParams]() +## type [SetStickerMaskPositionParams]() SetStickerMaskPositionParams is the parameter set for SetStickerMaskPosition. @@ -17731,7 +18556,7 @@ type SetStickerMaskPositionParams struct { ``` -## type [SetStickerPositionInSetParams]() +## type [SetStickerPositionInSetParams]() SetStickerPositionInSetParams is the parameter set for SetStickerPositionInSet. @@ -17747,7 +18572,7 @@ type SetStickerPositionInSetParams struct { ``` -## type [SetStickerSetThumbnailParams]() +## type [SetStickerSetThumbnailParams]() SetStickerSetThumbnailParams is the parameter set for SetStickerSetThumbnail. @@ -17767,7 +18592,7 @@ type SetStickerSetThumbnailParams struct { ``` -### func \(\*SetStickerSetThumbnailParams\) [HasFile]() +### func \(\*SetStickerSetThumbnailParams\) [HasFile]() ```go func (p *SetStickerSetThumbnailParams) HasFile() bool @@ -17776,7 +18601,7 @@ func (p *SetStickerSetThumbnailParams) HasFile() bool HasFile reports whether a multipart upload is required. -### func \(\*SetStickerSetThumbnailParams\) [MultipartFields]() +### func \(\*SetStickerSetThumbnailParams\) [MultipartFields]() ```go func (p *SetStickerSetThumbnailParams) MultipartFields() map[string]string @@ -17785,7 +18610,7 @@ func (p *SetStickerSetThumbnailParams) MultipartFields() map[string]string MultipartFields returns the non\-file fields used in the multipart body. -### func \(\*SetStickerSetThumbnailParams\) [MultipartFiles]() +### func \(\*SetStickerSetThumbnailParams\) [MultipartFiles]() ```go func (p *SetStickerSetThumbnailParams) MultipartFiles() []client.MultipartFile @@ -17794,7 +18619,7 @@ func (p *SetStickerSetThumbnailParams) MultipartFiles() []client.MultipartFile MultipartFiles returns the file parts. -## type [SetStickerSetTitleParams]() +## type [SetStickerSetTitleParams]() SetStickerSetTitleParams is the parameter set for SetStickerSetTitle. @@ -17810,7 +18635,7 @@ type SetStickerSetTitleParams struct { ``` -## type [SetUserEmojiStatusParams]() +## type [SetUserEmojiStatusParams]() SetUserEmojiStatusParams is the parameter set for SetUserEmojiStatus. @@ -17832,7 +18657,7 @@ type SetUserEmojiStatusParams struct { SetWebhookParams is the parameter set for SetWebhook. -Use 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 Update. In case of an unsuccessful request \(a request with response HTTP status code different from 2XY\), we will repeat the request and give up after a reasonable amount of attempts. Returns True on success. If you'd like to make sure that the webhook was set by you, you can specify secret data in the parameter secret\_token. If specified, the request will contain a header “X\-Telegram\-Bot\-Api\-Secret\-Token” with the secret token as content. Notes1. You will not be able to receive updates using getUpdates for as long as an outgoing webhook is set up.2. To use a self\-signed certificate, you need to upload your public key certificate using certificate parameter. Please upload as InputFile, sending a String will not work.3. Ports currently supported for webhooks: 443, 80, 88, 8443. If you're having any trouble setting up webhooks, please check out this amazing guide to webhooks. +Use 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 Update. In case of an unsuccessful request \(a request with response HTTP status code different from 2XY\), we will repeat the request and give up after a reasonable number of attempts. Returns True on success. If you'd like to make sure that the webhook was set by you, you can specify secret data in the parameter secret\_token. If specified, the request will contain a header “X\-Telegram\-Bot\-Api\-Secret\-Token” with the secret token as content. Notes1. You will not be able to receive updates using getUpdates for as long as an outgoing webhook is set up.2. To use a self\-signed certificate, you need to upload your public key certificate using the certificate parameter. Please upload it as InputFile; sending a String will not work.3. Ports currently supported for webhooks: 443, 80, 88, 8443. If you're having any trouble setting up webhooks, please check out this amazing guide to webhooks. ```go type SetWebhookParams struct { @@ -17844,7 +18669,7 @@ type SetWebhookParams struct { IPAddress string `json:"ip_address,omitempty"` // The maximum allowed number of simultaneous HTTPS connections to the webhook for update delivery, 1-100. Defaults to 40. Use lower values to limit the load on your bot's server, and higher values to increase your bot's throughput. MaxConnections *int64 `json:"max_connections,omitempty"` - // A JSON-serialized list of the update types you want your bot to receive. For example, specify ["message", "edited_channel_post", "callback_query"] to only receive updates of these types. See Update for a complete list of available update types. Specify an empty list to receive all update types except chat_member, message_reaction, and message_reaction_count (default). If not specified, the previous setting will be used.Please note that this parameter doesn't affect updates created before the call to the setWebhook, so unwanted updates may be received for a short period of time. + // A JSON-serialized list of the update types you want your bot to receive. For example, specify ["message", "edited_channel_post", "callback_query"] to only receive updates of these types. See Update for a complete list of available update types. Specify an empty list to receive all update types except chat_member, message_reaction, and message_reaction_count (default). If not specified, the previous setting will be used.Please note that this parameter doesn't affect updates created before the call to setWebhook, so unwanted updates may be received for a short period of time. AllowedUpdates []UpdateType `json:"allowed_updates,omitempty"` // Pass True to drop all pending updates DropPendingUpdates *bool `json:"drop_pending_updates,omitempty"` @@ -17881,7 +18706,7 @@ func (p *SetWebhookParams) MultipartFiles() []client.MultipartFile MultipartFiles returns the file parts. -## type [SharedUser]() +## type [SharedUser]() This object contains information about a user that was shared with the bot using a KeyboardButtonRequestUsers button. @@ -17900,8 +18725,37 @@ type SharedUser struct { } ``` + +## type [SharedWidgetQuery]() + +This 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 all its widgets. + +```go +type SharedWidgetQuery struct { + // Unique identifier for this query + ID string `json:"id"` + // Sender + From User `json:"from"` + // Type of the query + Type WidgetQueryType `json:"type"` + // Data of the query, 1-64 bytes + Data string `json:"data"` + // Unique identifier of the shared widget, which sent the query + WidgetID string `json:"widget_id"` +} +``` + + +### func \(\*SharedWidgetQuery\) [UnmarshalJSON]() + +```go +func (m *SharedWidgetQuery) UnmarshalJSON(data []byte) error +``` + +UnmarshalJSON decodes SharedWidgetQuery by dispatching union\-typed fields \(Type\) through their concrete UnmarshalXxx helpers. + -## type [ShippingAddress]() +## type [ShippingAddress]() This object represents a shipping address. @@ -17923,7 +18777,7 @@ type ShippingAddress struct { ``` -## type [ShippingOption]() +## type [ShippingOption]() This object represents one shipping option. @@ -17939,7 +18793,7 @@ type ShippingOption struct { ``` -## type [ShippingQuery]() +## type [ShippingQuery]() This object contains information about an incoming shipping query. @@ -17951,13 +18805,13 @@ type ShippingQuery struct { From User `json:"from"` // Bot-specified invoice payload InvoicePayload string `json:"invoice_payload"` - // User specified shipping address + // User-specified shipping address ShippingAddress ShippingAddress `json:"shipping_address"` } ``` -## type [StarAmount]() +## type [StarAmount]() Describes an amount of Telegram Stars. @@ -17971,7 +18825,7 @@ type StarAmount struct { ``` -### func [GetBusinessAccountStarBalance]() +### func [GetBusinessAccountStarBalance]() ```go func GetBusinessAccountStarBalance(ctx context.Context, b *client.Bot, p *GetBusinessAccountStarBalanceParams) (*StarAmount, error) @@ -17982,7 +18836,7 @@ GetBusinessAccountStarBalance calls the getBusinessAccountStarBalance Telegram B Returns 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. -### func [GetMyStarBalance]() +### func [GetMyStarBalance]() ```go func GetMyStarBalance(ctx context.Context, b *client.Bot, p *GetMyStarBalanceParams) (*StarAmount, error) @@ -17993,7 +18847,7 @@ GetMyStarBalance calls the getMyStarBalance Telegram Bot API method. A method to get the current Telegram Stars balance of the bot. Requires no parameters. On success, returns a StarAmount object. -## type [StarTransaction]() +## type [StarTransaction]() Describes 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 deducted from the bot's balance. This is outside of Telegram's control. @@ -18015,7 +18869,7 @@ type StarTransaction struct { ``` -### func \(\*StarTransaction\) [UnmarshalJSON]() +### func \(\*StarTransaction\) [UnmarshalJSON]() ```go func (m *StarTransaction) UnmarshalJSON(data []byte) error @@ -18024,7 +18878,7 @@ func (m *StarTransaction) UnmarshalJSON(data []byte) error UnmarshalJSON decodes StarTransaction by dispatching union\-typed fields \(Source, Receiver\) through their concrete UnmarshalXxx helpers. -## type [StarTransactions]() +## type [StarTransactions]() Contains a list of Telegram Star transactions. @@ -18036,7 +18890,7 @@ type StarTransactions struct { ``` -### func [GetStarTransactions]() +### func [GetStarTransactions]() ```go func GetStarTransactions(ctx context.Context, b *client.Bot, p *GetStarTransactionsParams) (*StarTransactions, error) @@ -18047,7 +18901,7 @@ GetStarTransactions calls the getStarTransactions Telegram Bot API method. Returns the bot's Telegram Star transactions in chronological order. On success, returns a StarTransactions object. -## type [Sticker]() +## type [Sticker]() This object represents a sticker. @@ -18087,7 +18941,7 @@ type Sticker struct { ``` -### func [GetCustomEmojiStickers]() +### func [GetCustomEmojiStickers]() ```go func GetCustomEmojiStickers(ctx context.Context, b *client.Bot, p *GetCustomEmojiStickersParams) ([]Sticker, error) @@ -18098,7 +18952,7 @@ GetCustomEmojiStickers calls the getCustomEmojiStickers Telegram Bot API method. Use this method to get information about custom emoji stickers by their identifiers. Returns an Array of Sticker objects. -### func [GetForumTopicIconStickers]() +### func [GetForumTopicIconStickers]() ```go func GetForumTopicIconStickers(ctx context.Context, b *client.Bot, p *GetForumTopicIconStickersParams) ([]Sticker, error) @@ -18109,7 +18963,7 @@ GetForumTopicIconStickers calls the getForumTopicIconStickers Telegram Bot API m Use 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. -## type [StickerSet]() +## type [StickerSet]() This object represents a sticker set. @@ -18129,7 +18983,7 @@ type StickerSet struct { ``` -### func [GetStickerSet]() +### func [GetStickerSet]() ```go func GetStickerSet(ctx context.Context, b *client.Bot, p *GetStickerSetParams) (*StickerSet, error) @@ -18140,7 +18994,7 @@ GetStickerSet calls the getStickerSet Telegram Bot API method. Use this method to get a sticker set. On success, a StickerSet object is returned. -## type [StickerType]() +## type [StickerType]() @@ -18159,17 +19013,17 @@ const ( ``` -## type [StopMessageLiveLocationParams]() +## type [StopMessageLiveLocationParams]() StopMessageLiveLocationParams is the parameter set for StopMessageLiveLocation. -Use 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. +Use 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. ```go type StopMessageLiveLocationParams struct { // Unique identifier of the business connection on behalf of which the message to be edited was sent BusinessConnectionID string `json:"business_connection_id,omitempty"` - // Required if inline_message_id is not specified. Unique identifier for the target chat or username of the target bot, supergroup or channel in the format @username. + // Required if inline_message_id is not specified. Unique identifier for the target chat or username of the target bot, supergroup, or channel in the format @username. ChatID *ChatID `json:"chat_id,omitempty"` // Required if inline_message_id is not specified. Identifier of the message with live location to stop. MessageID *int64 `json:"message_id,omitempty"` @@ -18181,7 +19035,7 @@ type StopMessageLiveLocationParams struct { ``` -## type [StopPollParams]() +## type [StopPollParams]() StopPollParams is the parameter set for StopPoll. @@ -18191,7 +19045,7 @@ Use this method to stop a poll which was sent by the bot. On success, the stoppe type StopPollParams struct { // Unique identifier of the business connection on behalf of which the message to be edited was sent BusinessConnectionID string `json:"business_connection_id,omitempty"` - // Unique identifier for the target chat or username of the target bot, supergroup or channel in the format @username + // Unique identifier for the target chat or username of the target bot, supergroup, or channel in the format @username ChatID ChatID `json:"chat_id"` // Identifier of the original message with the poll MessageID int64 `json:"message_id"` @@ -18201,7 +19055,7 @@ type StopPollParams struct { ``` -## type [Story]() +## type [Story]() This object represents a story. @@ -18215,7 +19069,7 @@ type Story struct { ``` -### func [EditStory]() +### func [EditStory]() ```go func EditStory(ctx context.Context, b *client.Bot, p *EditStoryParams) (*Story, error) @@ -18226,7 +19080,7 @@ EditStory calls the editStory Telegram Bot API method. Edits 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. -### func [PostStory]() +### func [PostStory]() ```go func PostStory(ctx context.Context, b *client.Bot, p *PostStoryParams) (*Story, error) @@ -18237,7 +19091,7 @@ PostStory calls the postStory Telegram Bot API method. Posts a story on behalf of a managed business account. Requires the can\_manage\_stories business bot right. Returns Story on success. -### func [RepostStory]() +### func [RepostStory]() ```go func RepostStory(ctx context.Context, b *client.Bot, p *RepostStoryParams) (*Story, error) @@ -18248,21 +19102,21 @@ RepostStory calls the repostStory Telegram Bot API method. Reposts 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. Requires the can\_manage\_stories business bot right for both business accounts. Returns Story on success. -## type [StoryArea]() +## type [StoryArea]() Describes a clickable area on a story media. ```go type StoryArea struct { // Position of the area - Position StoryAreaPosition `json:"position"` + Position AreaPosition `json:"position"` // Type of the area Type StoryAreaType `json:"type"` } ``` -### func \(\*StoryArea\) [UnmarshalJSON]() +### func \(\*StoryArea\) [UnmarshalJSON]() ```go func (m *StoryArea) UnmarshalJSON(data []byte) error @@ -18270,30 +19124,8 @@ func (m *StoryArea) UnmarshalJSON(data []byte) error UnmarshalJSON decodes StoryArea by dispatching union\-typed fields \(Type\) through their concrete UnmarshalXxx helpers. - -## type [StoryAreaPosition]() - -Describes the position of a clickable area within a story. - -```go -type StoryAreaPosition struct { - // The abscissa of the area's center, as a percentage of the media width - XPercentage float64 `json:"x_percentage"` - // The ordinate of the area's center, as a percentage of the media height - YPercentage float64 `json:"y_percentage"` - // The width of the area's rectangle, as a percentage of the media width - WidthPercentage float64 `json:"width_percentage"` - // The height of the area's rectangle, as a percentage of the media height - HeightPercentage float64 `json:"height_percentage"` - // The clockwise rotation angle of the rectangle, in degrees; 0-360 - RotationAngle float64 `json:"rotation_angle"` - // The radius of the rectangle corner rounding, as a percentage of the media width - CornerRadiusPercentage float64 `json:"corner_radius_percentage"` -} -``` - -## type [StoryAreaType]() +## type [StoryAreaType]() StoryAreaType is a union type. The following concrete variants implement it: @@ -18312,7 +19144,7 @@ type StoryAreaType interface { ``` -### func [UnmarshalStoryAreaType]() +### func [UnmarshalStoryAreaType]() ```go func UnmarshalStoryAreaType(data []byte) (StoryAreaType, error) @@ -18321,7 +19153,7 @@ func UnmarshalStoryAreaType(data []byte) (StoryAreaType, error) UnmarshalStoryAreaType decodes a StoryAreaType from JSON by inspecting the "type" field and dispatching to the correct concrete type. -## type [StoryAreaTypeKind]() +## type [StoryAreaTypeKind]() @@ -18342,7 +19174,7 @@ const ( ``` -## type [StoryAreaTypeLink]() +## type [StoryAreaTypeLink]() Describes a story area pointing to an HTTP or tg:// link. Currently, a story can have up to 3 link areas. @@ -18356,7 +19188,7 @@ type StoryAreaTypeLink struct { ``` -### func \(\*StoryAreaTypeLink\) [MarshalJSON]() +### func \(\*StoryAreaTypeLink\) [MarshalJSON]() ```go func (v *StoryAreaTypeLink) MarshalJSON() ([]byte, error) @@ -18365,7 +19197,7 @@ func (v *StoryAreaTypeLink) MarshalJSON() ([]byte, error) MarshalJSON encodes StoryAreaTypeLink with the discriminator field "type" forced to "link". The hardcoded value frees callers from setting Type by hand — any user\-supplied value on the struct literal is overridden so a typo can't slip through to Telegram. -## type [StoryAreaTypeLocation]() +## type [StoryAreaTypeLocation]() Describes a story area pointing to a location. Currently, a story can have up to 10 location areas. @@ -18383,7 +19215,7 @@ type StoryAreaTypeLocation struct { ``` -### func \(\*StoryAreaTypeLocation\) [MarshalJSON]() +### func \(\*StoryAreaTypeLocation\) [MarshalJSON]() ```go func (v *StoryAreaTypeLocation) MarshalJSON() ([]byte, error) @@ -18392,7 +19224,7 @@ func (v *StoryAreaTypeLocation) MarshalJSON() ([]byte, error) MarshalJSON encodes StoryAreaTypeLocation with the discriminator field "type" forced to "location". The hardcoded value frees callers from setting Type by hand — any user\-supplied value on the struct literal is overridden so a typo can't slip through to Telegram. -## type [StoryAreaTypeSuggestedReaction]() +## type [StoryAreaTypeSuggestedReaction]() Describes a story area pointing to a suggested reaction. Currently, a story can have up to 5 suggested reaction areas. @@ -18404,13 +19236,13 @@ type StoryAreaTypeSuggestedReaction struct { ReactionType ReactionType `json:"reaction_type"` // Optional. Pass True if the reaction area has a dark background IsDark *bool `json:"is_dark,omitempty"` - // Optional. Pass True if reaction area corner is flipped + // Optional. Pass True if the reaction area corner is flipped IsFlipped *bool `json:"is_flipped,omitempty"` } ``` -### func \(\*StoryAreaTypeSuggestedReaction\) [MarshalJSON]() +### func \(\*StoryAreaTypeSuggestedReaction\) [MarshalJSON]() ```go func (v *StoryAreaTypeSuggestedReaction) MarshalJSON() ([]byte, error) @@ -18419,7 +19251,7 @@ func (v *StoryAreaTypeSuggestedReaction) MarshalJSON() ([]byte, error) MarshalJSON encodes StoryAreaTypeSuggestedReaction with the discriminator field "type" forced to "suggested\_reaction". The hardcoded value frees callers from setting Type by hand — any user\-supplied value on the struct literal is overridden so a typo can't slip through to Telegram. -### func \(\*StoryAreaTypeSuggestedReaction\) [UnmarshalJSON]() +### func \(\*StoryAreaTypeSuggestedReaction\) [UnmarshalJSON]() ```go func (m *StoryAreaTypeSuggestedReaction) UnmarshalJSON(data []byte) error @@ -18428,7 +19260,7 @@ func (m *StoryAreaTypeSuggestedReaction) UnmarshalJSON(data []byte) error UnmarshalJSON decodes StoryAreaTypeSuggestedReaction by dispatching union\-typed fields \(ReactionType\) through their concrete UnmarshalXxx helpers. -## type [StoryAreaTypeUniqueGift]() +## type [StoryAreaTypeUniqueGift]() Describes a story area pointing to a unique gift. Currently, a story can have at most 1 unique gift area. @@ -18442,7 +19274,7 @@ type StoryAreaTypeUniqueGift struct { ``` -### func \(\*StoryAreaTypeUniqueGift\) [MarshalJSON]() +### func \(\*StoryAreaTypeUniqueGift\) [MarshalJSON]() ```go func (v *StoryAreaTypeUniqueGift) MarshalJSON() ([]byte, error) @@ -18451,7 +19283,7 @@ func (v *StoryAreaTypeUniqueGift) MarshalJSON() ([]byte, error) MarshalJSON encodes StoryAreaTypeUniqueGift with the discriminator field "type" forced to "unique\_gift". The hardcoded value frees callers from setting Type by hand — any user\-supplied value on the struct literal is overridden so a typo can't slip through to Telegram. -## type [StoryAreaTypeWeather]() +## type [StoryAreaTypeWeather]() Describes a story area containing weather information. Currently, a story can have up to 3 weather areas. @@ -18459,7 +19291,7 @@ Describes a story area containing weather information. Currently, a story can ha type StoryAreaTypeWeather struct { // Type of the area, always “weather” Type StoryAreaTypeKind `json:"type"` - // Temperature, in degree Celsius + // Temperature, in degrees Celsius Temperature float64 `json:"temperature"` // Emoji representing the weather Emoji string `json:"emoji"` @@ -18469,7 +19301,7 @@ type StoryAreaTypeWeather struct { ``` -### func \(\*StoryAreaTypeWeather\) [MarshalJSON]() +### func \(\*StoryAreaTypeWeather\) [MarshalJSON]() ```go func (v *StoryAreaTypeWeather) MarshalJSON() ([]byte, error) @@ -18478,7 +19310,7 @@ func (v *StoryAreaTypeWeather) MarshalJSON() ([]byte, error) MarshalJSON encodes StoryAreaTypeWeather with the discriminator field "type" forced to "weather". The hardcoded value frees callers from setting Type by hand — any user\-supplied value on the struct literal is overridden so a typo can't slip through to Telegram. -## type [SuccessfulPayment]() +## type [SuccessfulPayment]() This 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. This is outside of Telegram's control. @@ -18486,7 +19318,7 @@ This object contains basic information about a successful payment. Note that if type SuccessfulPayment struct { // Three-letter ISO 4217 currency code, or “XTR” for payments in Telegram Stars Currency string `json:"currency"` - // Total price in the smallest units of the currency (integer, not float/double). For example, for a price of US$ 1.45 pass amount = 145. See the exp parameter in currencies.json, it shows the number of digits past the decimal point for each currency (2 for the majority of currencies). + // Total price in the smallest units of the currency (integer, not float/double). For example, for a price of US$ 1.45, total_amount = 145. See the exp parameter in currencies.json; it shows the number of digits past the decimal point for each currency (2 for the majority of currencies). TotalAmount int64 `json:"total_amount"` // Bot-specified invoice payload InvoicePayload string `json:"invoice_payload"` @@ -18508,7 +19340,7 @@ type SuccessfulPayment struct { ``` -## type [SuggestedPostApprovalFailed]() +## type [SuggestedPostApprovalFailed]() Describes a service message about the failed approval of a suggested post. Currently, only caused by insufficient user funds at the time of approval. @@ -18522,7 +19354,7 @@ type SuggestedPostApprovalFailed struct { ``` -## type [SuggestedPostApproved]() +## type [SuggestedPostApproved]() Describes a service message about the approval of a suggested post. @@ -18538,7 +19370,7 @@ type SuggestedPostApproved struct { ``` -## type [SuggestedPostDeclined]() +## type [SuggestedPostDeclined]() Describes a service message about the rejection of a suggested post. @@ -18552,7 +19384,7 @@ type SuggestedPostDeclined struct { ``` -## type [SuggestedPostInfo]() +## type [SuggestedPostInfo]() Contains information about a suggested post. @@ -18568,7 +19400,7 @@ type SuggestedPostInfo struct { ``` -## type [SuggestedPostInfoState]() +## type [SuggestedPostInfoState]() @@ -18587,7 +19419,7 @@ const ( ``` -## type [SuggestedPostPaid]() +## type [SuggestedPostPaid]() Describes a service message about a successful payment for a suggested post. @@ -18605,7 +19437,7 @@ type SuggestedPostPaid struct { ``` -## type [SuggestedPostPaidCurrency]() +## type [SuggestedPostPaidCurrency]() @@ -18623,7 +19455,7 @@ const ( ``` -## type [SuggestedPostParameters]() +## type [SuggestedPostParameters]() Contains parameters of a post that is being suggested by the bot. @@ -18631,13 +19463,13 @@ Contains parameters of a post that is being suggested by the bot. type SuggestedPostParameters struct { // Optional. Proposed price for the post. If the field is omitted, then the post is unpaid. Price *SuggestedPostPrice `json:"price,omitempty"` - // Optional. Proposed send date of the post. If specified, then the date must be between 300 second and 2678400 seconds (30 days) in the future. If the field is omitted, then the post can be published at any time within 30 days at the sole discretion of the user who approves it. + // Optional. Proposed send date of the post. If specified, then the date must be between 300 seconds and 2678400 seconds (30 days) in the future. If the field is omitted, then the post can be published at any time within 30 days at the sole discretion of the user who approves it. SendDate *int64 `json:"send_date,omitempty"` } ``` -## type [SuggestedPostPrice]() +## type [SuggestedPostPrice]() Describes the price of a suggested post. @@ -18651,7 +19483,7 @@ type SuggestedPostPrice struct { ``` -## type [SuggestedPostRefunded]() +## type [SuggestedPostRefunded]() Describes a service message about a payment refund for a suggested post. @@ -18665,7 +19497,7 @@ type SuggestedPostRefunded struct { ``` -## type [SuggestedPostRefundedReason]() +## type [SuggestedPostRefundedReason]() @@ -18683,7 +19515,7 @@ const ( ``` -## type [SwitchInlineQueryChosenChat]() +## type [SwitchInlineQueryChosenChat]() This object represents an inline button that switches the current user to inline mode in a chosen chat, with an optional default inline query. @@ -18703,25 +19535,124 @@ type SwitchInlineQueryChosenChat struct { ``` -## type [TextQuote]() +## type [TextQuote]() This object contains information about the quoted part of a message that is replied to by the given message. ```go type TextQuote struct { - // Text of the quoted part of a message that is replied to by the given message + // Text of the quoted part of a message that is replied to by the given message; may be empty if the quote was chosen from a rich message Text string `json:"text"` // Optional. Special entities that appear in the quote. Currently, only bold, italic, underline, strikethrough, spoiler, custom_emoji, and date_time entities are kept in quotes. Entities []MessageEntity `json:"entities,omitempty"` - // Approximate quote position in the original message in UTF-16 code units as specified by the sender + // Optional. Rich text of the quote if it was chosen from a rich message. May contain only plain text, RichTextBold, RichTextItalic, RichTextUnderline, RichTextStrikethrough, RichTextSpoiler, RichTextSubscript, RichTextSuperscript, RichTextDateTime, RichTextCustomEmoji, RichTextMathematicalExpression, and arrays of them. + RichTexts []RichText `json:"rich_texts,omitempty"` + // Approximate quote position in the original message in UTF-16 code units as specified by the sender. For quotes from rich messages, it is the position in the text formed by joining plain texts of all quotable texts of the message, separated by line feeds. Position int64 `json:"position"` // Optional. True, if the quote was chosen manually by the message sender. Otherwise, the quote was added automatically by the server. IsManual *bool `json:"is_manual,omitempty"` } ``` + +### func \(\*TextQuote\) [UnmarshalJSON]() + +```go +func (m *TextQuote) UnmarshalJSON(data []byte) error +``` + +UnmarshalJSON decodes TextQuote by dispatching union\-typed fields \(RichTexts\) through their concrete UnmarshalXxx helpers. + + +## type [TonNft]() + +This object represents an NFT in the TON blockchain. + +```go +type TonNft struct { + // Address of the NFT + Address string `json:"address"` + // Optional. Address of the collection to which the NFT belongs; omitted if unknown + CollectionAddress string `json:"collection_address,omitempty"` + // Index of the NFT among all NFTs from the collection as a decimal number + Index string `json:"index"` + // Name of the NFT + Name string `json:"name"` + // Description of the NFT + Description string `json:"description"` + // Optional. Attributes of the NFT + Attributes []TonNftAttribute `json:"attributes,omitempty"` + // Optional. The unique gift corresponding to the NFT + Gift *UniqueGift `json:"gift,omitempty"` +} +``` + + +## type [TonNftAttribute]() + +This object represents an attribute of an NFT in the TON blockchain. + +```go +type TonNftAttribute struct { + // Trait type of the attribute + TraitType string `json:"trait_type"` + // Value of the attribute + Value string `json:"value"` +} +``` + + +## type [TonWalletCard]() + +This object describes a TON wallet card, which is shown on the profile page of a user to everyone. + +```go +type TonWalletCard struct { + // Address of the wallet + Address string `json:"address"` + // Balance of the wallet, in the smallest units of the cryptocurrency, as a decimal number + Amount string `json:"amount"` + // Stickers placed on the card + Stickers []TonWalletCardSticker `json:"stickers"` + // Optional. Address of the NFT of one of the stickers, whose colors must be used for the card background; omitted if the default background must be used + BackgroundNftAddress string `json:"background_nft_address,omitempty"` +} +``` + + +## type [TonWalletCardSticker]() + +This object describes a sticker on a TON wallet card. + +```go +type TonWalletCardSticker struct { + // Position of the sticker on the card + Position AreaPosition `json:"position"` + // The NFT shown as the sticker + Nft TonNft `json:"nft"` +} +``` + + +## type [TonWalletTransfer]() + +Describes a service message about a transfer with a TON wallet. + +```go +type TonWalletTransfer struct { + // Unique identifier of the transaction; may be empty if the transfer hasn't been sent yet + TransactionID string `json:"transaction_id"` + // Address of the transfer peer in the TON blockchain + PeerAddress string `json:"peer_address"` + // The amount of transferred cryptocurrency, in the smallest units of the cryptocurrency, as a decimal number; negative for outgoing transfers + Amount string `json:"amount"` + // Optional. Comment added to the transfer; omitted if the comment is encrypted + Comment string `json:"comment,omitempty"` +} +``` + -## type [TransactionPartner]() +## type [TransactionPartner]() TransactionPartner is a union type. The following concrete variants implement it: @@ -18742,7 +19673,7 @@ type TransactionPartner interface { ``` -### func [UnmarshalTransactionPartner]() +### func [UnmarshalTransactionPartner]() ```go func UnmarshalTransactionPartner(data []byte) (TransactionPartner, error) @@ -18751,7 +19682,7 @@ func UnmarshalTransactionPartner(data []byte) (TransactionPartner, error) UnmarshalTransactionPartner decodes a TransactionPartner from JSON by inspecting the "type" field and dispatching to the correct concrete type. -## type [TransactionPartnerAffiliateProgram]() +## type [TransactionPartnerAffiliateProgram]() Describes the affiliate program that issued the affiliate commission received via this transaction. @@ -18767,7 +19698,7 @@ type TransactionPartnerAffiliateProgram struct { ``` -### func \(\*TransactionPartnerAffiliateProgram\) [MarshalJSON]() +### func \(\*TransactionPartnerAffiliateProgram\) [MarshalJSON]() ```go func (v *TransactionPartnerAffiliateProgram) MarshalJSON() ([]byte, error) @@ -18776,7 +19707,7 @@ func (v *TransactionPartnerAffiliateProgram) MarshalJSON() ([]byte, error) MarshalJSON encodes TransactionPartnerAffiliateProgram with the discriminator field "type" forced to "affiliate\_program". The hardcoded value frees callers from setting Type by hand — any user\-supplied value on the struct literal is overridden so a typo can't slip through to Telegram. -## type [TransactionPartnerChat]() +## type [TransactionPartnerChat]() Describes a transaction with a chat. @@ -18792,7 +19723,7 @@ type TransactionPartnerChat struct { ``` -### func \(\*TransactionPartnerChat\) [MarshalJSON]() +### func \(\*TransactionPartnerChat\) [MarshalJSON]() ```go func (v *TransactionPartnerChat) MarshalJSON() ([]byte, error) @@ -18801,7 +19732,7 @@ func (v *TransactionPartnerChat) MarshalJSON() ([]byte, error) MarshalJSON encodes TransactionPartnerChat with the discriminator field "type" forced to "chat". The hardcoded value frees callers from setting Type by hand — any user\-supplied value on the struct literal is overridden so a typo can't slip through to Telegram. -## type [TransactionPartnerFragment]() +## type [TransactionPartnerFragment]() Describes a withdrawal transaction with Fragment. @@ -18815,7 +19746,7 @@ type TransactionPartnerFragment struct { ``` -### func \(\*TransactionPartnerFragment\) [MarshalJSON]() +### func \(\*TransactionPartnerFragment\) [MarshalJSON]() ```go func (v *TransactionPartnerFragment) MarshalJSON() ([]byte, error) @@ -18824,7 +19755,7 @@ func (v *TransactionPartnerFragment) MarshalJSON() ([]byte, error) MarshalJSON encodes TransactionPartnerFragment with the discriminator field "type" forced to "fragment". The hardcoded value frees callers from setting Type by hand — any user\-supplied value on the struct literal is overridden so a typo can't slip through to Telegram. -### func \(\*TransactionPartnerFragment\) [UnmarshalJSON]() +### func \(\*TransactionPartnerFragment\) [UnmarshalJSON]() ```go func (m *TransactionPartnerFragment) UnmarshalJSON(data []byte) error @@ -18833,7 +19764,7 @@ func (m *TransactionPartnerFragment) UnmarshalJSON(data []byte) error UnmarshalJSON decodes TransactionPartnerFragment by dispatching union\-typed fields \(WithdrawalState\) through their concrete UnmarshalXxx helpers. -## type [TransactionPartnerOther]() +## type [TransactionPartnerOther]() Describes a transaction with an unknown source or recipient. @@ -18845,7 +19776,7 @@ type TransactionPartnerOther struct { ``` -### func \(\*TransactionPartnerOther\) [MarshalJSON]() +### func \(\*TransactionPartnerOther\) [MarshalJSON]() ```go func (v *TransactionPartnerOther) MarshalJSON() ([]byte, error) @@ -18854,7 +19785,7 @@ func (v *TransactionPartnerOther) MarshalJSON() ([]byte, error) MarshalJSON encodes TransactionPartnerOther with the discriminator field "type" forced to "other". The hardcoded value frees callers from setting Type by hand — any user\-supplied value on the struct literal is overridden so a typo can't slip through to Telegram. -## type [TransactionPartnerTelegramAds]() +## type [TransactionPartnerTelegramAds]() Describes a withdrawal transaction to the Telegram Ads platform. @@ -18866,7 +19797,7 @@ type TransactionPartnerTelegramAds struct { ``` -### func \(\*TransactionPartnerTelegramAds\) [MarshalJSON]() +### func \(\*TransactionPartnerTelegramAds\) [MarshalJSON]() ```go func (v *TransactionPartnerTelegramAds) MarshalJSON() ([]byte, error) @@ -18875,7 +19806,7 @@ func (v *TransactionPartnerTelegramAds) MarshalJSON() ([]byte, error) MarshalJSON encodes TransactionPartnerTelegramAds with the discriminator field "type" forced to "telegram\_ads". The hardcoded value frees callers from setting Type by hand — any user\-supplied value on the struct literal is overridden so a typo can't slip through to Telegram. -## type [TransactionPartnerTelegramApi]() +## type [TransactionPartnerTelegramApi]() Describes a transaction with payment for paid broadcasting. @@ -18889,7 +19820,7 @@ type TransactionPartnerTelegramApi struct { ``` -### func \(\*TransactionPartnerTelegramApi\) [MarshalJSON]() +### func \(\*TransactionPartnerTelegramApi\) [MarshalJSON]() ```go func (v *TransactionPartnerTelegramApi) MarshalJSON() ([]byte, error) @@ -18898,7 +19829,7 @@ func (v *TransactionPartnerTelegramApi) MarshalJSON() ([]byte, error) MarshalJSON encodes TransactionPartnerTelegramApi with the discriminator field "type" forced to "telegram\_api". The hardcoded value frees callers from setting Type by hand — any user\-supplied value on the struct literal is overridden so a typo can't slip through to Telegram. -## type [TransactionPartnerType]() +## type [TransactionPartnerType]() @@ -18921,7 +19852,7 @@ const ( ``` -## type [TransactionPartnerUser]() +## type [TransactionPartnerUser]() Describes a transaction with a user. @@ -18951,7 +19882,7 @@ type TransactionPartnerUser struct { ``` -### func \(\*TransactionPartnerUser\) [MarshalJSON]() +### func \(\*TransactionPartnerUser\) [MarshalJSON]() ```go func (v *TransactionPartnerUser) MarshalJSON() ([]byte, error) @@ -18960,7 +19891,7 @@ func (v *TransactionPartnerUser) MarshalJSON() ([]byte, error) MarshalJSON encodes TransactionPartnerUser with the discriminator field "type" forced to "user". The hardcoded value frees callers from setting Type by hand — any user\-supplied value on the struct literal is overridden so a typo can't slip through to Telegram. -### func \(\*TransactionPartnerUser\) [UnmarshalJSON]() +### func \(\*TransactionPartnerUser\) [UnmarshalJSON]() ```go func (m *TransactionPartnerUser) UnmarshalJSON(data []byte) error @@ -18969,7 +19900,7 @@ func (m *TransactionPartnerUser) UnmarshalJSON(data []byte) error UnmarshalJSON decodes TransactionPartnerUser by dispatching union\-typed fields \(PaidMedia\) through their concrete UnmarshalXxx helpers. -## type [TransactionPartnerUserTransactionType]() +## type [TransactionPartnerUserTransactionType]() @@ -18990,7 +19921,7 @@ const ( ``` -## type [TransferBusinessAccountStarsParams]() +## type [TransferBusinessAccountStarsParams]() TransferBusinessAccountStarsParams is the parameter set for TransferBusinessAccountStars. @@ -19006,19 +19937,19 @@ type TransferBusinessAccountStarsParams struct { ``` -## type [TransferGiftParams]() +## type [TransferGiftParams]() TransferGiftParams is the parameter set for TransferGift. -Transfers 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. +Transfers an owned unique gift to another user. Requires the can\_transfer\_and\_upgrade\_gifts business bot right. Requires the can\_transfer\_stars business bot right if the transfer is paid. Returns True on success. ```go type TransferGiftParams struct { // Unique identifier of the business connection BusinessConnectionID string `json:"business_connection_id"` - // Unique identifier of the regular gift that should be transferred + // Unique identifier of the unique gift that should be transferred OwnedGiftID string `json:"owned_gift_id"` - // Unique identifier of the chat which will own the gift. The chat must be active in the last 24 hours. + // Unique identifier of the chat which will own the gift. The chat must have been active in the last 24 hours. NewOwnerChatID int64 `json:"new_owner_chat_id"` // The amount of Telegram Stars that will be paid for the transfer from the business account balance. If positive, then the can_transfer_stars business bot right is required. StarCount *int64 `json:"star_count,omitempty"` @@ -19026,7 +19957,7 @@ type TransferGiftParams struct { ``` -## type [UnbanChatMemberParams]() +## type [UnbanChatMemberParams]() UnbanChatMemberParams is the parameter set for UnbanChatMember. @@ -19044,7 +19975,7 @@ type UnbanChatMemberParams struct { ``` -## type [UnbanChatSenderChatParams]() +## type [UnbanChatSenderChatParams]() UnbanChatSenderChatParams is the parameter set for UnbanChatSenderChat. @@ -19060,11 +19991,11 @@ type UnbanChatSenderChatParams struct { ``` -## type [UnhideGeneralForumTopicParams]() +## type [UnhideGeneralForumTopicParams]() UnhideGeneralForumTopicParams is the parameter set for UnhideGeneralForumTopic. -Use 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. +Use 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 right. Returns True on success. ```go type UnhideGeneralForumTopicParams struct { @@ -19074,7 +20005,7 @@ type UnhideGeneralForumTopicParams struct { ``` -## type [UniqueGift]() +## type [UniqueGift]() This object describes a unique gift that was upgraded from a regular gift. @@ -19094,7 +20025,7 @@ type UniqueGift struct { Symbol UniqueGiftSymbol `json:"symbol"` // Backdrop of the gift Backdrop UniqueGiftBackdrop `json:"backdrop"` - // Optional. True, if the original regular gift was exclusively purchaseable by Telegram Premium subscribers + // Optional. True, if the original regular gift was exclusively purchasable by Telegram Premium subscribers IsPremium *bool `json:"is_premium,omitempty"` // Optional. True, if the gift was used to craft another gift and isn't available anymore IsBurned *bool `json:"is_burned,omitempty"` @@ -19107,8 +20038,19 @@ type UniqueGift struct { } ``` + +### func [GetUniqueGift]() + +```go +func GetUniqueGift(ctx context.Context, b *client.Bot, p *GetUniqueGiftParams) (*UniqueGift, error) +``` + +GetUniqueGift calls the getUniqueGift Telegram Bot API method. + +Use this method to get information about a unique gift by its name. Returns a UniqueGift object on success. + -## type [UniqueGiftBackdrop]() +## type [UniqueGiftBackdrop]() This object describes the backdrop of a unique gift. @@ -19124,7 +20066,7 @@ type UniqueGiftBackdrop struct { ``` -## type [UniqueGiftBackdropColors]() +## type [UniqueGiftBackdropColors]() This object describes the colors of the backdrop of a unique gift. @@ -19142,7 +20084,7 @@ type UniqueGiftBackdropColors struct { ``` -## type [UniqueGiftColors]() +## type [UniqueGiftColors]() This object contains information about the color scheme for a user's name, message replies and link previews based on a unique gift. @@ -19164,7 +20106,7 @@ type UniqueGiftColors struct { ``` -## type [UniqueGiftInfo]() +## type [UniqueGiftInfo]() Describes a service message about a unique gift that was sent or received. @@ -19194,7 +20136,7 @@ type UniqueGiftInfo struct { ``` -## type [UniqueGiftInfoOrigin]() +## type [UniqueGiftInfoOrigin]() @@ -19215,7 +20157,7 @@ const ( ``` -## type [UniqueGiftModel]() +## type [UniqueGiftModel]() This object describes the model of a unique gift. @@ -19233,7 +20175,7 @@ type UniqueGiftModel struct { ``` -## type [UniqueGiftModelRarity]() +## type [UniqueGiftModelRarity]() @@ -19253,7 +20195,7 @@ const ( ``` -## type [UniqueGiftSymbol]() +## type [UniqueGiftSymbol]() This object describes the symbol shown on the pattern of a unique gift. @@ -19263,13 +20205,13 @@ type UniqueGiftSymbol struct { Name string `json:"name"` // The sticker that represents the unique gift Sticker Sticker `json:"sticker"` - // The number of unique gifts that receive this model for every 1000 gifts upgraded + // The number of unique gifts that receive this symbol for every 1000 gifts upgraded RarityPerMille int64 `json:"rarity_per_mille"` } ``` -## type [UnpinAllChatMessagesParams]() +## type [UnpinAllChatMessagesParams]() UnpinAllChatMessagesParams is the parameter set for UnpinAllChatMessages. @@ -19283,7 +20225,7 @@ type UnpinAllChatMessagesParams struct { ``` -## type [UnpinAllForumTopicMessagesParams]() +## type [UnpinAllForumTopicMessagesParams]() UnpinAllForumTopicMessagesParams is the parameter set for UnpinAllForumTopicMessages. @@ -19299,7 +20241,7 @@ type UnpinAllForumTopicMessagesParams struct { ``` -## type [UnpinAllGeneralForumTopicMessagesParams]() +## type [UnpinAllGeneralForumTopicMessagesParams]() UnpinAllGeneralForumTopicMessagesParams is the parameter set for UnpinAllGeneralForumTopicMessages. @@ -19313,7 +20255,7 @@ type UnpinAllGeneralForumTopicMessagesParams struct { ``` -## type [UnpinChatMessageParams]() +## type [UnpinChatMessageParams]() UnpinChatMessageParams is the parameter set for UnpinChatMessage. @@ -19331,13 +20273,13 @@ type UnpinChatMessageParams struct { ``` -## type [Update]() +## type [Update]() This object represents an incoming update.At most one of the optional fields can be present in any given update. ```go type Update struct { - // The update's unique identifier. Update identifiers start from a certain positive number and increase sequentially. This identifier becomes especially handy if you're using webhooks, since it allows you to ignore repeated updates or to restore the correct update sequence, should they get out of order. If there are no new updates for at least a week, then identifier of the next update will be chosen randomly instead of sequentially. + // The update's unique identifier. Update identifiers start from a certain positive number and increase sequentially. This identifier becomes especially handy if you're using webhooks, since it allows you to ignore repeated updates or to restore the correct update sequence, should they get out of order. If there are no new updates for at least a week, then the identifier of the next update will be chosen randomly instead of sequentially. UpdateID int64 `json:"update_id"` // Optional. New incoming message of any kind - text, photo, sticker, etc. Message *Message `json:"message,omitempty"` @@ -19359,21 +20301,25 @@ type Update struct { GuestMessage *Message `json:"guest_message,omitempty"` // Optional. A reaction to a message was changed by a user. The bot must be an administrator in the chat and must explicitly specify "message_reaction" in the list of allowed_updates to receive these updates. The update isn't received for reactions set by bots. MessageReaction *MessageReactionUpdated `json:"message_reaction,omitempty"` - // Optional. Reactions to a message with anonymous reactions were changed. The bot must be an administrator in the chat and must explicitly specify "message_reaction_count" in the list of allowed_updates to receive these updates. The updates are grouped and can be sent with delay up to a few minutes. + // Optional. Reactions to a message with anonymous reactions were changed. The bot must be an administrator in the chat and must explicitly specify "message_reaction_count" in the list of allowed_updates to receive these updates. The updates are grouped and can be sent with a delay of up to a few minutes. MessageReactionCount *MessageReactionCountUpdated `json:"message_reaction_count,omitempty"` // Optional. New incoming inline query InlineQuery *InlineQuery `json:"inline_query,omitempty"` - // Optional. The result of an inline query that was chosen by a user and sent to their chat partner. Please see our documentation on the feedback collecting for details on how to enable these updates for your bot. + // Optional. The result of an inline query that was chosen by a user and sent to their chat partner. Please see our documentation on the feedback collecting for details on how to enable these updates for your bot. The updates can also be enabled using the parameter inline_feedback_share_denominator of the method setMySettings. ChosenInlineResult *ChosenInlineResult `json:"chosen_inline_result,omitempty"` // Optional. New incoming callback query CallbackQuery *CallbackQuery `json:"callback_query,omitempty"` + // Optional. New incoming query from a widget in a message sent by the bot or via the bot + WidgetQuery *WidgetQuery `json:"widget_query,omitempty"` + // Optional. New incoming query from a forwarded message with a shared widget + SharedWidgetQuery *SharedWidgetQuery `json:"shared_widget_query,omitempty"` // Optional. New incoming shipping query. Only for invoices with flexible price. ShippingQuery *ShippingQuery `json:"shipping_query,omitempty"` // Optional. New incoming pre-checkout query. Contains full information about checkout. PreCheckoutQuery *PreCheckoutQuery `json:"pre_checkout_query,omitempty"` // Optional. A user purchased paid media with a non-empty payload sent by the bot in a non-channel chat PurchasedPaidMedia *PaidMediaPurchased `json:"purchased_paid_media,omitempty"` - // Optional. New poll state. Bots receive only updates about manually stopped polls and polls, which are sent by the bot. + // Optional. New poll state. Bots receive only updates about manually stopped polls and polls which are sent by the bot. Poll *Poll `json:"poll,omitempty"` // Optional. A user changed their answer in a non-anonymous poll. Bots receive new votes only in polls that were sent by the bot itself. PollAnswer *PollAnswer `json:"poll_answer,omitempty"` @@ -19387,7 +20333,7 @@ type Update struct { ChatBoost *ChatBoostUpdated `json:"chat_boost,omitempty"` // Optional. A boost was removed from a chat. The bot must be an administrator in the chat to receive these updates. RemovedChatBoost *ChatBoostRemoved `json:"removed_chat_boost,omitempty"` - // Optional. A new bot was created to be managed by the bot, or token or owner of a managed bot was changed + // Optional. A new bot was created to be managed by the bot, or the token or owner of a managed bot was changed ManagedBot *ManagedBotUpdated `json:"managed_bot,omitempty"` // Optional. User payment subscription has changed Subscription *BotSubscriptionUpdated `json:"subscription,omitempty"` @@ -19447,7 +20393,7 @@ const ( ``` -## type [UpgradeGiftParams]() +## type [UpgradeGiftParams]() UpgradeGiftParams is the parameter set for UpgradeGift. @@ -19461,13 +20407,13 @@ type UpgradeGiftParams struct { OwnedGiftID string `json:"owned_gift_id"` // Pass True to keep the original gift text, sender and receiver in the upgraded gift KeepOriginalDetails *bool `json:"keep_original_details,omitempty"` - // The amount of Telegram Stars that will be paid for the upgrade from the business account balance. If gift.prepaid_upgrade_star_count > 0, then pass 0, otherwise, the can_transfer_stars business bot right is required and gift.upgrade_star_count must be passed. + // The amount of Telegram Stars that will be paid for the upgrade from the business account balance. If gift.prepaid_upgrade_star_count > 0, then pass 0; otherwise, the can_transfer_stars business bot right is required and gift.upgrade_star_count must be passed. StarCount *int64 `json:"star_count,omitempty"` } ``` -## type [UploadStickerFileParams]() +## type [UploadStickerFileParams]() UploadStickerFileParams is the parameter set for UploadStickerFile. @@ -19485,7 +20431,7 @@ type UploadStickerFileParams struct { ``` -### func \(\*UploadStickerFileParams\) [HasFile]() +### func \(\*UploadStickerFileParams\) [HasFile]() ```go func (p *UploadStickerFileParams) HasFile() bool @@ -19494,7 +20440,7 @@ func (p *UploadStickerFileParams) HasFile() bool HasFile reports whether a multipart upload is required. -### func \(\*UploadStickerFileParams\) [MultipartFields]() +### func \(\*UploadStickerFileParams\) [MultipartFields]() ```go func (p *UploadStickerFileParams) MultipartFields() map[string]string @@ -19503,7 +20449,7 @@ func (p *UploadStickerFileParams) MultipartFields() map[string]string MultipartFields returns the non\-file fields used in the multipart body. -### func \(\*UploadStickerFileParams\) [MultipartFiles]() +### func \(\*UploadStickerFileParams\) [MultipartFiles]() ```go func (p *UploadStickerFileParams) MultipartFiles() []client.MultipartFile @@ -19512,13 +20458,13 @@ func (p *UploadStickerFileParams) MultipartFiles() []client.MultipartFile MultipartFiles returns the file parts. -## type [User]() +## type [User]() This object represents a Telegram user or bot. ```go type User struct { - // Unique identifier for this user or bot. This number may have more than 32 significant bits and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a 64-bit integer or double-precision float type are safe for storing this identifier. + // Unique identifier for this user or bot. This number may have more than 32 significant bits and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a 64-bit integer or double-precision float type is safe for storing this identifier. ID int64 `json:"id"` // True, if this user is a bot IsBot bool `json:"is_bot"` @@ -19534,42 +20480,11 @@ type User struct { IsPremium *bool `json:"is_premium,omitempty"` // Optional. True, if this user added the bot to the attachment menu AddedToAttachmentMenu *bool `json:"added_to_attachment_menu,omitempty"` - // Optional. True, if the bot can be invited to groups. Returned only in getMe. - CanJoinGroups *bool `json:"can_join_groups,omitempty"` - // Optional. True, if privacy mode is disabled for the bot. Returned only in getMe. - CanReadAllGroupMessages *bool `json:"can_read_all_group_messages,omitempty"` - // Optional. True, if the bot supports guest queries from chats it is not a member of. Returned only in getMe. - SupportsGuestQueries *bool `json:"supports_guest_queries,omitempty"` - // Optional. True, if the bot supports inline queries. Returned only in getMe. - SupportsInlineQueries *bool `json:"supports_inline_queries,omitempty"` - // Optional. True, if the bot can be connected to a user account to manage it. Returned only in getMe. - CanConnectToBusiness *bool `json:"can_connect_to_business,omitempty"` - // Optional. True, if the bot has a main Web App. Returned only in getMe. - HasMainWebApp *bool `json:"has_main_web_app,omitempty"` - // Optional. True, if the bot has forum topic mode enabled in private chats. Returned only in getMe. - HasTopicsEnabled *bool `json:"has_topics_enabled,omitempty"` - // Optional. True, if the bot allows users to create and delete topics in private chats. Returned only in getMe. - AllowsUsersToCreateTopics *bool `json:"allows_users_to_create_topics,omitempty"` - // Optional. True, if other bots can be created to be controlled by the bot. Returned only in getMe. - CanManageBots *bool `json:"can_manage_bots,omitempty"` - // Optional. True, if the bot supports join request queries and can be assigned to process them. Returned only in getMe. - SupportsJoinRequestQueries *bool `json:"supports_join_request_queries,omitempty"` } ``` - -### func [GetMe]() - -```go -func GetMe(ctx context.Context, b *client.Bot, p *GetMeParams) (*User, error) -``` - -GetMe calls the getMe Telegram Bot API method. - -A simple method for testing your bot's authentication token. Requires no parameters. Returns basic information about the bot in form of a User object. - -## type [UserChatBoosts]() +## type [UserChatBoosts]() This object represents a list of boosts added to a chat by a user. @@ -19581,7 +20496,7 @@ type UserChatBoosts struct { ``` -### func [GetUserChatBoosts]() +### func [GetUserChatBoosts]() ```go func GetUserChatBoosts(ctx context.Context, b *client.Bot, p *GetUserChatBoostsParams) (*UserChatBoosts, error) @@ -19592,7 +20507,7 @@ GetUserChatBoosts calls the getUserChatBoosts Telegram Bot API method. Use 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. -## type [UserProfileAudios]() +## type [UserProfileAudios]() This object represents the audios displayed on a user's profile. @@ -19606,7 +20521,7 @@ type UserProfileAudios struct { ``` -### func [GetUserProfileAudios]() +### func [GetUserProfileAudios]() ```go func GetUserProfileAudios(ctx context.Context, b *client.Bot, p *GetUserProfileAudiosParams) (*UserProfileAudios, error) @@ -19617,9 +20532,9 @@ GetUserProfileAudios calls the getUserProfileAudios Telegram Bot API method. Use this method to get a list of profile audios for a user. Returns a UserProfileAudios object. -## type [UserProfilePhotos]() +## type [UserProfilePhotos]() -This object represent a user's profile pictures. +This object represents a user's profile pictures. ```go type UserProfilePhotos struct { @@ -19631,7 +20546,7 @@ type UserProfilePhotos struct { ``` -### func [GetUserProfilePhotos]() +### func [GetUserProfilePhotos]() ```go func GetUserProfilePhotos(ctx context.Context, b *client.Bot, p *GetUserProfilePhotosParams) (*UserProfilePhotos, error) @@ -19642,13 +20557,13 @@ GetUserProfilePhotos calls the getUserProfilePhotos Telegram Bot API method. Use this method to get a list of profile pictures for a user. Returns a UserProfilePhotos object. -## type [UserRating]() +## type [UserRating]() -This object describes the rating of a user based on their Telegram Star spendings. +This object describes the rating of a user based on their Telegram Star spending. ```go type UserRating struct { - // Current level of the user, indicating their reliability when purchasing digital goods and services. A higher level suggests a more trustworthy customer; a negative level is likely reason for concern. + // Current level of the user, indicating their reliability when purchasing digital goods and services. A higher level suggests a more trustworthy customer; a negative level is likely a reason for concern. Level int64 `json:"level"` // Numerical value of the user's rating; the higher the rating, the better Rating int64 `json:"rating"` @@ -19660,7 +20575,7 @@ type UserRating struct { ``` -## type [UsersShared]() +## type [UsersShared]() This object contains information about the users whose identifiers were shared with the bot using a KeyboardButtonRequestUsers button. @@ -19674,7 +20589,7 @@ type UsersShared struct { ``` -## type [Venue]() +## type [Venue]() This object represents a venue. @@ -19698,7 +20613,7 @@ type Venue struct { ``` -## type [VerifyChatParams]() +## type [VerifyChatParams]() VerifyChatParams is the parameter set for VerifyChat. @@ -19706,15 +20621,19 @@ Verifies a chat on behalf of the organization which is represented by the bot. R ```go type VerifyChatParams struct { - // Unique identifier for the target chat or username of the target bot, supergroup or channel in the format @username. Channel direct messages chats can't be verified. + // Unique identifier for the target chat or username of the target bot, supergroup, or channel in the format @username. Channel direct messages chats can't be verified. ChatID ChatID `json:"chat_id"` // Custom description for the verification; 0-70 characters. Must be empty if the organization isn't allowed to provide a custom verification description. CustomDescription string `json:"custom_description,omitempty"` + // Mode for parsing entities in the custom description. See formatting options for more details. Only “text_link” entities are supported. + CustomDescriptionParseMode ParseMode `json:"custom_description_parse_mode,omitempty"` + // A JSON-serialized list of special entities that appear in the custom description, which can be specified instead of custom_description_parse_mode. Only “text_link” entities are supported. + CustomDescriptionEntities []MessageEntity `json:"custom_description_entities,omitempty"` } ``` -## type [VerifyUserParams]() +## type [VerifyUserParams]() VerifyUserParams is the parameter set for VerifyUser. @@ -19726,11 +20645,15 @@ type VerifyUserParams struct { UserID int64 `json:"user_id"` // Custom description for the verification; 0-70 characters. Must be empty if the organization isn't allowed to provide a custom verification description. CustomDescription string `json:"custom_description,omitempty"` + // Mode for parsing entities in the custom description. See formatting options for more details. Only “text_link” entities are supported. + CustomDescriptionParseMode ParseMode `json:"custom_description_parse_mode,omitempty"` + // A JSON-serialized list of special entities that appear in the custom description, which can be specified instead of custom_description_parse_mode. Only “text_link” entities are supported. + CustomDescriptionEntities []MessageEntity `json:"custom_description_entities,omitempty"` } ``` -## type [Video]() +## type [Video]() This object represents a video file. @@ -19758,13 +20681,13 @@ type Video struct { FileName string `json:"file_name,omitempty"` // Optional. MIME type of the file as defined by the sender MimeType string `json:"mime_type,omitempty"` - // Optional. File size in bytes. It can be bigger than 2^31 and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a signed 64-bit integer or double-precision float type are safe for storing this value. + // Optional. File size in bytes. It can be bigger than 2^31 and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a signed 64-bit integer or double-precision float type is safe for storing this value. FileSize *int64 `json:"file_size,omitempty"` } ``` -## type [VideoChatEnded]() +## type [VideoChatEnded]() This object represents a service message about a video chat ended in the chat. @@ -19776,7 +20699,7 @@ type VideoChatEnded struct { ``` -## type [VideoChatParticipantsInvited]() +## type [VideoChatParticipantsInvited]() This object represents a service message about new members invited to a video chat. @@ -19788,7 +20711,7 @@ type VideoChatParticipantsInvited struct { ``` -## type [VideoChatScheduled]() +## type [VideoChatScheduled]() This object represents a service message about a video chat scheduled in the chat. @@ -19800,7 +20723,7 @@ type VideoChatScheduled struct { ``` -## type [VideoChatStarted]() +## type [VideoChatStarted]() This object represents a service message about a video chat started in the chat. Currently holds no information. @@ -19810,7 +20733,7 @@ type VideoChatStarted struct { ``` -## type [VideoNote]() +## type [VideoNote]() This object represents a video message. @@ -19832,7 +20755,7 @@ type VideoNote struct { ``` -## type [VideoQuality]() +## type [VideoQuality]() This object represents a video file of a specific quality. @@ -19848,13 +20771,13 @@ type VideoQuality struct { Height int64 `json:"height"` // Codec that was used to encode the video, for example, “h264”, “h265”, or “av01” Codec string `json:"codec"` - // Optional. File size in bytes. It can be bigger than 2^31 and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a signed 64-bit integer or double-precision float type are safe for storing this value. + // Optional. File size in bytes. It can be bigger than 2^31 and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a signed 64-bit integer or double-precision float type is safe for storing this value. FileSize *int64 `json:"file_size,omitempty"` } ``` -## type [Voice]() +## type [Voice]() This object represents a voice note. @@ -19868,13 +20791,13 @@ type Voice struct { Duration int64 `json:"duration"` // Optional. MIME type of the file as defined by the sender MimeType string `json:"mime_type,omitempty"` - // Optional. File size in bytes. It can be bigger than 2^31 and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a signed 64-bit integer or double-precision float type are safe for storing this value. + // Optional. File size in bytes. It can be bigger than 2^31 and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a signed 64-bit integer or double-precision float type is safe for storing this value. FileSize *int64 `json:"file_size,omitempty"` } ``` -## type [WebAppData]() +## type [WebAppData]() Describes data sent from a Web App to the bot. @@ -19888,7 +20811,7 @@ type WebAppData struct { ``` -## type [WebAppInfo]() +## type [WebAppInfo]() Describes a Web App. @@ -19900,7 +20823,7 @@ type WebAppInfo struct { ``` -## type [WebhookInfo]() +## type [WebhookInfo]() Describes the current status of a webhook. @@ -19936,12 +20859,209 @@ func GetWebhookInfo(ctx context.Context, b *client.Bot, p *GetWebhookInfoParams) GetWebhookInfo calls the getWebhookInfo Telegram Bot API method. -Use 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. +Use this method to get the current webhook status. Requires no parameters. On success, returns a WebhookInfo object. If the bot is using getUpdates, it will return an object with the url field empty. + + +## type [Widget]() + +This object describes an HTML widget. + +```go +type Widget struct { + // Optional. Unique identifier of the shared widget, which can be used to send the widget again using the method sendSharedWidget; omitted if the widget isn't shared + ID string `json:"id,omitempty"` + // Optional. Width of the widget in logical pixels; omitted if the widget must occupy the whole width of the message bubble + Width *int64 `json:"width,omitempty"` + // Optional. Height of the widget in logical pixels; omitted if the height of the widget isn't fixed + Height *int64 `json:"height,omitempty"` + // HTML code of the widget + HTML string `json:"html"` + // Optional. Public data of the widget, which is available wherever the widget is shown. All messages with a shared widget have the same public data. + PublicData string `json:"public_data,omitempty"` + // Optional. Data of the widget, which is specific to the message + ChatData string `json:"chat_data,omitempty"` +} +``` + + +## type [WidgetQuery]() + +This 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 widgets. + +```go +type WidgetQuery struct { + // Unique identifier for this query + ID string `json:"id"` + // Sender + From User `json:"from"` + // Optional. Chat with the message containing the widget; omitted if the widget is in an inline message + Chat *Chat `json:"chat,omitempty"` + // Optional. Identifier of the message containing the widget; omitted if the widget is in an inline message + MessageID *int64 `json:"message_id,omitempty"` + // Optional. Identifier of the inline message containing the widget + InlineMessageID string `json:"inline_message_id,omitempty"` + // Global identifier, uniquely corresponding to the chat to which the message with the widget was sent + ChatInstance string `json:"chat_instance"` + // Optional. For widgets in inline messages, type of the chat to which the message was sent. Can be either “sender” for a private chat with the inline query sender, “private”, “group”, “supergroup”, or “channel”. + ChatType InlineQueryChatType `json:"chat_type,omitempty"` + // Type of the query + Type WidgetQueryType `json:"type"` + // Data of the query, 1-64 bytes + Data string `json:"data"` + // Optional. Unique identifier of the shared widget, which sent the query; omitted if the widget isn't shared + WidgetID string `json:"widget_id,omitempty"` +} +``` + + +### func \(\*WidgetQuery\) [UnmarshalJSON]() + +```go +func (m *WidgetQuery) UnmarshalJSON(data []byte) error +``` + +UnmarshalJSON decodes WidgetQuery by dispatching union\-typed fields \(Type\) through their concrete UnmarshalXxx helpers. + + +## type [WidgetQueryType]() + +WidgetQueryType is a union type. The following concrete variants implement it: + +- WidgetQueryTypeData +- WidgetQueryTypeSignData +- WidgetQueryTypeSentTransaction + +This object describes the type of a query from a widget. Currently, it can be one of + +```go +type WidgetQueryType interface { + // contains filtered or unexported methods +} +``` + + +### func [UnmarshalWidgetQueryType]() + +```go +func UnmarshalWidgetQueryType(data []byte) (WidgetQueryType, error) +``` + +UnmarshalWidgetQueryType decodes a WidgetQueryType from JSON by inspecting the "type" field and dispatching to the correct concrete type. + + +## type [WidgetQueryTypeData]() + +The query contains data for the bot. + +```go +type WidgetQueryTypeData struct { + // Type of the query, always “data” + Type WidgetQueryTypeKind `json:"type"` + // Optional. TON wallet card of the user who sent the query, if it was sent to the bot along with the query + WalletCard *TonWalletCard `json:"wallet_card,omitempty"` +} +``` + + +### func \(\*WidgetQueryTypeData\) [MarshalJSON]() + +```go +func (v *WidgetQueryTypeData) MarshalJSON() ([]byte, error) +``` + +MarshalJSON encodes WidgetQueryTypeData with the discriminator field "type" forced to "data". The hardcoded value frees callers from setting Type by hand — any user\-supplied value on the struct literal is overridden so a typo can't slip through to Telegram. + + +## type [WidgetQueryTypeKind]() + + + +```go +type WidgetQueryTypeKind string +``` + + + +```go +const ( + WidgetQueryTypeKindData WidgetQueryTypeKind = "data" + WidgetQueryTypeKindSignData WidgetQueryTypeKind = "sign_data" + WidgetQueryTypeKindSentTransaction WidgetQueryTypeKind = "sent_transaction" +) +``` + + +## type [WidgetQueryTypeSentTransaction]() + +The query notifies the bot about a transaction sent from a TON wallet of the user who sent the query. + +```go +type WidgetQueryTypeSentTransaction struct { + // Type of the query, always “sent_transaction” + Type WidgetQueryTypeKind `json:"type"` + // The wallet from which the transaction was sent + Wallet WidgetQueryWallet `json:"wallet"` + // Value of msg_hash of the transaction + MsgHash string `json:"msg_hash"` +} +``` + + +### func \(\*WidgetQueryTypeSentTransaction\) [MarshalJSON]() + +```go +func (v *WidgetQueryTypeSentTransaction) MarshalJSON() ([]byte, error) +``` + +MarshalJSON encodes WidgetQueryTypeSentTransaction with the discriminator field "type" forced to "sent\_transaction". The hardcoded value frees callers from setting Type by hand — any user\-supplied value on the struct literal is overridden so a typo can't slip through to Telegram. + + +## type [WidgetQueryTypeSignData]() + +The query contains data signed by a TON wallet of the user who sent the query. The data is signed for the domain bot\, where \ is the identifier of the bot. + +```go +type WidgetQueryTypeSignData struct { + // Type of the query, always “sign_data” + Type WidgetQueryTypeKind `json:"type"` + // The wallet that signed the data + Wallet WidgetQueryWallet `json:"wallet"` + // JSON-serialized signed data + SignData string `json:"sign_data"` +} +``` + + +### func \(\*WidgetQueryTypeSignData\) [MarshalJSON]() + +```go +func (v *WidgetQueryTypeSignData) MarshalJSON() ([]byte, error) +``` + +MarshalJSON encodes WidgetQueryTypeSignData with the discriminator field "type" forced to "sign\_data". The hardcoded value frees callers from setting Type by hand — any user\-supplied value on the struct literal is overridden so a typo can't slip through to Telegram. + + +## type [WidgetQueryWallet]() + +This object describes a TON wallet of the user, which is used in a query from a widget. + +```go +type WidgetQueryWallet struct { + // Address of the wallet + Address string `json:"address"` + // Balance of the wallet, in the smallest units of the cryptocurrency, as a decimal number + Amount string `json:"amount"` + // Optional. Hex-encoded public key of the wallet; omitted if unknown + PublicKey string `json:"public_key,omitempty"` + // Optional. Base64-encoded serialized StateInit of the wallet contract; omitted if and only if public_key is omitted + StateInit string `json:"state_init,omitempty"` +} +``` -## type [WriteAccessAllowed]() +## type [WriteAccessAllowed]() -This 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 method requestWriteAccess. +This 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 method requestWriteAccess, or about a user being invited to the private chat with the bot by the owner of the bot. ```go type WriteAccessAllowed struct { @@ -19951,6 +21071,8 @@ type WriteAccessAllowed struct { WebAppName string `json:"web_app_name,omitempty"` // Optional. True, if the access was granted when the bot was added to the attachment or side menu FromAttachmentMenu *bool `json:"from_attachment_menu,omitempty"` + // Optional. The owner of the bot, if the access was granted when the owner invited the user to the private chat with the bot. Bot owners can invite up to 10 users at once by pressing the link https://t.me/botinvite/. + Inviter *User `json:"inviter,omitempty"` } ``` diff --git a/examples/admin/main.go b/examples/admin/main.go index 29e52c7..3e55b28 100644 --- a/examples/admin/main.go +++ b/examples/admin/main.go @@ -102,7 +102,7 @@ func main() { router.OnCommand("/start", func(c *dispatch.Context, m *api.Message) error { _, err := api.SendMessage(c.Ctx, c.Bot, &api.SendMessageParams{ - ChatID: api.ChatIDFromInt(m.Chat.ID), + ChatID: api.Ptr(api.ChatIDFromInt(m.Chat.ID)), Text: "You are authorized.", }) return err @@ -114,7 +114,7 @@ func main() { return nil } _, err := api.SendMessage(c.Ctx, c.Bot, &api.SendMessageParams{ - ChatID: api.ChatIDFromInt(m.Chat.ID), + ChatID: api.Ptr(api.ChatIDFromInt(m.Chat.ID)), Text: "Your user ID is: " + strconv.FormatInt(from.ID, 10), }) return err diff --git a/examples/callback/handlers.go b/examples/callback/handlers.go index abd1787..7a5f876 100644 --- a/examples/callback/handlers.go +++ b/examples/callback/handlers.go @@ -56,7 +56,7 @@ func handleCallback(c *dispatch.Context, q *api.CallbackQuery) error { func sendMenu(ctx context.Context, bot *client.Bot, chatID int64, value int) error { _, err := api.SendMessage(ctx, bot, &api.SendMessageParams{ - ChatID: api.ChatIDFromInt(chatID), + ChatID: api.Ptr(api.ChatIDFromInt(chatID)), Text: fmt.Sprintf("Counter: %d", value), ReplyMarkup: counterKeyboard(value), }) diff --git a/examples/callback/handlers_test.go b/examples/callback/handlers_test.go index 53f6089..94d7ab4 100644 --- a/examples/callback/handlers_test.go +++ b/examples/callback/handlers_test.go @@ -114,7 +114,7 @@ func TestHandleCallback_Increments(t *testing.T) { buf := new(bytes.Buffer) _, _ = buf.ReadFrom(r.Body) return strings.Contains(buf.String(), `"Counter: 6"`) - })).Return(okResp(editMsgResult), nil) + })).Return(okResp(`{"ok":true,"result":true}`), nil) bot := client.New("test:token", client.WithHTTPClient(m)) q := callbackQuery("count:5:inc", 10, 42) @@ -137,7 +137,7 @@ func TestHandleCallback_Decrements(t *testing.T) { buf := new(bytes.Buffer) _, _ = buf.ReadFrom(r.Body) return strings.Contains(buf.String(), `"Counter: 4"`) - })).Return(okResp(editMsgResult), nil) + })).Return(okResp(`{"ok":true,"result":true}`), nil) bot := client.New("test:token", client.WithHTTPClient(m)) q := callbackQuery("count:5:dec", 10, 42) diff --git a/examples/conversation/handlers.go b/examples/conversation/handlers.go index 10353b0..926f087 100644 --- a/examples/conversation/handlers.go +++ b/examples/conversation/handlers.go @@ -25,7 +25,7 @@ func buildConv(storage conversation.Storage) *conversation.Conversation { Filter: onMsg(msgfilter.Command("/newbot")), Handler: func(c *dispatch.Context, u *api.Update) error { _, _ = api.SendMessage(c.Ctx, c.Bot, &api.SendMessageParams{ - ChatID: api.ChatIDFromInt(u.Message.Chat.ID), + ChatID: api.Ptr(api.ChatIDFromInt(u.Message.Chat.ID)), Text: "What should the bot's name be?", }) return conversation.Next("await_name") @@ -36,7 +36,7 @@ func buildConv(storage conversation.Storage) *conversation.Conversation { Filter: notCmd, Handler: func(c *dispatch.Context, u *api.Update) error { _, _ = api.SendMessage(c.Ctx, c.Bot, &api.SendMessageParams{ - ChatID: api.ChatIDFromInt(u.Message.Chat.ID), + ChatID: api.Ptr(api.ChatIDFromInt(u.Message.Chat.ID)), Text: "Got it! What's the description?", }) return conversation.Next("await_desc") @@ -46,7 +46,7 @@ func buildConv(storage conversation.Storage) *conversation.Conversation { Filter: notCmd, Handler: func(c *dispatch.Context, u *api.Update) error { _, _ = api.SendMessage(c.Ctx, c.Bot, &api.SendMessageParams{ - ChatID: api.ChatIDFromInt(u.Message.Chat.ID), + ChatID: api.Ptr(api.ChatIDFromInt(u.Message.Chat.ID)), Text: "Done! Your bot has been configured.", }) return conversation.End() @@ -57,7 +57,7 @@ func buildConv(storage conversation.Storage) *conversation.Conversation { Filter: onMsg(msgfilter.Command("/cancel")), Handler: func(c *dispatch.Context, u *api.Update) error { _, _ = api.SendMessage(c.Ctx, c.Bot, &api.SendMessageParams{ - ChatID: api.ChatIDFromInt(u.Message.Chat.ID), + ChatID: api.Ptr(api.ChatIDFromInt(u.Message.Chat.ID)), Text: "Cancelled.", }) return conversation.End() diff --git a/examples/echo/handlers.go b/examples/echo/handlers.go index eb96e23..285fe63 100644 --- a/examples/echo/handlers.go +++ b/examples/echo/handlers.go @@ -16,7 +16,7 @@ func register(r *dispatch.Router) { func handleStart(c *dispatch.Context, m *api.Message) error { _, err := api.SendMessage(c.Ctx, c.Bot, &api.SendMessageParams{ - ChatID: api.ChatIDFromInt(m.Chat.ID), + ChatID: api.Ptr(api.ChatIDFromInt(m.Chat.ID)), Text: fmt.Sprintf("hello %s, send me anything to echo", m.From.FirstName), }) return err @@ -24,7 +24,7 @@ func handleStart(c *dispatch.Context, m *api.Message) error { func handleEcho(c *dispatch.Context, m *api.Message) error { _, err := api.SendMessage(c.Ctx, c.Bot, &api.SendMessageParams{ - ChatID: api.ChatIDFromInt(m.Chat.ID), + ChatID: api.Ptr(api.ChatIDFromInt(m.Chat.ID)), Text: m.Text, ReplyParameters: &api.ReplyParameters{MessageID: &m.MessageID}, }) diff --git a/examples/files/main.go b/examples/files/main.go index 5a2ee8d..da685de 100644 --- a/examples/files/main.go +++ b/examples/files/main.go @@ -39,7 +39,7 @@ func main() { router.OnCommand("/start", func(c *dispatch.Context, m *api.Message) error { _, err := api.SendMessage(c.Ctx, c.Bot, &api.SendMessageParams{ - ChatID: api.ChatIDFromInt(m.Chat.ID), + ChatID: api.Ptr(api.ChatIDFromInt(m.Chat.ID)), Text: "Send me a document and I'll download then re-upload it.", }) return err @@ -88,7 +88,7 @@ func handleDocument(c *dispatch.Context, m *api.Message) error { name = "file" } _, err = api.SendDocument(c.Ctx, c.Bot, &api.SendDocumentParams{ - ChatID: api.ChatIDFromInt(m.Chat.ID), + ChatID: api.Ptr(api.ChatIDFromInt(m.Chat.ID)), Document: &api.InputFile{ Reader: bytes.NewReader(body), Filename: name, @@ -103,7 +103,7 @@ func handleDocument(c *dispatch.Context, m *api.Message) error { func reply(c *dispatch.Context, chatID int64, text string) error { _, err := api.SendMessage(c.Ctx, c.Bot, &api.SendMessageParams{ - ChatID: api.ChatIDFromInt(chatID), + ChatID: api.Ptr(api.ChatIDFromInt(chatID)), Text: text, }) return err diff --git a/examples/middleware/main.go b/examples/middleware/main.go index cb019a0..52518b2 100644 --- a/examples/middleware/main.go +++ b/examples/middleware/main.go @@ -74,7 +74,7 @@ func main() { router.OnCommand("/start", func(c *dispatch.Context, m *api.Message) error { _, err := api.SendMessage(c.Ctx, c.Bot, &api.SendMessageParams{ - ChatID: api.ChatIDFromInt(m.Chat.ID), + ChatID: api.Ptr(api.ChatIDFromInt(m.Chat.ID)), Text: "middleware demo: this update was timed and (optionally) auth-checked", }) return err diff --git a/examples/moderation/main.go b/examples/moderation/main.go index ab107ae..72b59ea 100644 --- a/examples/moderation/main.go +++ b/examples/moderation/main.go @@ -70,7 +70,7 @@ func resolveTarget(m *api.Message) int64 { func reply(c *dispatch.Context, chatID int64, text string) { _, _ = api.SendMessage(c.Ctx, c.Bot, &api.SendMessageParams{ - ChatID: api.ChatIDFromInt(chatID), + ChatID: api.Ptr(api.ChatIDFromInt(chatID)), Text: text, }) } diff --git a/examples/pagination/main.go b/examples/pagination/main.go index 8830665..eb6234c 100644 --- a/examples/pagination/main.go +++ b/examples/pagination/main.go @@ -102,7 +102,7 @@ func main() { router.OnCommand("/list", func(c *dispatch.Context, m *api.Message) error { text, markup := renderPage(sampleItems, 0) _, err := api.SendMessage(c.Ctx, c.Bot, &api.SendMessageParams{ - ChatID: api.ChatIDFromInt(m.Chat.ID), + ChatID: api.Ptr(api.ChatIDFromInt(m.Chat.ID)), Text: text, ReplyMarkup: markup, }) diff --git a/examples/payments/main.go b/examples/payments/main.go index 991a6e4..e494da8 100644 --- a/examples/payments/main.go +++ b/examples/payments/main.go @@ -87,7 +87,7 @@ func main() { log.Printf("payment success: charge_id=%s payload=%q amount=%d %s", sp.TelegramPaymentChargeID, sp.InvoicePayload, sp.TotalAmount, sp.Currency) _, err := api.SendMessage(c.Ctx, c.Bot, &api.SendMessageParams{ - ChatID: api.ChatIDFromInt(m.Chat.ID), + ChatID: api.Ptr(api.ChatIDFromInt(m.Chat.ID)), Text: "Payment received! Your widget is on its way.", }) return err diff --git a/examples/polls/main.go b/examples/polls/main.go index baf7d99..b411f54 100644 --- a/examples/polls/main.go +++ b/examples/polls/main.go @@ -89,7 +89,7 @@ func main() { } if question == "" { _, _ = api.SendMessage(c.Ctx, c.Bot, &api.SendMessageParams{ - ChatID: api.ChatIDFromInt(m.Chat.ID), + ChatID: api.Ptr(api.ChatIDFromInt(m.Chat.ID)), Text: "Usage: /poll ", }) return nil @@ -116,13 +116,13 @@ func main() { } if pollID == "" { _, _ = api.SendMessage(c.Ctx, c.Bot, &api.SendMessageParams{ - ChatID: api.ChatIDFromInt(m.Chat.ID), + ChatID: api.Ptr(api.ChatIDFromInt(m.Chat.ID)), Text: "Usage: /tally ", }) return nil } _, _ = api.SendMessage(c.Ctx, c.Bot, &api.SendMessageParams{ - ChatID: api.ChatIDFromInt(m.Chat.ID), + ChatID: api.Ptr(api.ChatIDFromInt(m.Chat.ID)), Text: tally.summary(pollID), }) return nil diff --git a/examples/stateful/main.go b/examples/stateful/main.go index c2ded20..6ad0a99 100644 --- a/examples/stateful/main.go +++ b/examples/stateful/main.go @@ -52,7 +52,7 @@ func main() { } n := store.inc(m.From.ID) _, err := api.SendMessage(c.Ctx, c.Bot, &api.SendMessageParams{ - ChatID: api.ChatIDFromInt(m.Chat.ID), + ChatID: api.Ptr(api.ChatIDFromInt(m.Chat.ID)), Text: fmt.Sprintf("Your count: %d", n), }) return err diff --git a/examples/webhook/handlers.go b/examples/webhook/handlers.go index 40cde34..36ce332 100644 --- a/examples/webhook/handlers.go +++ b/examples/webhook/handlers.go @@ -12,7 +12,7 @@ func register(r *dispatch.Router) { func handlePing(c *dispatch.Context, m *api.Message) error { _, err := api.SendMessage(c.Ctx, c.Bot, &api.SendMessageParams{ - ChatID: api.ChatIDFromInt(m.Chat.ID), + ChatID: api.Ptr(api.ChatIDFromInt(m.Chat.ID)), Text: "pong", }) return err diff --git a/examples/welcome/main.go b/examples/welcome/main.go index fc44f0f..66e54ed 100644 --- a/examples/welcome/main.go +++ b/examples/welcome/main.go @@ -45,7 +45,7 @@ func main() { name += " " + u.LastName } _, err := api.SendMessage(c.Ctx, c.Bot, &api.SendMessageParams{ - ChatID: api.ChatIDFromInt(m.Chat.ID), + ChatID: api.Ptr(api.ChatIDFromInt(m.Chat.ID)), Text: fmt.Sprintf("Welcome, %s! Please read the pinned rules before posting.", name), }) if err != nil { diff --git a/internal/spec/api.json b/internal/spec/api.json index b0a40e2..d4aa486 100644 --- a/internal/spec/api.json +++ b/internal/spec/api.json @@ -1,5 +1,5 @@ { - "version": "10.3", + "version": "10.5", "types": [ { "name": "Update", @@ -13,7 +13,7 @@ "name": "int64" }, "required": true, - "doc": "The update's unique identifier. Update identifiers start from a certain positive number and increase sequentially. This identifier becomes especially handy if you're using webhooks, since it allows you to ignore repeated updates or to restore the correct update sequence, should they get out of order. If there are no new updates for at least a week, then identifier of the next update will be chosen randomly instead of sequentially." + "doc": "The update's unique identifier. Update identifiers start from a certain positive number and increase sequentially. This identifier becomes especially handy if you're using webhooks, since it allows you to ignore repeated updates or to restore the correct update sequence, should they get out of order. If there are no new updates for at least a week, then the identifier of the next update will be chosen randomly instead of sequentially." }, { "name": "Message", @@ -112,7 +112,7 @@ "kind": "named", "name": "MessageReactionCountUpdated" }, - "doc": "Optional. Reactions to a message with anonymous reactions were changed. The bot must be an administrator in the chat and must explicitly specify \"message_reaction_count\" in the list of allowed_updates to receive these updates. The updates are grouped and can be sent with delay up to a few minutes." + "doc": "Optional. Reactions to a message with anonymous reactions were changed. The bot must be an administrator in the chat and must explicitly specify \"message_reaction_count\" in the list of allowed_updates to receive these updates. The updates are grouped and can be sent with a delay of up to a few minutes." }, { "name": "InlineQuery", @@ -130,7 +130,7 @@ "kind": "named", "name": "ChosenInlineResult" }, - "doc": "Optional. The result of an inline query that was chosen by a user and sent to their chat partner. Please see our documentation on the feedback collecting for details on how to enable these updates for your bot." + "doc": "Optional. The result of an inline query that was chosen by a user and sent to their chat partner. Please see our documentation on the feedback collecting for details on how to enable these updates for your bot. The updates can also be enabled using the parameter inline_feedback_share_denominator of the method setMySettings." }, { "name": "CallbackQuery", @@ -141,6 +141,24 @@ }, "doc": "Optional. New incoming callback query" }, + { + "name": "WidgetQuery", + "json_name": "widget_query", + "type": { + "kind": "named", + "name": "WidgetQuery" + }, + "doc": "Optional. New incoming query from a widget in a message sent by the bot or via the bot" + }, + { + "name": "SharedWidgetQuery", + "json_name": "shared_widget_query", + "type": { + "kind": "named", + "name": "SharedWidgetQuery" + }, + "doc": "Optional. New incoming query from a forwarded message with a shared widget" + }, { "name": "ShippingQuery", "json_name": "shipping_query", @@ -175,7 +193,7 @@ "kind": "named", "name": "Poll" }, - "doc": "Optional. New poll state. Bots receive only updates about manually stopped polls and polls, which are sent by the bot." + "doc": "Optional. New poll state. Bots receive only updates about manually stopped polls and polls which are sent by the bot." }, { "name": "PollAnswer", @@ -238,7 +256,7 @@ "kind": "named", "name": "ManagedBotUpdated" }, - "doc": "Optional. A new bot was created to be managed by the bot, or token or owner of a managed bot was changed" + "doc": "Optional. A new bot was created to be managed by the bot, or the token or owner of a managed bot was changed" }, { "name": "Subscription", @@ -353,6 +371,192 @@ } ] }, + { + "name": "BotFullInfo", + "doc": "This object contains full information about the bot itself.", + "fields": [ + { + "name": "ID", + "json_name": "id", + "type": { + "kind": "primitive", + "name": "int64" + }, + "required": true, + "doc": "Unique identifier for this bot. This number may have more than 32 significant bits and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a 64-bit integer or double-precision float type is safe for storing this identifier." + }, + { + "name": "IsBot", + "json_name": "is_bot", + "type": { + "kind": "primitive", + "name": "bool" + }, + "required": true, + "doc": "Always True" + }, + { + "name": "FirstName", + "json_name": "first_name", + "type": { + "kind": "primitive", + "name": "string" + }, + "required": true, + "doc": "Bot's first name" + }, + { + "name": "Username", + "json_name": "username", + "type": { + "kind": "primitive", + "name": "string" + }, + "doc": "Optional. Bot's username" + }, + { + "name": "ActiveUsernames", + "json_name": "active_usernames", + "type": { + "kind": "array", + "elem_type": { + "kind": "primitive", + "name": "string" + } + }, + "doc": "Optional. If non-empty, the list of all active usernames of the bot" + }, + { + "name": "CanJoinGroups", + "json_name": "can_join_groups", + "type": { + "kind": "primitive", + "name": "bool" + }, + "required": true, + "doc": "True, if the bot can be added to groups" + }, + { + "name": "CanReadAllGroupMessages", + "json_name": "can_read_all_group_messages", + "type": { + "kind": "primitive", + "name": "bool" + }, + "required": true, + "doc": "True, if privacy mode is disabled for the bot" + }, + { + "name": "SupportsGuestQueries", + "json_name": "supports_guest_queries", + "type": { + "kind": "primitive", + "name": "bool" + }, + "required": true, + "doc": "True, if the bot supports guest queries from chats it is not a member of" + }, + { + "name": "SupportsInlineQueries", + "json_name": "supports_inline_queries", + "type": { + "kind": "primitive", + "name": "bool" + }, + "required": true, + "doc": "True, if the bot supports inline queries" + }, + { + "name": "InlineQueryPlaceholder", + "json_name": "inline_query_placeholder", + "type": { + "kind": "primitive", + "name": "string" + }, + "doc": "Optional. Placeholder for inline queries, which is shown in the input field after the bot's username; omitted if the default placeholder is used" + }, + { + "name": "NeedsInlineQueryLocation", + "json_name": "needs_inline_query_location", + "type": { + "kind": "primitive", + "name": "bool" + }, + "required": true, + "doc": "True, if the bot requests the location of the user with every inline query" + }, + { + "name": "CanConnectToBusiness", + "json_name": "can_connect_to_business", + "type": { + "kind": "primitive", + "name": "bool" + }, + "required": true, + "doc": "True, if the bot can be connected to a user account to manage it" + }, + { + "name": "HasMainWebApp", + "json_name": "has_main_web_app", + "type": { + "kind": "primitive", + "name": "bool" + }, + "required": true, + "doc": "True, if the bot has a main Web App" + }, + { + "name": "HasTopicsEnabled", + "json_name": "has_topics_enabled", + "type": { + "kind": "primitive", + "name": "bool" + }, + "required": true, + "doc": "True, if the bot has forum topic mode enabled in private chats" + }, + { + "name": "AllowsUsersToCreateTopics", + "json_name": "allows_users_to_create_topics", + "type": { + "kind": "primitive", + "name": "bool" + }, + "required": true, + "doc": "True, if the bot allows users to create and delete topics in private chats" + }, + { + "name": "HasTopicSidebar", + "json_name": "has_topic_sidebar", + "type": { + "kind": "primitive", + "name": "bool" + }, + "required": true, + "doc": "True, if topics in private chats with the bot are shown in a sidebar" + }, + { + "name": "CanManageBots", + "json_name": "can_manage_bots", + "type": { + "kind": "primitive", + "name": "bool" + }, + "required": true, + "doc": "True, if other bots can be created to be controlled by the bot" + }, + { + "name": "SupportsJoinRequestQueries", + "json_name": "supports_join_request_queries", + "type": { + "kind": "primitive", + "name": "bool" + }, + "required": true, + "doc": "True, if the bot supports join request queries and can be assigned to process them" + } + ] + }, { "name": "User", "doc": "This object represents a Telegram user or bot.", @@ -365,7 +569,7 @@ "name": "int64" }, "required": true, - "doc": "Unique identifier for this user or bot. This number may have more than 32 significant bits and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a 64-bit integer or double-precision float type are safe for storing this identifier." + "doc": "Unique identifier for this user or bot. This number may have more than 32 significant bits and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a 64-bit integer or double-precision float type is safe for storing this identifier." }, { "name": "IsBot", @@ -431,96 +635,6 @@ "name": "bool" }, "doc": "Optional. True, if this user added the bot to the attachment menu" - }, - { - "name": "CanJoinGroups", - "json_name": "can_join_groups", - "type": { - "kind": "primitive", - "name": "bool" - }, - "doc": "Optional. True, if the bot can be invited to groups. Returned only in getMe." - }, - { - "name": "CanReadAllGroupMessages", - "json_name": "can_read_all_group_messages", - "type": { - "kind": "primitive", - "name": "bool" - }, - "doc": "Optional. True, if privacy mode is disabled for the bot. Returned only in getMe." - }, - { - "name": "SupportsGuestQueries", - "json_name": "supports_guest_queries", - "type": { - "kind": "primitive", - "name": "bool" - }, - "doc": "Optional. True, if the bot supports guest queries from chats it is not a member of. Returned only in getMe." - }, - { - "name": "SupportsInlineQueries", - "json_name": "supports_inline_queries", - "type": { - "kind": "primitive", - "name": "bool" - }, - "doc": "Optional. True, if the bot supports inline queries. Returned only in getMe." - }, - { - "name": "CanConnectToBusiness", - "json_name": "can_connect_to_business", - "type": { - "kind": "primitive", - "name": "bool" - }, - "doc": "Optional. True, if the bot can be connected to a user account to manage it. Returned only in getMe." - }, - { - "name": "HasMainWebApp", - "json_name": "has_main_web_app", - "type": { - "kind": "primitive", - "name": "bool" - }, - "doc": "Optional. True, if the bot has a main Web App. Returned only in getMe." - }, - { - "name": "HasTopicsEnabled", - "json_name": "has_topics_enabled", - "type": { - "kind": "primitive", - "name": "bool" - }, - "doc": "Optional. True, if the bot has forum topic mode enabled in private chats. Returned only in getMe." - }, - { - "name": "AllowsUsersToCreateTopics", - "json_name": "allows_users_to_create_topics", - "type": { - "kind": "primitive", - "name": "bool" - }, - "doc": "Optional. True, if the bot allows users to create and delete topics in private chats. Returned only in getMe." - }, - { - "name": "CanManageBots", - "json_name": "can_manage_bots", - "type": { - "kind": "primitive", - "name": "bool" - }, - "doc": "Optional. True, if other bots can be created to be controlled by the bot. Returned only in getMe." - }, - { - "name": "SupportsJoinRequestQueries", - "json_name": "supports_join_request_queries", - "type": { - "kind": "primitive", - "name": "bool" - }, - "doc": "Optional. True, if the bot supports join request queries and can be assigned to process them. Returned only in getMe." } ] }, @@ -536,7 +650,7 @@ "name": "int64" }, "required": true, - "doc": "Unique identifier for this chat. This number may have more than 32 significant bits and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a signed 64-bit integer or double-precision float type are safe for storing this identifier." + "doc": "Unique identifier for this chat. This number may have more than 32 significant bits and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a signed 64-bit integer or double-precision float type is safe for storing this identifier." }, { "name": "Type", @@ -622,7 +736,7 @@ "name": "int64" }, "required": true, - "doc": "Unique identifier for this chat. This number may have more than 32 significant bits and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a signed 64-bit integer or double-precision float type are safe for storing this identifier." + "doc": "Unique identifier for this chat. This number may have more than 32 significant bits and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a signed 64-bit integer or double-precision float type is safe for storing this identifier." }, { "name": "Type", @@ -862,7 +976,7 @@ "kind": "primitive", "name": "bool" }, - "doc": "Optional. True, if privacy settings of the other party in the private chat allows to use tg://user?id= links only in chats with the user" + "doc": "Optional. True, if the privacy settings of the other party in the private chat allow using tg://user?id= links only in chats with the user" }, { "name": "HasRestrictedVoiceAndVideoMessages", @@ -1043,7 +1157,7 @@ "kind": "primitive", "name": "int64" }, - "doc": "Optional. Unique identifier for the linked chat, i.e. the discussion group identifier for a channel and vice versa; for supergroups and channel chats. This identifier may be greater than 32 bits and some programming languages may have difficulty/silent defects in interpreting it. But it is smaller than 52 bits, so a signed 64 bit integer or double-precision float type are safe for storing this identifier." + "doc": "Optional. Unique identifier for the linked chat, i.e. the discussion group identifier for a channel and vice versa; for supergroups and channel chats. This identifier may be greater than 32 bits and some programming languages may have difficulty/silent defects in interpreting it. But it is smaller than 52 bits, so a signed 64-bit integer or double-precision float type is safe for storing this identifier." }, { "name": "Location", @@ -1107,6 +1221,24 @@ "name": "Community" }, "doc": "Optional. The Community to which the chat belongs" + }, + { + "name": "TonWalletCard", + "json_name": "ton_wallet_card", + "type": { + "kind": "named", + "name": "TonWalletCard" + }, + "doc": "Optional. For private chats, the TON wallet card of the user, which is shown on their profile page" + }, + { + "name": "ShareTheme", + "json_name": "share_theme", + "type": { + "kind": "named", + "name": "ChatShareTheme" + }, + "doc": "Optional. For private chats, supergroups and channels, the theme of the screen for sharing a link to the user or the chat; omitted if the default theme is used" } ] }, @@ -1573,6 +1705,15 @@ }, "doc": "Optional. Message is a voice message, information about the file" }, + { + "name": "Widget", + "json_name": "widget", + "type": { + "kind": "named", + "name": "Widget" + }, + "doc": "Optional. Message is an HTML widget, information about the widget" + }, { "name": "Caption", "json_name": "caption", @@ -1580,7 +1721,7 @@ "kind": "primitive", "name": "string" }, - "doc": "Optional. Caption for the animation, audio, document, paid media, photo, video or voice" + "doc": "Optional. Caption for the animation, audio, document, live photo, paid media, photo, video, voice, or widget" }, { "name": "CaptionEntities", @@ -1601,7 +1742,7 @@ "kind": "primitive", "name": "bool" }, - "doc": "Optional. True, if the caption must be shown above the message media" + "doc": "Optional. True, if the caption must be shown above the message media or the widget" }, { "name": "HasMediaSpoiler", @@ -1733,7 +1874,7 @@ "name": "PhotoSize" } }, - "doc": "Optional. A chat photo was change to this value" + "doc": "Optional. A chat photo was changed to this value" }, { "name": "DeleteChatPhoto", @@ -1760,7 +1901,7 @@ "kind": "primitive", "name": "bool" }, - "doc": "Optional. Service message: the supergroup has been created. This field can't be received in a message coming through updates, because bot can't be a member of a supergroup when it is created. It can only be found in reply_to_message if someone replies to a very first message in a directly created supergroup." + "doc": "Optional. Service message: the supergroup has been created. This field can't be received in a message coming through updates, because a bot can't be a member of a supergroup when it is created. It can only be found in reply_to_message if someone replies to the very first message in a directly created supergroup." }, { "name": "ChannelChatCreated", @@ -1769,7 +1910,7 @@ "kind": "primitive", "name": "bool" }, - "doc": "Optional. Service message: the channel has been created. This field can't be received in a message coming through updates, because bot can't be a member of a channel when it is created. It can only be found in reply_to_message if someone replies to a very first message in a channel." + "doc": "Optional. Service message: the channel has been created. This field can't be received in a message coming through updates, because a bot can't be a member of a channel when it is created. It can only be found in reply_to_message if someone replies to the very first message in a channel." }, { "name": "MessageAutoDeleteTimerChanged", @@ -1787,7 +1928,7 @@ "kind": "primitive", "name": "int64" }, - "doc": "Optional. The group has been migrated to a supergroup with the specified identifier. This number may have more than 32 significant bits and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a signed 64-bit integer or double-precision float type are safe for storing this identifier." + "doc": "Optional. The group has been migrated to a supergroup with the specified identifier. This number may have more than 32 significant bits and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a signed 64-bit integer or double-precision float type is safe for storing this identifier." }, { "name": "MigrateFromChatID", @@ -1796,7 +1937,7 @@ "kind": "primitive", "name": "int64" }, - "doc": "Optional. The supergroup has been migrated from a group with the specified identifier. This number may have more than 32 significant bits and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a signed 64-bit integer or double-precision float type are safe for storing this identifier." + "doc": "Optional. The supergroup has been migrated from a group with the specified identifier. This number may have more than 32 significant bits and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a signed 64-bit integer or double-precision float type is safe for storing this identifier." }, { "name": "PinnedMessage", @@ -1895,7 +2036,7 @@ "kind": "named", "name": "WriteAccessAllowed" }, - "doc": "Optional. Service message: the user allowed the bot to write messages after adding it to the attachment or side menu, launching a Web App from a link, or accepting an explicit request from a Web App sent by the method requestWriteAccess" + "doc": "Optional. Service message: the user allowed the bot to write messages after adding it to the attachment or side menu, launching a Web App from a link, or accepting an explicit request from a Web App sent by the method requestWriteAccess, or the user was invited to the private chat with the bot by the owner of the bot" }, { "name": "PassportData", @@ -2095,6 +2236,15 @@ }, "doc": "Optional. Service message: the price for paid messages has changed in the chat" }, + { + "name": "PaidMessagesWaived", + "json_name": "paid_messages_waived", + "type": { + "kind": "named", + "name": "PaidMessagesWaived" + }, + "doc": "Optional. Service message: the sender of the message used a link of the other user, which allows sending messages to the user without paying Telegram Stars" + }, { "name": "PollOptionAdded", "json_name": "poll_option_added", @@ -2158,6 +2308,15 @@ }, "doc": "Optional. Service message: payment for a suggested post was refunded" }, + { + "name": "TonWalletTransfer", + "json_name": "ton_wallet_transfer", + "type": { + "kind": "named", + "name": "TonWalletTransfer" + }, + "doc": "Optional. Service message: a transfer with a TON wallet" + }, { "name": "VideoChatScheduled", "json_name": "video_chat_scheduled", @@ -2226,7 +2385,7 @@ "name": "int64" }, "required": true, - "doc": "Unique message identifier. In specific instances (e.g., message containing a video sent to a big chat), the server might automatically schedule a message instead of sending it immediately. In such cases, this field will be 0 and the relevant message will be unusable until it is actually sent." + "doc": "Unique message identifier. In specific instances (e.g., a message containing a video sent to a big chat), the server might automatically schedule a message instead of sending it immediately. In such cases, this field will be 0 and the relevant message will be unusable until it is actually sent." } ] }, @@ -2286,7 +2445,7 @@ "name": "string" }, "required": true, - "doc": "Type of the entity. Currently, can be “mention” (@username), “hashtag” (#hashtag or #hashtag@chatusername), “cashtag” ($USD or $USD@chatusername), “bot_command” (/start@jobs_bot), “url” (https://telegram.org), “email” (do-not-reply@telegram.org), “phone_number” (+1-212-555-0123), “bold” (bold text), “italic” (italic text), “underline” (underlined text), “strikethrough” (strikethrough text), “spoiler” (spoiler message), “blockquote” (block quotation), “expandable_blockquote” (collapsed-by-default block quotation), “code” (monowidth string), “pre” (monowidth block), “text_link” (for clickable text URLs), “text_mention” (for users without usernames), “custom_emoji” (for inline custom emoji stickers), or “date_time” (for formatted date and time).", + "doc": "Type of the entity. Currently, can be “mention” (@username), “hashtag” (#hashtag or #hashtag@chatusername), “cashtag” ($USD or $USD@chatusername), “bot_command” (/start@jobs_bot), “url” (https://telegram.org), “email” (do-not-reply@telegram.org), “phone_number” (+1-212-555-0123), “bank_card_number” (bank card number), “ton_address” (address in the TON blockchain), “bold” (bold text), “italic” (italic text), “underline” (underlined text), “strikethrough” (strikethrough text), “spoiler” (spoiler message), “blockquote” (block quotation), “expandable_blockquote” (collapsed-by-default block quotation), “code” (monowidth string), “pre” (monowidth block), “text_link” (for clickable text URLs), “text_mention” (for users without usernames), “custom_emoji” (for inline custom emoji stickers), or “date_time” (for formatted date and time).", "enum_values": [ "mention", "hashtag", @@ -2295,6 +2454,8 @@ "url", "email", "phone_number", + "bank_card_number", + "ton_address", "bold", "italic", "underline", @@ -2337,7 +2498,7 @@ "kind": "primitive", "name": "string" }, - "doc": "Optional. For “text_link” only, URL that will be opened after user taps on the text" + "doc": "Optional. For “text_link” only, URL that will be opened after the user taps on the text" }, { "name": "User", @@ -2398,7 +2559,7 @@ "name": "string" }, "required": true, - "doc": "Text of the quoted part of a message that is replied to by the given message" + "doc": "Text of the quoted part of a message that is replied to by the given message; may be empty if the quote was chosen from a rich message" }, { "name": "Entities", @@ -2412,6 +2573,18 @@ }, "doc": "Optional. Special entities that appear in the quote. Currently, only bold, italic, underline, strikethrough, spoiler, custom_emoji, and date_time entities are kept in quotes." }, + { + "name": "RichTexts", + "json_name": "rich_texts", + "type": { + "kind": "array", + "elem_type": { + "kind": "named", + "name": "RichText" + } + }, + "doc": "Optional. Rich text of the quote if it was chosen from a rich message. May contain only plain text, RichTextBold, RichTextItalic, RichTextUnderline, RichTextStrikethrough, RichTextSpoiler, RichTextSubscript, RichTextSuperscript, RichTextDateTime, RichTextCustomEmoji, RichTextMathematicalExpression, and arrays of them." + }, { "name": "Position", "json_name": "position", @@ -2420,7 +2593,7 @@ "name": "int64" }, "required": true, - "doc": "Approximate quote position in the original message in UTF-16 code units as specified by the sender" + "doc": "Approximate quote position in the original message in UTF-16 code units as specified by the sender. For quotes from rich messages, it is the position in the text formed by joining plain texts of all quotable texts of the message, separated by line feeds." }, { "name": "IsManual", @@ -2576,6 +2749,15 @@ }, "doc": "Optional. Message is a voice message, information about the file" }, + { + "name": "Widget", + "json_name": "widget", + "type": { + "kind": "named", + "name": "Widget" + }, + "doc": "Optional. Message is an HTML widget, information about the widget" + }, { "name": "HasMediaSpoiler", "json_name": "has_media_spoiler", @@ -2700,7 +2882,7 @@ "string" ] }, - "doc": "Optional. If the message to be replied to is from a different chat, unique identifier for the chat or username of the bot, supergroup or channel in the format @username. Not supported for messages sent on behalf of a business account, messages from channel direct messages chats and ephemeral messages." + "doc": "Optional. If the message to be replied to is from a different chat, unique identifier for the chat or username of the bot, supergroup, or channel in the format @username. Not supported for messages sent on behalf of a business account, messages from channel direct messages chats and ephemeral messages." }, { "name": "EphemeralMessageID", @@ -2755,6 +2937,18 @@ }, "doc": "Optional. A JSON-serialized list of special entities that appear in the quote. It can be specified instead of quote_parse_mode." }, + { + "name": "QuoteRichTexts", + "json_name": "quote_rich_texts", + "type": { + "kind": "array", + "elem_type": { + "kind": "named", + "name": "RichText" + } + }, + "doc": "Optional. A JSON-serialized list of quoted parts of the rich message to be replied to. Must contain one element for each quoted text of the message in the order of their appearance. Each of the following is a separate quoted text: the text of a paragraph, a heading, a preformatted block, a footer, or a mathematical expression; the text and the credit of a block quotation or a pull quotation; the summary of a details block; the caption and each cell of a table; the text and the credit of a caption of a media block, a collage, a slideshow, or a map. Texts of blocks nested in lists, block quotations, details, collages, and slideshows are separate quoted texts too. The first and the last elements can contain only a part of the corresponding text; all other elements must contain the whole text. Formatting of the quoted parts must be kept, and rich texts must be nested in the same way as in the message received from the server. Mathematical expressions must be quoted entirely. Buttons in RichBlockButtons, anchors and dividers can't be quoted. Up to 32 quoted texts with a total length of up to 1024 characters can be specified. Only plain text, RichTextBold, RichTextItalic, RichTextUnderline, RichTextStrikethrough, RichTextSpoiler, RichTextSubscript, RichTextSuperscript, RichTextDateTime, RichTextCustomEmoji, RichTextMathematicalExpression, and arrays of them are kept in the quote; other rich text types are replaced with their text. If non-empty, then quote, quote_parse_mode and quote_entities are ignored." + }, { "name": "QuotePosition", "json_name": "quote_position", @@ -2762,7 +2956,7 @@ "kind": "primitive", "name": "int64" }, - "doc": "Optional. Position of the quote in the original message in UTF-16 code units" + "doc": "Optional. Position of the quote in the original message in UTF-16 code units. For quotes from rich messages, it is the position in the text formed by joining plain texts of all quotable texts of the message, separated by line feeds." }, { "name": "ChecklistTaskID", @@ -2786,6 +2980,7 @@ }, { "name": "EphemeralMessageParameters", + "doc": "Describes the parameters of an ephemeral message to be sent.", "fields": [ { "name": "ReceiverUserID", @@ -2794,8 +2989,7 @@ "kind": "primitive", "name": "int64" }, - "required": true, - "doc": "Identifier of the user who will receive the message. It is not guaranteed that the user will receive the message, especially if they are offline. See here for more details." + "doc": "Optional. Identifier of the user who will receive the message; required unless the message is sent as an ephemeral reply to a callback query. If omitted, then the parameter chat_id of the method is ignored. If specified together with callback_query_id, then it must be the identifier of the user who pressed the button. Must be omitted for messages sent in chats where the bot isn't a member, unless the message is a reply to an ephemeral message. It is not guaranteed that the user will receive the message, especially if they are offline. See here for more details." }, { "name": "CallbackQueryID", @@ -2804,7 +2998,7 @@ "kind": "primitive", "name": "string" }, - "doc": "Optional. Identifier of the callback query which triggered the message, if any" + "doc": "Optional. Identifier of the callback query which triggered the message, if any. If specified and receiver_user_id is omitted, then the message is sent as an ephemeral reply to the callback query and will be shown only to the user who pressed the button. Ephemeral replies can't be sent to callback queries from messages in channel direct messages chats. The bot must still answer the callback query using answerCallbackQuery." }, { "name": "ReplaceCallbackQueryMessage", @@ -3154,7 +3348,7 @@ "kind": "primitive", "name": "int64" }, - "doc": "Optional. File size in bytes. It can be bigger than 2^31 and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a signed 64-bit integer or double-precision float type are safe for storing this value." + "doc": "Optional. File size in bytes. It can be bigger than 2^31 and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a signed 64-bit integer or double-precision float type is safe for storing this value." } ] }, @@ -3235,7 +3429,7 @@ "kind": "primitive", "name": "int64" }, - "doc": "Optional. File size in bytes. It can be bigger than 2^31 and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a signed 64-bit integer or double-precision float type are safe for storing this value." + "doc": "Optional. File size in bytes. It can be bigger than 2^31 and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a signed 64-bit integer or double-precision float type is safe for storing this value." }, { "name": "Thumbnail", @@ -3306,7 +3500,7 @@ "kind": "primitive", "name": "int64" }, - "doc": "Optional. File size in bytes. It can be bigger than 2^31 and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a signed 64-bit integer or double-precision float type are safe for storing this value." + "doc": "Optional. File size in bytes. It can be bigger than 2^31 and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a signed 64-bit integer or double-precision float type is safe for storing this value." } ] }, @@ -3334,7 +3528,7 @@ "name": "string" }, "required": true, - "doc": "Identifier for the video file which can be used to download or reuse the file" + "doc": "Identifier for the video file, which can be used to download or reuse the file" }, { "name": "FileUniqueID", @@ -3344,7 +3538,7 @@ "name": "string" }, "required": true, - "doc": "Unique identifier for the video file which is supposed to be the same over time and for different bots. Can't be used to download or reuse the file." + "doc": "Unique identifier for the video file, which is supposed to be the same over time and for different bots. Can't be used to download or reuse the file." }, { "name": "Width", @@ -3392,7 +3586,7 @@ "kind": "primitive", "name": "int64" }, - "doc": "Optional. File size in bytes. It can be bigger than 2^31 and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a signed 64-bit integer or double-precision float type are safe for storing this value." + "doc": "Optional. File size in bytes. It can be bigger than 2^31 and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a signed 64-bit integer or double-precision float type is safe for storing this value." } ] }, @@ -3483,7 +3677,7 @@ "kind": "primitive", "name": "int64" }, - "doc": "Optional. File size in bytes. It can be bigger than 2^31 and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a signed 64-bit integer or double-precision float type are safe for storing this value." + "doc": "Optional. File size in bytes. It can be bigger than 2^31 and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a signed 64-bit integer or double-precision float type is safe for storing this value." } ] }, @@ -3608,7 +3802,7 @@ "kind": "primitive", "name": "int64" }, - "doc": "Optional. File size in bytes. It can be bigger than 2^31 and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a signed 64-bit integer or double-precision float type are safe for storing this value." + "doc": "Optional. File size in bytes. It can be bigger than 2^31 and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a signed 64-bit integer or double-precision float type is safe for storing this value." } ] }, @@ -3726,7 +3920,68 @@ "kind": "primitive", "name": "int64" }, - "doc": "Optional. File size in bytes. It can be bigger than 2^31 and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a signed 64-bit integer or double-precision float type are safe for storing this value." + "doc": "Optional. File size in bytes. It can be bigger than 2^31 and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a signed 64-bit integer or double-precision float type is safe for storing this value." + } + ] + }, + { + "name": "Widget", + "doc": "This object describes an HTML widget.", + "fields": [ + { + "name": "ID", + "json_name": "id", + "type": { + "kind": "primitive", + "name": "string" + }, + "doc": "Optional. Unique identifier of the shared widget, which can be used to send the widget again using the method sendSharedWidget; omitted if the widget isn't shared" + }, + { + "name": "Width", + "json_name": "width", + "type": { + "kind": "primitive", + "name": "int64" + }, + "doc": "Optional. Width of the widget in logical pixels; omitted if the widget must occupy the whole width of the message bubble" + }, + { + "name": "Height", + "json_name": "height", + "type": { + "kind": "primitive", + "name": "int64" + }, + "doc": "Optional. Height of the widget in logical pixels; omitted if the height of the widget isn't fixed" + }, + { + "name": "HTML", + "json_name": "html", + "type": { + "kind": "primitive", + "name": "string" + }, + "required": true, + "doc": "HTML code of the widget" + }, + { + "name": "PublicData", + "json_name": "public_data", + "type": { + "kind": "primitive", + "name": "string" + }, + "doc": "Optional. Public data of the widget, which is available wherever the widget is shown. All messages with a shared widget have the same public data." + }, + { + "name": "ChatData", + "json_name": "chat_data", + "type": { + "kind": "primitive", + "name": "string" + }, + "doc": "Optional. Data of the widget, which is specific to the message" } ] }, @@ -3945,7 +4200,7 @@ "kind": "primitive", "name": "int64" }, - "doc": "Optional. Contact's user identifier in Telegram. This number may have more than 32 significant bits and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a 64-bit integer or double-precision float type are safe for storing this identifier." + "doc": "Optional. Contact's user identifier in Telegram. This number may have more than 32 significant bits and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a 64-bit integer or double-precision float type is safe for storing this identifier." }, { "name": "Vcard", @@ -4433,7 +4688,7 @@ "name": "bool" }, "required": true, - "doc": "True, if the poll allows to change the chosen answer options" + "doc": "True, if the poll allows changing the chosen answer options" }, { "name": "MembersOnly", @@ -4443,7 +4698,7 @@ "name": "bool" }, "required": true, - "doc": "True if voting is limited to users who have been members of the chat where the poll was originally sent for more than 24 hours" + "doc": "True, if voting is limited to users who have been members of the chat where the poll was originally sent for more than 24 hours" }, { "name": "CountryCodes", @@ -4847,7 +5102,7 @@ "kind": "primitive", "name": "int64" }, - "doc": "Optional. The direction in which user is moving, in degrees; 1-360. For active live locations only." + "doc": "Optional. The direction in which the user is moving, in degrees; 1-360. For active live locations only." }, { "name": "ProximityAlertRadius", @@ -5048,7 +5303,7 @@ "name": "User" }, "required": true, - "doc": "Information about the bot. Token of the bot can be fetched using the method getManagedBotToken." + "doc": "Information about the bot. The token of the bot can be fetched using the method getManagedBotToken." } ] }, @@ -5756,11 +6011,11 @@ }, { "name": "GeneralForumTopicHidden", - "doc": "This object represents a service message about General forum topic hidden in the chat. Currently holds no information." + "doc": "This object represents a service message about the General forum topic hidden in the chat. Currently holds no information." }, { "name": "GeneralForumTopicUnhidden", - "doc": "This object represents a service message about General forum topic unhidden in the chat. Currently holds no information." + "doc": "This object represents a service message about the General forum topic unhidden in the chat. Currently holds no information." }, { "name": "SharedUser", @@ -5868,7 +6123,7 @@ "name": "int64" }, "required": true, - "doc": "Identifier of the shared chat. This number may have more than 32 significant bits and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a 64-bit integer or double-precision float type are safe for storing this identifier. The bot may not have access to the chat and could be unable to use this identifier, unless the chat is already known to the bot by some other means." + "doc": "Identifier of the shared chat. This number may have more than 32 significant bits and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a 64-bit integer or double-precision float type is safe for storing this identifier. The bot may not have access to the chat and could be unable to use this identifier, unless the chat is already known to the bot by some other means." }, { "name": "Title", @@ -5904,7 +6159,7 @@ }, { "name": "WriteAccessAllowed", - "doc": "This 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 method requestWriteAccess.", + "doc": "This 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 method requestWriteAccess, or about a user being invited to the private chat with the bot by the owner of the bot.", "fields": [ { "name": "FromRequest", @@ -5932,6 +6187,15 @@ "name": "bool" }, "doc": "Optional. True, if the access was granted when the bot was added to the attachment or side menu" + }, + { + "name": "Inviter", + "json_name": "inviter", + "type": { + "kind": "named", + "name": "User" + }, + "doc": "Optional. The owner of the bot, if the access was granted when the owner invited the user to the private chat with the bot. Bot owners can invite up to 10 users at once by pressing the link https://t.me/botinvite/." } ] }, @@ -6190,6 +6454,55 @@ } ] }, + { + "name": "PaidMessagesWaived", + "doc": "Describes 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." + }, + { + "name": "TonWalletTransfer", + "doc": "Describes a service message about a transfer with a TON wallet.", + "fields": [ + { + "name": "TransactionID", + "json_name": "transaction_id", + "type": { + "kind": "primitive", + "name": "string" + }, + "required": true, + "doc": "Unique identifier of the transaction; may be empty if the transfer hasn't been sent yet" + }, + { + "name": "PeerAddress", + "json_name": "peer_address", + "type": { + "kind": "primitive", + "name": "string" + }, + "required": true, + "doc": "Address of the transfer peer in the TON blockchain" + }, + { + "name": "Amount", + "json_name": "amount", + "type": { + "kind": "primitive", + "name": "string" + }, + "required": true, + "doc": "The amount of transferred cryptocurrency, in the smallest units of the cryptocurrency, as a decimal number; negative for outgoing transfers" + }, + { + "name": "Comment", + "json_name": "comment", + "type": { + "kind": "primitive", + "name": "string" + }, + "doc": "Optional. Comment added to the transfer; omitted if the comment is encrypted" + } + ] + }, { "name": "GiveawayCreated", "doc": "This object represents a service message about the creation of a scheduled giveaway.", @@ -6240,7 +6553,7 @@ "name": "int64" }, "required": true, - "doc": "The number of users which are supposed to be selected as winners of the giveaway" + "doc": "The number of users who are supposed to be selected as winners of the giveaway" }, { "name": "OnlyNewMembers", @@ -6267,7 +6580,7 @@ "kind": "primitive", "name": "string" }, - "doc": "Optional. Description of additional giveaway prize" + "doc": "Optional. Description of an additional giveaway prize" }, { "name": "CountryCodes", @@ -6419,7 +6732,7 @@ "kind": "primitive", "name": "string" }, - "doc": "Optional. Description of additional giveaway prize" + "doc": "Optional. Description of an additional giveaway prize" } ] }, @@ -6606,7 +6919,7 @@ "kind": "primitive", "name": "int64" }, - "doc": "Optional. Proposed send date of the post. If specified, then the date must be between 300 second and 2678400 seconds (30 days) in the future. If the field is omitted, then the post can be published at any time within 30 days at the sole discretion of the user who approves it." + "doc": "Optional. Proposed send date of the post. If specified, then the date must be between 300 seconds and 2678400 seconds (30 days) in the future. If the field is omitted, then the post can be published at any time within 30 days at the sole discretion of the user who approves it." } ] }, @@ -6622,7 +6935,7 @@ "name": "int64" }, "required": true, - "doc": "Unique identifier of the topic. This number may have more than 32 significant bits and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a 64-bit integer or double-precision float type are safe for storing this identifier." + "doc": "Unique identifier of the topic. This number may have more than 32 significant bits and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a 64-bit integer or double-precision float type is safe for storing this identifier." }, { "name": "User", @@ -6637,7 +6950,7 @@ }, { "name": "UserProfilePhotos", - "doc": "This object represent a user's profile pictures.", + "doc": "This object represents a user's profile pictures.", "fields": [ { "name": "TotalCount", @@ -6727,7 +7040,7 @@ "kind": "primitive", "name": "int64" }, - "doc": "Optional. File size in bytes. It can be bigger than 2^31 and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a signed 64-bit integer or double-precision float type are safe for storing this value." + "doc": "Optional. File size in bytes. It can be bigger than 2^31 and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a signed 64-bit integer or double-precision float type is safe for storing this value." }, { "name": "FilePath", @@ -6819,7 +7132,7 @@ "kind": "primitive", "name": "bool" }, - "doc": "Optional. Use this parameter if you want to show the keyboard to specific users only. Targets: 1) users that are @mentioned in the text of the Message object; 2) if the bot's message is a reply to a message in the same chat and forum topic, sender of the original message.Example: A user requests to change the bot's language, bot replies to the request with a keyboard to select the new language. Other users in the group don't see the keyboard." + "doc": "Optional. Use this parameter if you want to show the keyboard to specific users only. Targets: 1) users that are @mentioned in the text of the Message object; 2) if the bot's message is a reply to a message in the same chat and forum topic, sender of the original message.Example: A user requests to change the bot's language, and the bot replies to the request with a keyboard to select the new language. Other users in the group don't see the keyboard." }, { "name": "ForceReply", @@ -6894,7 +7207,7 @@ "kind": "named", "name": "KeyboardButtonRequestManagedBot" }, - "doc": "Optional. If specified, pressing the button will ask the user to create and share a bot that will be managed by the current bot. Available for bots that enabled management of other bots in the @BotFather Mini App. Available in private chats only." + "doc": "Optional. If specified, pressing the button will ask the user to create and share a bot that will be managed by the current bot. Available for bots that enabled management of other bots in the @BotFather Mini App or using the parameter can_manage_bots of the method setMySettings. Available in private chats only." }, { "name": "RequestContact", @@ -7006,7 +7319,7 @@ }, { "name": "KeyboardButtonRequestChat", - "doc": "This 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 chat if appropriate. More about requesting chats ».", + "doc": "This 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 the requested rights in the chat if appropriate. More about requesting chats ».", "fields": [ { "name": "RequestID", @@ -7141,13 +7454,13 @@ "kind": "primitive", "name": "string" }, - "doc": "Optional. Suggested username for the bot" + "doc": "Optional. Suggested username for the bot. The username must end with “bot”. If the user creating the bot has a Telegram Premium subscription, then the username can also end with “agent”, “ai”, “app”, “game”, or “gay”; in this case, the username will be assigned to the bot as a secondary username, and a regular username ending with “bot” will be assigned to the bot automatically." } ] }, { "name": "KeyboardButtonPollType", - "doc": "This object represents type of a poll, which is allowed to be created and sent when the corresponding button is pressed.", + "doc": "This object represents the type of a poll, which is allowed to be created and sent when the corresponding button is pressed.", "fields": [ { "name": "Type", @@ -7172,7 +7485,7 @@ "name": "bool" }, "required": true, - "doc": "Requests clients to remove the custom keyboard (user will not be able to summon this keyboard; if you want to hide the keyboard from sight but keep it accessible, use one_time_keyboard in ReplyKeyboardMarkup)" + "doc": "Requests clients to remove the custom keyboard (the user will not be able to summon this keyboard; if you want to hide the keyboard from sight but keep it accessible, use one_time_keyboard in ReplyKeyboardMarkup)" }, { "name": "Selective", @@ -7181,7 +7494,7 @@ "kind": "primitive", "name": "bool" }, - "doc": "Optional. Use this parameter if you want to remove the keyboard for specific users only. Targets: 1) users that are @mentioned in the text of the Message object; 2) if the bot's message is a reply to a message in the same chat and forum topic, sender of the original message.Example: A user votes in a poll, bot returns confirmation message in reply to the vote and removes the keyboard for that user, while still showing the keyboard with poll options to users who haven't voted yet." + "doc": "Optional. Use this parameter if you want to remove the keyboard for specific users only. Targets: 1) users that are @mentioned in the text of the Message object; 2) if the bot's message is a reply to a message in the same chat and forum topic, sender of the original message.Example: A user votes in a poll, and the bot returns a confirmation message in reply to the vote and removes the keyboard for that user, while still showing the keyboard with poll options to users who haven't voted yet." } ] }, @@ -7278,7 +7591,7 @@ "kind": "named", "name": "WebAppInfo" }, - "doc": "Optional. Description of the Web App that will be launched when the user presses the button. The Web App will be able to send an arbitrary message on behalf of the user using the method answerWebAppQuery. Available only in private chats between a user and the bot. Not supported for messages sent on behalf of a business account." + "doc": "Optional. Description of the Web App that will be launched when the user presses the button. The Web App will be able to send an arbitrary message on behalf of the user using the method answerWebAppQuery. Available only in private chats between a user and the bot. Not supported for messages sent on behalf of a business account and ephemeral messages." }, { "name": "LoginURL", @@ -7341,7 +7654,7 @@ "kind": "primitive", "name": "bool" }, - "doc": "Optional. Specify True, to send a Pay button. Substrings “” and “XTR” in the buttons's text will be replaced with a Telegram Star icon.NOTE: This type of button must always be the first button in the first row and can only be used in invoice messages." + "doc": "Optional. Specify True to send a Pay button. Substrings “” and “XTR” in the button's text will be replaced with a Telegram Star icon.NOTE: This type of button must always be the first button in the first row and can only be used in invoice messages." }, { "name": "Disabled", @@ -7470,7 +7783,7 @@ }, { "name": "CallbackQuery", - "doc": "This 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 the button was attached to a message sent via the bot (in inline mode), the field inline_message_id will be present. Exactly one of the fields data or game_short_name will be present.\nNOTE: After the user presses a callback button, Telegram clients will display a progress bar until you call answerCallbackQuery. It is, therefore, necessary to react by calling answerCallbackQuery even if no notification to the user is needed (e.g., without specifying any of the optional parameters).", + "doc": "This object represents an incoming callback query from a callback button in an inline keyboard or in a rich message. If the button that originated the query belongs to a message sent by the bot, the field message will be present, unless the field inline_message_id is used instead as specified by the parameter callback_query_mode of the method setMySettings. If the button belongs to a message sent via the bot (in inline mode), the field inline_message_id will be present. Exactly one of the fields data or game_short_name will be present.\nNOTE: After the user presses a callback button, Telegram clients will display a progress bar until you call answerCallbackQuery. It is, therefore, necessary to react by calling answerCallbackQuery even if no notification to the user is needed (e.g., without specifying any of the optional parameters).", "fields": [ { "name": "ID", @@ -7508,7 +7821,7 @@ "kind": "primitive", "name": "string" }, - "doc": "Optional. Identifier of the message sent via the bot in inline mode, that originated the query" + "doc": "Optional. Identifier of the message sent via the bot in inline mode, that originated the query. Can also be present for messages sent by the bot, depending on the parameter callback_query_mode of the method setMySettings." }, { "name": "ChatInstance", @@ -7527,7 +7840,7 @@ "kind": "primitive", "name": "string" }, - "doc": "Optional. Data associated with the callback button. Be aware that the message originated the query can contain no callback buttons with this data." + "doc": "Optional. Data associated with the callback button. Be aware that the message that originated the query can contain no callback buttons with this data." }, { "name": "GameShortName", @@ -7540,9 +7853,332 @@ } ] }, + { + "name": "WidgetQueryType", + "doc": "This object describes the type of a query from a widget. Currently, it can be one of", + "one_of": [ + "WidgetQueryTypeData", + "WidgetQueryTypeSignData", + "WidgetQueryTypeSentTransaction" + ] + }, + { + "name": "WidgetQueryTypeData", + "doc": "The query contains data for the bot.", + "fields": [ + { + "name": "Type", + "json_name": "type", + "type": { + "kind": "primitive", + "name": "string" + }, + "required": true, + "doc": "Type of the query, always “data”", + "enum_values": [ + "data" + ] + }, + { + "name": "WalletCard", + "json_name": "wallet_card", + "type": { + "kind": "named", + "name": "TonWalletCard" + }, + "doc": "Optional. TON wallet card of the user who sent the query, if it was sent to the bot along with the query" + } + ] + }, + { + "name": "WidgetQueryTypeSignData", + "doc": "The query contains data signed by a TON wallet of the user who sent the query. The data is signed for the domain bot, where is the identifier of the bot.", + "fields": [ + { + "name": "Type", + "json_name": "type", + "type": { + "kind": "primitive", + "name": "string" + }, + "required": true, + "doc": "Type of the query, always “sign_data”", + "enum_values": [ + "sign_data" + ] + }, + { + "name": "Wallet", + "json_name": "wallet", + "type": { + "kind": "named", + "name": "WidgetQueryWallet" + }, + "required": true, + "doc": "The wallet that signed the data" + }, + { + "name": "SignData", + "json_name": "sign_data", + "type": { + "kind": "primitive", + "name": "string" + }, + "required": true, + "doc": "JSON-serialized signed data" + } + ] + }, + { + "name": "WidgetQueryTypeSentTransaction", + "doc": "The query notifies the bot about a transaction sent from a TON wallet of the user who sent the query.", + "fields": [ + { + "name": "Type", + "json_name": "type", + "type": { + "kind": "primitive", + "name": "string" + }, + "required": true, + "doc": "Type of the query, always “sent_transaction”", + "enum_values": [ + "sent_transaction" + ] + }, + { + "name": "Wallet", + "json_name": "wallet", + "type": { + "kind": "named", + "name": "WidgetQueryWallet" + }, + "required": true, + "doc": "The wallet from which the transaction was sent" + }, + { + "name": "MsgHash", + "json_name": "msg_hash", + "type": { + "kind": "primitive", + "name": "string" + }, + "required": true, + "doc": "Value of msg_hash of the transaction" + } + ] + }, + { + "name": "WidgetQueryWallet", + "doc": "This object describes a TON wallet of the user, which is used in a query from a widget.", + "fields": [ + { + "name": "Address", + "json_name": "address", + "type": { + "kind": "primitive", + "name": "string" + }, + "required": true, + "doc": "Address of the wallet" + }, + { + "name": "Amount", + "json_name": "amount", + "type": { + "kind": "primitive", + "name": "string" + }, + "required": true, + "doc": "Balance of the wallet, in the smallest units of the cryptocurrency, as a decimal number" + }, + { + "name": "PublicKey", + "json_name": "public_key", + "type": { + "kind": "primitive", + "name": "string" + }, + "doc": "Optional. Hex-encoded public key of the wallet; omitted if unknown" + }, + { + "name": "StateInit", + "json_name": "state_init", + "type": { + "kind": "primitive", + "name": "string" + }, + "doc": "Optional. Base64-encoded serialized StateInit of the wallet contract; omitted if and only if public_key is omitted" + } + ] + }, + { + "name": "WidgetQuery", + "doc": "This 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 widgets.", + "fields": [ + { + "name": "ID", + "json_name": "id", + "type": { + "kind": "primitive", + "name": "string" + }, + "required": true, + "doc": "Unique identifier for this query" + }, + { + "name": "From", + "json_name": "from", + "type": { + "kind": "named", + "name": "User" + }, + "required": true, + "doc": "Sender" + }, + { + "name": "Chat", + "json_name": "chat", + "type": { + "kind": "named", + "name": "Chat" + }, + "doc": "Optional. Chat with the message containing the widget; omitted if the widget is in an inline message" + }, + { + "name": "MessageID", + "json_name": "message_id", + "type": { + "kind": "primitive", + "name": "int64" + }, + "doc": "Optional. Identifier of the message containing the widget; omitted if the widget is in an inline message" + }, + { + "name": "InlineMessageID", + "json_name": "inline_message_id", + "type": { + "kind": "primitive", + "name": "string" + }, + "doc": "Optional. Identifier of the inline message containing the widget" + }, + { + "name": "ChatInstance", + "json_name": "chat_instance", + "type": { + "kind": "primitive", + "name": "string" + }, + "required": true, + "doc": "Global identifier, uniquely corresponding to the chat to which the message with the widget was sent" + }, + { + "name": "ChatType", + "json_name": "chat_type", + "type": { + "kind": "primitive", + "name": "string" + }, + "doc": "Optional. For widgets in inline messages, type of the chat to which the message was sent. Can be either “sender” for a private chat with the inline query sender, “private”, “group”, “supergroup”, or “channel”.", + "enum_values": [ + "sender", + "private", + "group", + "supergroup", + "channel" + ] + }, + { + "name": "Type", + "json_name": "type", + "type": { + "kind": "named", + "name": "WidgetQueryType" + }, + "required": true, + "doc": "Type of the query" + }, + { + "name": "Data", + "json_name": "data", + "type": { + "kind": "primitive", + "name": "string" + }, + "required": true, + "doc": "Data of the query, 1-64 bytes" + }, + { + "name": "WidgetID", + "json_name": "widget_id", + "type": { + "kind": "primitive", + "name": "string" + }, + "doc": "Optional. Unique identifier of the shared widget, which sent the query; omitted if the widget isn't shared" + } + ] + }, + { + "name": "SharedWidgetQuery", + "doc": "This 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 all its widgets.", + "fields": [ + { + "name": "ID", + "json_name": "id", + "type": { + "kind": "primitive", + "name": "string" + }, + "required": true, + "doc": "Unique identifier for this query" + }, + { + "name": "From", + "json_name": "from", + "type": { + "kind": "named", + "name": "User" + }, + "required": true, + "doc": "Sender" + }, + { + "name": "Type", + "json_name": "type", + "type": { + "kind": "named", + "name": "WidgetQueryType" + }, + "required": true, + "doc": "Type of the query" + }, + { + "name": "Data", + "json_name": "data", + "type": { + "kind": "primitive", + "name": "string" + }, + "required": true, + "doc": "Data of the query, 1-64 bytes" + }, + { + "name": "WidgetID", + "json_name": "widget_id", + "type": { + "kind": "primitive", + "name": "string" + }, + "required": true, + "doc": "Unique identifier of the shared widget, which sent the query" + } + ] + }, { "name": "ForceReply", - "doc": "Upon 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 create user-friendly step-by-step interfaces without having to sacrifice privacy mode. Not supported in channels and for messages sent on behalf of a user account.\nExample: A poll bot for groups runs in privacy mode (only receives commands, replies to its messages and mentions). There could be two ways to create a new poll:\nThe last option is definitely more attractive. And if you use ForceReply in your bot's questions, it will receive the user's answers even if it only receives replies, commands and mentions - without any extra work for the user.", + "doc": "Upon 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 create user-friendly step-by-step interfaces without having to sacrifice privacy mode. Not supported in channels and for messages sent on behalf of a business account.\nExample: A poll bot for groups runs in privacy mode (only receives commands, replies to its messages and mentions). There could be two ways to create a new poll:\nThe last option is definitely more attractive. And if you use ForceReply in your bot's questions, it will receive the user's answers even if it only receives replies, commands and mentions - without any extra work for the user.", "fields": [ { "name": "ForceReply", @@ -7586,7 +8222,7 @@ "name": "int64" }, "required": true, - "doc": "Unique identifier for this community. This number may have more than 32 significant bits and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a signed 64-bit integer or double-precision float type are safe for storing this identifier." + "doc": "Unique identifier for this community. This number may have more than 32 significant bits and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a signed 64-bit integer or double-precision float type is safe for storing this identifier." }, { "name": "Name", @@ -7716,7 +8352,7 @@ "kind": "primitive", "name": "int64" }, - "doc": "Optional. Point in time (Unix timestamp) when the link will expire or has been expired" + "doc": "Optional. Point in time (Unix timestamp) when the link will expire or has expired" }, { "name": "MemberLimit", @@ -8482,7 +9118,7 @@ "name": "bool" }, "required": true, - "doc": "True, if the user is allowed to send animations, games, stickers and use inline bots" + "doc": "True, if the user is allowed to send animations, games, stickers, widgets and use inline bots" }, { "name": "CanAddWebPagePreviews", @@ -8666,7 +9302,7 @@ "name": "int64" }, "required": true, - "doc": "Identifier of a private chat with the user who sent the join request. This number may have more than 32 significant bits and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a 64-bit integer or double-precision float type are safe for storing this identifier. The bot can use this identifier for 5 minutes to send messages until the join request is processed, assuming no other administrator contacted the user." + "doc": "Identifier of a private chat with the user who sent the join request. This number may have more than 32 significant bits and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a 64-bit integer or double-precision float type is safe for storing this identifier. The bot can use this identifier for 5 minutes to send messages until the join request is processed, assuming no other administrator contacted the user." }, { "name": "Date", @@ -8790,7 +9426,7 @@ "kind": "primitive", "name": "bool" }, - "doc": "Optional. True, if the user is allowed to send animations, games, stickers and use inline bots" + "doc": "Optional. True, if the user is allowed to send animations, games, stickers, widgets and use inline bots" }, { "name": "CanAddWebPagePreviews", @@ -9007,7 +9643,7 @@ }, { "name": "UserRating", - "doc": "This object describes the rating of a user based on their Telegram Star spendings.", + "doc": "This object describes the rating of a user based on their Telegram Star spending.", "fields": [ { "name": "Level", @@ -9017,7 +9653,7 @@ "name": "int64" }, "required": true, - "doc": "Current level of the user, indicating their reliability when purchasing digital goods and services. A higher level suggests a more trustworthy customer; a negative level is likely reason for concern." + "doc": "Current level of the user, indicating their reliability when purchasing digital goods and services. A higher level suggests a more trustworthy customer; a negative level is likely a reason for concern." }, { "name": "Rating", @@ -9051,8 +9687,8 @@ ] }, { - "name": "StoryAreaPosition", - "doc": "Describes the position of a clickable area within a story.", + "name": "AreaPosition", + "doc": "Describes the position of a rectangle area on a story media or a TON wallet card.", "fields": [ { "name": "XPercentage", @@ -9062,7 +9698,7 @@ "name": "float64" }, "required": true, - "doc": "The abscissa of the area's center, as a percentage of the media width" + "doc": "The abscissa of the area's center, as a percentage of the media or the card width" }, { "name": "YPercentage", @@ -9072,7 +9708,7 @@ "name": "float64" }, "required": true, - "doc": "The ordinate of the area's center, as a percentage of the media height" + "doc": "The ordinate of the area's center, as a percentage of the media or the card height" }, { "name": "WidthPercentage", @@ -9082,7 +9718,7 @@ "name": "float64" }, "required": true, - "doc": "The width of the area's rectangle, as a percentage of the media width" + "doc": "The width of the area's rectangle, as a percentage of the media or the card width" }, { "name": "HeightPercentage", @@ -9092,7 +9728,7 @@ "name": "float64" }, "required": true, - "doc": "The height of the area's rectangle, as a percentage of the media height" + "doc": "The height of the area's rectangle, as a percentage of the media or the card height" }, { "name": "RotationAngle", @@ -9112,7 +9748,382 @@ "name": "float64" }, "required": true, - "doc": "The radius of the rectangle corner rounding, as a percentage of the media width" + "doc": "The radius of the rectangle corner rounding, as a percentage of the media or the card width" + } + ] + }, + { + "name": "TonNft", + "doc": "This object represents an NFT in the TON blockchain.", + "fields": [ + { + "name": "Address", + "json_name": "address", + "type": { + "kind": "primitive", + "name": "string" + }, + "required": true, + "doc": "Address of the NFT" + }, + { + "name": "CollectionAddress", + "json_name": "collection_address", + "type": { + "kind": "primitive", + "name": "string" + }, + "doc": "Optional. Address of the collection to which the NFT belongs; omitted if unknown" + }, + { + "name": "Index", + "json_name": "index", + "type": { + "kind": "primitive", + "name": "string" + }, + "required": true, + "doc": "Index of the NFT among all NFTs from the collection as a decimal number" + }, + { + "name": "Name", + "json_name": "name", + "type": { + "kind": "primitive", + "name": "string" + }, + "required": true, + "doc": "Name of the NFT" + }, + { + "name": "Description", + "json_name": "description", + "type": { + "kind": "primitive", + "name": "string" + }, + "required": true, + "doc": "Description of the NFT" + }, + { + "name": "Attributes", + "json_name": "attributes", + "type": { + "kind": "array", + "elem_type": { + "kind": "named", + "name": "TonNftAttribute" + } + }, + "doc": "Optional. Attributes of the NFT" + }, + { + "name": "Gift", + "json_name": "gift", + "type": { + "kind": "named", + "name": "UniqueGift" + }, + "doc": "Optional. The unique gift corresponding to the NFT" + } + ] + }, + { + "name": "TonNftAttribute", + "doc": "This object represents an attribute of an NFT in the TON blockchain.", + "fields": [ + { + "name": "TraitType", + "json_name": "trait_type", + "type": { + "kind": "primitive", + "name": "string" + }, + "required": true, + "doc": "Trait type of the attribute" + }, + { + "name": "Value", + "json_name": "value", + "type": { + "kind": "primitive", + "name": "string" + }, + "required": true, + "doc": "Value of the attribute" + } + ] + }, + { + "name": "TonWalletCardSticker", + "doc": "This object describes a sticker on a TON wallet card.", + "fields": [ + { + "name": "Position", + "json_name": "position", + "type": { + "kind": "named", + "name": "AreaPosition" + }, + "required": true, + "doc": "Position of the sticker on the card" + }, + { + "name": "Nft", + "json_name": "nft", + "type": { + "kind": "named", + "name": "TonNft" + }, + "required": true, + "doc": "The NFT shown as the sticker" + } + ] + }, + { + "name": "TonWalletCard", + "doc": "This object describes a TON wallet card, which is shown on the profile page of a user to everyone.", + "fields": [ + { + "name": "Address", + "json_name": "address", + "type": { + "kind": "primitive", + "name": "string" + }, + "required": true, + "doc": "Address of the wallet" + }, + { + "name": "Amount", + "json_name": "amount", + "type": { + "kind": "primitive", + "name": "string" + }, + "required": true, + "doc": "Balance of the wallet, in the smallest units of the cryptocurrency, as a decimal number" + }, + { + "name": "Stickers", + "json_name": "stickers", + "type": { + "kind": "array", + "elem_type": { + "kind": "named", + "name": "TonWalletCardSticker" + } + }, + "required": true, + "doc": "Stickers placed on the card" + }, + { + "name": "BackgroundNftAddress", + "json_name": "background_nft_address", + "type": { + "kind": "primitive", + "name": "string" + }, + "doc": "Optional. Address of the NFT of one of the stickers, whose colors must be used for the card background; omitted if the default background must be used" + } + ] + }, + { + "name": "EmojiType", + "doc": "This object describes an emoji. Currently, it can be one of", + "one_of": [ + "EmojiTypeEmoji", + "EmojiTypeCustomEmoji" + ] + }, + { + "name": "EmojiTypeEmoji", + "doc": "A regular emoji.", + "fields": [ + { + "name": "Type", + "json_name": "type", + "type": { + "kind": "primitive", + "name": "string" + }, + "required": true, + "doc": "Type of the emoji, always “emoji”", + "enum_values": [ + "emoji" + ] + }, + { + "name": "Emoji", + "json_name": "emoji", + "type": { + "kind": "primitive", + "name": "string" + }, + "required": true, + "doc": "The emoji" + } + ] + }, + { + "name": "EmojiTypeCustomEmoji", + "doc": "A custom emoji.", + "fields": [ + { + "name": "Type", + "json_name": "type", + "type": { + "kind": "primitive", + "name": "string" + }, + "required": true, + "doc": "Type of the emoji, always “custom_emoji”", + "enum_values": [ + "custom_emoji" + ] + }, + { + "name": "CustomEmojiID", + "json_name": "custom_emoji_id", + "type": { + "kind": "primitive", + "name": "string" + }, + "required": true, + "doc": "Identifier of the custom emoji. Use getCustomEmojiStickers to get full information about the sticker." + } + ] + }, + { + "name": "ChatShareTheme", + "doc": "This object describes the theme of the screen for sharing a link to a user or a chat. Currently, it can be one of", + "one_of": [ + "ChatShareThemeEmoji", + "ChatShareThemeUniqueGift" + ] + }, + { + "name": "ChatShareThemeEmoji", + "doc": "The theme with emoji placed on a background.", + "fields": [ + { + "name": "Type", + "json_name": "type", + "type": { + "kind": "primitive", + "name": "string" + }, + "required": true, + "doc": "Type of the theme, always “emoji”", + "enum_values": [ + "emoji" + ] + }, + { + "name": "Emojis", + "json_name": "emojis", + "type": { + "kind": "array", + "elem_type": { + "kind": "named", + "name": "EmojiType" + } + }, + "required": true, + "doc": "The emoji; 0-6 regular or custom emoji" + }, + { + "name": "BackgroundBackdropID", + "json_name": "background_backdrop_id", + "type": { + "kind": "primitive", + "name": "int64" + }, + "doc": "Optional. Identifier of the backdrop used as the background; omitted if the default background is used. Use getChatShareThemeBackdrops to get details about the backdrop." + } + ] + }, + { + "name": "ChatShareThemeUniqueGift", + "doc": "The theme based on a unique gift owned by the user or the chat.", + "fields": [ + { + "name": "Type", + "json_name": "type", + "type": { + "kind": "primitive", + "name": "string" + }, + "required": true, + "doc": "Type of the theme, always “unique_gift”", + "enum_values": [ + "unique_gift" + ] + }, + { + "name": "Gift", + "json_name": "gift", + "type": { + "kind": "named", + "name": "UniqueGift" + }, + "required": true, + "doc": "The gift" + } + ] + }, + { + "name": "ChatShareThemeBackdrops", + "doc": "This 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.", + "fields": [ + { + "name": "Backdrops", + "json_name": "backdrops", + "type": { + "kind": "array", + "elem_type": { + "kind": "named", + "name": "ChatShareThemeBackdrop" + } + }, + "required": true, + "doc": "The list of backdrops" + } + ] + }, + { + "name": "ChatShareThemeBackdrop", + "doc": "This 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.", + "fields": [ + { + "name": "ID", + "json_name": "id", + "type": { + "kind": "primitive", + "name": "int64" + }, + "required": true, + "doc": "Unique identifier of the backdrop" + }, + { + "name": "Name", + "json_name": "name", + "type": { + "kind": "primitive", + "name": "string" + }, + "required": true, + "doc": "Name of the backdrop" + }, + { + "name": "Colors", + "json_name": "colors", + "type": { + "kind": "named", + "name": "UniqueGiftBackdropColors" + }, + "required": true, + "doc": "Colors of the backdrop" } ] }, @@ -9261,7 +10272,7 @@ "kind": "primitive", "name": "bool" }, - "doc": "Optional. Pass True if reaction area corner is flipped" + "doc": "Optional. Pass True if the reaction area corner is flipped" } ] }, @@ -9319,7 +10330,7 @@ "name": "float64" }, "required": true, - "doc": "Temperature, in degree Celsius" + "doc": "Temperature, in degrees Celsius" }, { "name": "Emoji", @@ -9381,7 +10392,7 @@ "json_name": "position", "type": { "kind": "named", - "name": "StoryAreaPosition" + "name": "AreaPosition" }, "required": true, "doc": "Position of the area" @@ -9883,7 +10894,7 @@ }, { "name": "Gifts", - "doc": "This object represent a list of gifts.", + "doc": "This object represents a list of gifts.", "fields": [ { "name": "Gifts", @@ -9983,7 +10994,7 @@ "name": "int64" }, "required": true, - "doc": "The number of unique gifts that receive this model for every 1000 gifts upgraded" + "doc": "The number of unique gifts that receive this symbol for every 1000 gifts upgraded" } ] }, @@ -10222,7 +11233,7 @@ "kind": "primitive", "name": "bool" }, - "doc": "Optional. True, if the original regular gift was exclusively purchaseable by Telegram Premium subscribers" + "doc": "Optional. True, if the original regular gift was exclusively purchasable by Telegram Premium subscribers" }, { "name": "IsBurned", @@ -11299,7 +12310,7 @@ "name": "User" }, "required": true, - "doc": "User for which the gift code was created" + "doc": "User for whom the gift code was created" } ] }, @@ -11691,7 +12702,7 @@ "name": "int64" }, "required": true, - "doc": "Identifier of a private chat with the user who created the business connection. This number may have more than 32 significant bits and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a 64-bit integer or double-precision float type are safe for storing this identifier." + "doc": "Identifier of a private chat with the user who created the business connection. This number may have more than 32 significant bits and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a 64-bit integer or double-precision float type is safe for storing this identifier." }, { "name": "Date", @@ -11847,7 +12858,7 @@ "kind": "primitive", "name": "int64" }, - "doc": "Optional. The group has been migrated to a supergroup with the specified identifier. This number may have more than 32 significant bits and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a signed 64-bit integer or double-precision float type are safe for storing this identifier." + "doc": "Optional. The group has been migrated to a supergroup with the specified identifier. This number may have more than 32 significant bits and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a signed 64-bit integer or double-precision float type is safe for storing this identifier." }, { "name": "RetryAfter", @@ -11906,7 +12917,7 @@ "kind": "primitive", "name": "string" }, - "doc": "Optional. Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass “attach://” if the thumbnail was uploaded using multipart/form-data under . More information on Sending Files »" + "doc": "Optional. Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can only be uploaded as a new file, so you can pass “attach://” if the thumbnail was uploaded using multipart/form-data under . More information on Sending Files »" }, { "name": "Caption", @@ -12024,7 +13035,7 @@ "kind": "primitive", "name": "string" }, - "doc": "Optional. Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass “attach://” if the thumbnail was uploaded using multipart/form-data under . More information on Sending Files »" + "doc": "Optional. Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can only be uploaded as a new file, so you can pass “attach://” if the thumbnail was uploaded using multipart/form-data under . More information on Sending Files »" }, { "name": "Caption", @@ -12124,7 +13135,7 @@ "kind": "primitive", "name": "string" }, - "doc": "Optional. Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass “attach://” if the thumbnail was uploaded using multipart/form-data under . More information on Sending Files »" + "doc": "Optional. Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can only be uploaded as a new file, so you can pass “attach://” if the thumbnail was uploaded using multipart/form-data under . More information on Sending Files »" }, { "name": "Caption", @@ -12590,7 +13601,7 @@ "kind": "primitive", "name": "string" }, - "doc": "Optional. Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass “attach://” if the thumbnail was uploaded using multipart/form-data under . More information on Sending Files »" + "doc": "Optional. Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can only be uploaded as a new file, so you can pass “attach://” if the thumbnail was uploaded using multipart/form-data under . More information on Sending Files »" }, { "name": "Cover", @@ -12726,7 +13737,7 @@ "name": "string" }, "required": true, - "doc": "File to send. Pass a file_id to send a file that exists on the Telegram servers (recommended), pass an HTTP URL for Telegram to get a file from the Internet, or pass \"attach://\" to upload a new one using multipart/form-data under name. More information on Sending Files »" + "doc": "File to send. Pass a file_id to send a file that exists on the Telegram servers (recommended), pass an HTTP URL for Telegram to get a file from the Internet, or pass “attach://” to upload a new one using multipart/form-data under name. More information on Sending Files »" }, { "name": "Caption", @@ -12889,7 +13900,7 @@ "kind": "primitive", "name": "string" }, - "doc": "Optional. Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass “attach://” if the thumbnail was uploaded using multipart/form-data under . More information on Sending Files »" + "doc": "Optional. Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can only be uploaded as a new file, so you can pass “attach://” if the thumbnail was uploaded using multipart/form-data under . More information on Sending Files »" }, { "name": "Cover", @@ -13359,7 +14370,7 @@ "name": "float64" }, "required": true, - "doc": "Shift by X-axis measured in widths of the mask scaled to the face size, from left to right. For example, choosing -1.0 will place mask just to the left of the default mask position." + "doc": "Shift by X-axis measured in widths of the mask scaled to the face size, from left to right. For example, choosing -1.0 will place the mask just to the left of the default mask position." }, { "name": "YShift", @@ -13444,7 +14455,7 @@ "name": "string" } }, - "doc": "Optional. List of 0-20 search keywords for the sticker with total length of up to 64 characters. For “regular” and “custom_emoji” stickers only." + "doc": "Optional. List of 0-20 search keywords for the sticker with a total length of up to 64 characters. For “regular” and “custom_emoji” stickers only." } ] }, @@ -13499,7 +14510,7 @@ "kind": "primitive", "name": "string" }, - "doc": "Optional. Content of the rich message to send described using HTML formatting. See rich message formatting options for more details. Use media field to specify the media used in the message." + "doc": "Optional. Content of the rich message to send described using HTML formatting. See rich message formatting options for more details. Use the media field to specify the media used in the message." }, { "name": "Markdown", @@ -13508,7 +14519,7 @@ "kind": "primitive", "name": "string" }, - "doc": "Optional. Content of the rich message to send described using Markdown formatting. See rich message formatting options for more details. Use media field to specify the media used in the message." + "doc": "Optional. Content of the rich message to send described using Markdown formatting. See rich message formatting options for more details. Use the media field to specify the media used in the message." }, { "name": "Media", @@ -13708,6 +14719,7 @@ "RichTextEmailAddress", "RichTextPhoneNumber", "RichTextBankCardNumber", + "RichTextTonAddress", "RichTextMention", "RichTextHashtag", "RichTextCashtag", @@ -14300,6 +15312,45 @@ } ] }, + { + "name": "RichTextTonAddress", + "doc": "An address in the TON blockchain.", + "fields": [ + { + "name": "Type", + "json_name": "type", + "type": { + "kind": "primitive", + "name": "string" + }, + "required": true, + "doc": "Type of the rich text, always “ton_address”", + "enum_values": [ + "ton_address" + ] + }, + { + "name": "Text", + "json_name": "text", + "type": { + "kind": "named", + "name": "RichText" + }, + "required": true, + "doc": "Text of the address" + }, + { + "name": "Address", + "json_name": "address", + "type": { + "kind": "primitive", + "name": "string" + }, + "required": true, + "doc": "The address" + } + ] + }, { "name": "RichTextMention", "doc": "A mention by a username.", @@ -14549,7 +15600,7 @@ "name": "string" }, "required": true, - "doc": "The name of the anchor. If the name is empty, then the link brings back to the top of the message." + "doc": "The name of the anchor. If the name is empty, then the link brings the user back to the top of the message." } ] }, @@ -15117,7 +16168,7 @@ }, { "name": "RichBlockExpandableBlockQuotation", - "doc": "A block quotation, corresponding to the HTML tag
with custom attribute \"expandable\".", + "doc": "A block quotation, corresponding to the HTML tag
with the custom attribute \"expandable\".", "fields": [ { "name": "Type", @@ -15133,11 +16184,14 @@ ] }, { - "name": "Text", - "json_name": "text", + "name": "Blocks", + "json_name": "blocks", "type": { - "kind": "named", - "name": "RichText" + "kind": "array", + "elem_type": { + "kind": "named", + "name": "RichBlock" + } }, "required": true, "doc": "Content of the block" @@ -15769,7 +16823,7 @@ }, { "name": "RichBlockThinking", - "doc": "A block with a “Thinking…” placeholder, corresponding to the custom HTML tag . The block may be used only in sendRichMessageDraft, therefore it can't be received in messages. See https://t.me/addemoji/AIActions for examples of custom emoji that are recommended for usage in the block.", + "doc": "A block with a “Thinking…” placeholder, corresponding to the custom HTML tag . The block may be used only in sendRichMessageDraft; therefore, it can't be received in messages. See https://t.me/addemoji/AIActions for examples of custom emoji that are recommended for usage in the block.", "fields": [ { "name": "Type", @@ -16175,7 +17229,7 @@ }, { "name": "InputRichBlockExpandableBlockQuotation", - "doc": "A block quotation, corresponding to the HTML tag
with custom attribute \"expandable\".", + "doc": "A block quotation, corresponding to the HTML tag
with the custom attribute \"expandable\".", "fields": [ { "name": "Type", @@ -16191,11 +17245,14 @@ ] }, { - "name": "Text", - "json_name": "text", + "name": "Blocks", + "json_name": "blocks", "type": { - "kind": "named", - "name": "RichText" + "kind": "array", + "elem_type": { + "kind": "named", + "name": "InputRichBlock" + } }, "required": true, "doc": "Content of the block" @@ -16794,7 +17851,7 @@ }, { "name": "InputRichBlockThinking", - "doc": "A block with a “Thinking…” placeholder, corresponding to the custom HTML tag . The block may be used only in sendRichMessageDraft, therefore it can't be received in messages. See https://t.me/addemoji/AIActions for examples of custom emoji that are recommended for usage in the block.", + "doc": "A block with a “Thinking…” placeholder, corresponding to the custom HTML tag . The block may be used only in sendRichMessageDraft; therefore, it can't be received in messages. See https://t.me/addemoji/AIActions for examples of custom emoji that are recommended for usage in the block.", "fields": [ { "name": "Type", @@ -16872,7 +17929,7 @@ "kind": "primitive", "name": "string" }, - "doc": "Optional. Type of the chat from which the inline query was sent. Can be either “sender” for a private chat with the inline query sender, “private”, “group”, “supergroup”, or “channel”. The chat type should be always known for requests sent from official clients and most third-party clients, unless the request was sent from a secret chat.", + "doc": "Optional. Type of the chat from which the inline query was sent. Can be either “sender” for a private chat with the inline query sender, “private”, “group”, “supergroup”, or “channel”. The chat type should always be known for requests sent from official clients and most third-party clients, unless the request was sent from a secret chat.", "enum_values": [ "sender", "private", @@ -16888,7 +17945,7 @@ "kind": "named", "name": "Location" }, - "doc": "Optional. Sender location, only for bots that request user location" + "doc": "Optional. Sender location, only for bots that enabled user location requests via @BotFather or using the parameter needs_inline_query_location of the method setMySettings" } ] }, @@ -17057,7 +18114,7 @@ }, { "name": "InlineQueryResultPhoto", - "doc": "Represents 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.", + "doc": "Represents a link to a photo. 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 specified content instead of the photo.", "fields": [ { "name": "Type", @@ -17204,7 +18261,7 @@ }, { "name": "InlineQueryResultGif", - "doc": "Represents 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 instead of the animation.", + "doc": "Represents a link to an animated GIF file. 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 message with the specified content instead of the animation.", "fields": [ { "name": "Type", @@ -17365,7 +18422,7 @@ }, { "name": "InlineQueryResultMpeg4Gif", - "doc": "Represents 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 send a message with the specified content instead of the animation.", + "doc": "Represents 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 an optional caption. Alternatively, you can use input_message_content to send a message with the specified content instead of the animation.", "fields": [ { "name": "Type", @@ -17687,7 +18744,7 @@ "kind": "named", "name": "InputMessageContent" }, - "doc": "Optional. Content of the message to be sent instead of the video. This field is required if InlineQueryResultVideo is used to send an HTML-page as a result (e.g., a YouTube video)." + "doc": "Optional. Content of the message to be sent instead of the video. This field is required if InlineQueryResultVideo is used to send an HTML page as a result (e.g., a YouTube video)." } ] }, @@ -17813,7 +18870,7 @@ }, { "name": "InlineQueryResultVoice", - "doc": "Represents 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 specified content instead of the the voice message.", + "doc": "Represents 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 specified content instead of the voice message.", "fields": [ { "name": "Type", @@ -18645,7 +19702,7 @@ }, { "name": "InlineQueryResultCachedGif", - "doc": "Represents 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 message with specified content instead of the animation.", + "doc": "Represents 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 message with the specified content instead of the animation.", "fields": [ { "name": "Type", @@ -19354,7 +20411,9 @@ "InputLocationMessageContent", "InputVenueMessageContent", "InputContactMessageContent", - "InputInvoiceMessageContent" + "InputInvoiceMessageContent", + "InputWidgetMessageContent", + "InputSharedWidgetMessageContent" ] }, { @@ -19644,7 +20703,7 @@ "name": "string" }, "required": true, - "doc": "Bot-defined invoice payload, 1-128 bytes. This will not be displayed to the user, use it for your internal processes." + "doc": "Bot-defined invoice payload, 1-128 bytes. This will not be displayed to the user; use it for your internal processes." }, { "name": "ProviderToken", @@ -19685,7 +20744,7 @@ "kind": "primitive", "name": "int64" }, - "doc": "Optional. The maximum accepted amount for tips in the smallest units of the currency (integer, not float/double). For example, for a maximum tip of US$ 1.45 pass max_tip_amount = 145. See the exp parameter in currencies.json, it shows the number of digits past the decimal point for each currency (2 for the majority of currencies). Defaults to 0. Not supported for payments in Telegram Stars." + "doc": "Optional. The maximum accepted amount for tips in the smallest units of the currency (integer, not float/double). For example, for a maximum tip of US$ 1.45 pass max_tip_amount = 145. See the exp parameter in currencies.json; it shows the number of digits past the decimal point for each currency (2 for the majority of currencies). Defaults to 0. Not supported for payments in Telegram Stars." }, { "name": "SuggestedTipAmounts", @@ -19697,7 +20756,7 @@ "name": "int64" } }, - "doc": "Optional. A JSON-serialized Array of suggested amounts of tip in the smallest units of the currency (integer, not float/double). At most 4 suggested tip amounts can be specified. The suggested tip amounts must be positive, passed in a strictly increased order and must not exceed max_tip_amount." + "doc": "Optional. A JSON-serialized Array of suggested amounts of tips in the smallest units of the currency (integer, not float/double). At most 4 suggested tip amounts can be specified. The suggested tip amounts must be positive, passed in a strictly increasing order and must not exceed max_tip_amount." }, { "name": "ProviderData", @@ -19809,9 +20868,192 @@ } ] }, + { + "name": "InputWidgetMessageContent", + "doc": "Represents 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.", + "fields": [ + { + "name": "HTML", + "json_name": "html", + "type": { + "kind": "primitive", + "name": "string" + }, + "required": true, + "doc": "HTML code of the widget, 1-32768 bytes. The code must not exceed 4096 bytes when compressed by zlib with the maximum compression level." + }, + { + "name": "Width", + "json_name": "width", + "type": { + "kind": "primitive", + "name": "int64" + }, + "doc": "Optional. Width of the widget in logical pixels; omit if the widget must occupy the whole width of the message bubble. The width is clamped by the app to the range from 200 to the maximum width of the message bubble." + }, + { + "name": "Height", + "json_name": "height", + "type": { + "kind": "primitive", + "name": "int64" + }, + "doc": "Optional. Height of the widget in logical pixels; omit if the height of the widget isn't fixed. The height is clamped by the app to the range 50-600." + }, + { + "name": "PublicData", + "json_name": "public_data", + "type": { + "kind": "primitive", + "name": "string" + }, + "doc": "Optional. Public data of the widget, 0-1024 bytes, which will be available wherever the widget is shown. If the widget is shared, then all messages with it will have the same public data." + }, + { + "name": "ChatData", + "json_name": "chat_data", + "type": { + "kind": "primitive", + "name": "string" + }, + "doc": "Optional. Data of the widget, which is specific to the message, 0-1024 bytes" + }, + { + "name": "Caption", + "json_name": "caption", + "type": { + "kind": "primitive", + "name": "string" + }, + "doc": "Optional. Widget caption, 0-1024 characters after entities parsing" + }, + { + "name": "ParseMode", + "json_name": "parse_mode", + "type": { + "kind": "primitive", + "name": "string" + }, + "doc": "Optional. Mode for parsing entities in the widget caption. See formatting options for more details.", + "enum_values": [ + "Markdown", + "MarkdownV2", + "HTML" + ] + }, + { + "name": "CaptionEntities", + "json_name": "caption_entities", + "type": { + "kind": "array", + "elem_type": { + "kind": "named", + "name": "MessageEntity" + } + }, + "doc": "Optional. List of special entities that appear in the caption, which can be specified instead of parse_mode" + }, + { + "name": "ShowCaptionAboveMedia", + "json_name": "show_caption_above_media", + "type": { + "kind": "primitive", + "name": "bool" + }, + "doc": "Optional. Pass True if the caption must be shown above the widget" + }, + { + "name": "AllowQueries", + "json_name": "allow_queries", + "type": { + "kind": "primitive", + "name": "bool" + }, + "doc": "Optional. Pass True to allow the widget to send queries to the bot" + }, + { + "name": "IsShared", + "json_name": "is_shared", + "type": { + "kind": "primitive", + "name": "bool" + }, + "doc": "Optional. Pass True to create a shared widget. Each message sent from the result creates a separate shared widget, whose identifier is received by the bot only in the field widget_id of queries from the widget. To send an existing shared widget in response to an inline query, use InputSharedWidgetMessageContent instead." + } + ] + }, + { + "name": "InputSharedWidgetMessageContent", + "doc": "Represents 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.", + "fields": [ + { + "name": "WidgetID", + "json_name": "widget_id", + "type": { + "kind": "primitive", + "name": "string" + }, + "required": true, + "doc": "Unique identifier of the shared widget created by the bot" + }, + { + "name": "ChatData", + "json_name": "chat_data", + "type": { + "kind": "primitive", + "name": "string" + }, + "doc": "Optional. Data of the widget, which is specific to the message, 0-1024 bytes" + }, + { + "name": "Caption", + "json_name": "caption", + "type": { + "kind": "primitive", + "name": "string" + }, + "doc": "Optional. Widget caption, 0-1024 characters after entities parsing" + }, + { + "name": "ParseMode", + "json_name": "parse_mode", + "type": { + "kind": "primitive", + "name": "string" + }, + "doc": "Optional. Mode for parsing entities in the widget caption. See formatting options for more details.", + "enum_values": [ + "Markdown", + "MarkdownV2", + "HTML" + ] + }, + { + "name": "CaptionEntities", + "json_name": "caption_entities", + "type": { + "kind": "array", + "elem_type": { + "kind": "named", + "name": "MessageEntity" + } + }, + "doc": "Optional. List of special entities that appear in the caption, which can be specified instead of parse_mode" + }, + { + "name": "ShowCaptionAboveMedia", + "json_name": "show_caption_above_media", + "type": { + "kind": "primitive", + "name": "bool" + }, + "doc": "Optional. Pass True if the caption must be shown above the widget" + } + ] + }, { "name": "ChosenInlineResult", - "doc": "Represents a result of an inline query that was chosen by the user and sent to their chat partner.\nNote: It is necessary to enable inline feedback via @BotFather in order to receive these objects in updates.", + "doc": "Represents a result of an inline query that was chosen by the user and sent to their chat partner.\nNote: It is necessary to enable inline feedback via @BotFather or using the parameter inline_feedback_share_denominator of the method setMySettings in order to receive these objects in updates.", "fields": [ { "name": "ResultID", @@ -19840,7 +21082,7 @@ "kind": "named", "name": "Location" }, - "doc": "Optional. Sender location, only for bots that require user location" + "doc": "Optional. Sender location, only for bots that enabled user location requests via @BotFather or using the parameter needs_inline_query_location of the method setMySettings" }, { "name": "InlineMessageID", @@ -19849,7 +21091,7 @@ "kind": "primitive", "name": "string" }, - "doc": "Optional. Identifier of the sent inline message. Available only if there is an inline keyboard attached to the message. Will be also received in callback queries and can be used to edit the message." + "doc": "Optional. Identifier of the sent inline message. Available only if there is an inline keyboard attached to the message. Will also be received in callback queries and can be used to edit the message." }, { "name": "Query", @@ -19885,7 +21127,7 @@ "name": "int64" }, "required": true, - "doc": "Price of the product in the smallest units of the currency (integer, not float/double). For example, for a price of US$ 1.45 pass amount = 145. See the exp parameter in currencies.json, it shows the number of digits past the decimal point for each currency (2 for the majority of currencies)." + "doc": "Price of the product in the smallest units of the currency (integer, not float/double). For example, for a price of US$ 1.45 pass amount = 145. See the exp parameter in currencies.json; it shows the number of digits past the decimal point for each currency (2 for the majority of currencies)." } ] }, @@ -19941,7 +21183,7 @@ "name": "int64" }, "required": true, - "doc": "Total price in the smallest units of the currency (integer, not float/double). For example, for a price of US$ 1.45 pass amount = 145. See the exp parameter in currencies.json, it shows the number of digits past the decimal point for each currency (2 for the majority of currencies)." + "doc": "Total price in the smallest units of the currency (integer, not float/double). For example, for a price of US$ 1.45, total_amount = 145. See the exp parameter in currencies.json; it shows the number of digits past the decimal point for each currency (2 for the majority of currencies)." } ] }, @@ -20114,7 +21356,7 @@ "name": "int64" }, "required": true, - "doc": "Total price in the smallest units of the currency (integer, not float/double). For example, for a price of US$ 1.45 pass amount = 145. See the exp parameter in currencies.json, it shows the number of digits past the decimal point for each currency (2 for the majority of currencies)." + "doc": "Total price in the smallest units of the currency (integer, not float/double). For example, for a price of US$ 1.45, total_amount = 145. See the exp parameter in currencies.json; it shows the number of digits past the decimal point for each currency (2 for the majority of currencies)." }, { "name": "InvoicePayload", @@ -20218,7 +21460,7 @@ "name": "int64" }, "required": true, - "doc": "Total refunded price in the smallest units of the currency (integer, not float/double). For example, for a price of US$ 1.45, total_amount = 145. See the exp parameter in currencies.json, it shows the number of digits past the decimal point for each currency (2 for the majority of currencies)." + "doc": "Total refunded price in the smallest units of the currency (integer, not float/double). For example, for a price of US$ 1.45, total_amount = 145. See the exp parameter in currencies.json; it shows the number of digits past the decimal point for each currency (2 for the majority of currencies)." }, { "name": "InvoicePayload", @@ -20293,7 +21535,7 @@ "name": "ShippingAddress" }, "required": true, - "doc": "User specified shipping address" + "doc": "User-specified shipping address" } ] }, @@ -20339,7 +21581,7 @@ "name": "int64" }, "required": true, - "doc": "Total price in the smallest units of the currency (integer, not float/double). For example, for a price of US$ 1.45 pass amount = 145. See the exp parameter in currencies.json, it shows the number of digits past the decimal point for each currency (2 for the majority of currencies)." + "doc": "Total price in the smallest units of the currency (integer, not float/double). For example, for a price of US$ 1.45, total_amount = 145. See the exp parameter in currencies.json; it shows the number of digits past the decimal point for each currency (2 for the majority of currencies)." }, { "name": "InvoicePayload", @@ -20929,7 +22171,7 @@ } }, "required": true, - "doc": "Array with information about documents and other Telegram Passport elements that was shared with the bot" + "doc": "Array with information shared with the bot about documents and other Telegram Passport elements" }, { "name": "Credentials", @@ -21283,7 +22525,7 @@ }, { "name": "PassportElementErrorReverseSide", - "doc": "Represents an issue with the reverse side of a document. The error is considered resolved when the file with reverse side of the document changes.", + "doc": "Represents an issue with the reverse side of a document. The error is considered resolved when the file with the reverse side of the document changes.", "fields": [ { "name": "Source", @@ -21566,7 +22808,7 @@ }, { "name": "PassportElementErrorTranslationFiles", - "doc": "Represents an issue with the translated version of a document. The error is considered resolved when a file with the document translation change.", + "doc": "Represents an issue with the translated version of a document. The error is considered resolved when a file with the document translation changes.", "fields": [ { "name": "Source", @@ -21678,7 +22920,7 @@ }, { "name": "Game", - "doc": "This object represents a game. Use BotFather to create and edit games, their short names will act as unique identifiers.", + "doc": "This object represents a game. Use BotFather to create and edit games; their short names will act as unique identifiers.", "fields": [ { "name": "Title", @@ -21816,7 +23058,7 @@ "kind": "primitive", "name": "int64" }, - "doc": "Timeout in seconds for long polling. Defaults to 0, i.e. usual short polling. Should be positive, short polling should be used for testing purposes only." + "doc": "Timeout in seconds for long polling. Defaults to 0, i.e. usual short polling. Should be positive; short polling should be used for testing purposes only." }, { "name": "AllowedUpdates", @@ -21841,7 +23083,7 @@ }, { "name": "setWebhook", - "doc": "Use 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 Update. In case of an unsuccessful request (a request with response HTTP status code different from 2XY), we will repeat the request and give up after a reasonable amount of attempts. Returns True on success.\nIf you'd like to make sure that the webhook was set by you, you can specify secret data in the parameter secret_token. If specified, the request will contain a header “X-Telegram-Bot-Api-Secret-Token” with the secret token as content.\nNotes1. You will not be able to receive updates using getUpdates for as long as an outgoing webhook is set up.2. To use a self-signed certificate, you need to upload your public key certificate using certificate parameter. Please upload as InputFile, sending a String will not work.3. Ports currently supported for webhooks: 443, 80, 88, 8443.\nIf you're having any trouble setting up webhooks, please check out this amazing guide to webhooks.", + "doc": "Use 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 Update. In case of an unsuccessful request (a request with response HTTP status code different from 2XY), we will repeat the request and give up after a reasonable number of attempts. Returns True on success.\nIf you'd like to make sure that the webhook was set by you, you can specify secret data in the parameter secret_token. If specified, the request will contain a header “X-Telegram-Bot-Api-Secret-Token” with the secret token as content.\nNotes1. You will not be able to receive updates using getUpdates for as long as an outgoing webhook is set up.2. To use a self-signed certificate, you need to upload your public key certificate using the certificate parameter. Please upload it as InputFile; sending a String will not work.3. Ports currently supported for webhooks: 443, 80, 88, 8443.\nIf you're having any trouble setting up webhooks, please check out this amazing guide to webhooks.", "params": [ { "name": "URL", @@ -21890,7 +23132,7 @@ "name": "string" } }, - "doc": "A JSON-serialized list of the update types you want your bot to receive. For example, specify [\"message\", \"edited_channel_post\", \"callback_query\"] to only receive updates of these types. See Update for a complete list of available update types. Specify an empty list to receive all update types except chat_member, message_reaction, and message_reaction_count (default). If not specified, the previous setting will be used.Please note that this parameter doesn't affect updates created before the call to the setWebhook, so unwanted updates may be received for a short period of time." + "doc": "A JSON-serialized list of the update types you want your bot to receive. For example, specify [\"message\", \"edited_channel_post\", \"callback_query\"] to only receive updates of these types. See Update for a complete list of available update types. Specify an empty list to receive all update types except chat_member, message_reaction, and message_reaction_count (default). If not specified, the previous setting will be used.Please note that this parameter doesn't affect updates created before the call to setWebhook, so unwanted updates may be received for a short period of time." }, { "name": "DropPendingUpdates", @@ -21938,7 +23180,7 @@ }, { "name": "getWebhookInfo", - "doc": "Use 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.", + "doc": "Use this method to get the current webhook status. Requires no parameters. On success, returns a WebhookInfo object. If the bot is using getUpdates, it will return an object with the url field empty.", "returns": { "kind": "named", "name": "WebhookInfo" @@ -21946,15 +23188,15 @@ }, { "name": "getMe", - "doc": "A simple method for testing your bot's authentication token. Requires no parameters. Returns basic information about the bot in form of a User object.", + "doc": "A simple method for testing your bot's authentication token. Requires no parameters. Returns information about the bot in the form of a BotFullInfo object.", "returns": { "kind": "named", - "name": "User" + "name": "BotFullInfo" } }, { "name": "logOut", - "doc": "Use 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 successful call, you can immediately log in on a local server, but will not be able to log in back to the cloud Bot API server for 10 minutes. Returns True on success. Requires no parameters.", + "doc": "Use 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 successful call, you can immediately log in on a local server, but will not be able to log back in to the cloud Bot API server for 10 minutes. Returns True on success. Requires no parameters.", "returns": { "kind": "primitive", "name": "bool" @@ -21991,8 +23233,7 @@ "string" ] }, - "required": true, - "doc": "Unique identifier for the target chat or username of the target bot, supergroup or channel in the format @username" + "doc": "Unique identifier for the target chat or username of the target bot, supergroup, or channel in the format @username; required unless the message is sent as an ephemeral reply to a callback query" }, { "name": "MessageThreadID", @@ -22155,7 +23396,7 @@ ] }, "required": true, - "doc": "Unique identifier for the target chat or username of the target bot, supergroup or channel in the format @username" + "doc": "Unique identifier for the target chat or username of the target bot, supergroup, or channel in the format @username" }, { "name": "MessageThreadID", @@ -22186,7 +23427,7 @@ ] }, "required": true, - "doc": "Unique identifier for the chat where the original message was sent (or username of the target bot, supergroup or channel in the format @username)" + "doc": "Unique identifier for the chat where the original message was sent (or username of the target bot, supergroup, or channel in the format @username)" }, { "name": "VideoStartTimestamp", @@ -22264,7 +23505,7 @@ ] }, "required": true, - "doc": "Unique identifier for the target chat or username of the target bot, supergroup or channel in the format @username" + "doc": "Unique identifier for the target chat or username of the target bot, supergroup, or channel in the format @username" }, { "name": "MessageThreadID", @@ -22295,7 +23536,7 @@ ] }, "required": true, - "doc": "Unique identifier for the chat where the original messages were sent (or username of the target bot, supergroup or channel in the format @username)" + "doc": "Unique identifier for the chat where the original messages were sent (or username of the target bot, supergroup, or channel in the format @username)" }, { "name": "MessageIds", @@ -22339,7 +23580,7 @@ }, { "name": "copyMessage", - "doc": "Use this method to copy messages of any kind. Service messages, paid media messages, giveaway messages, giveaway winners messages, and invoice messages can't be copied. A quiz poll can be copied only if the value of the field correct_option_ids is known to the bot. The method is analogous to the method forwardMessage, but the copied message doesn't have a link to the original message. Returns the MessageId of the sent message on success.", + "doc": "Use 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 the value of the field correct_option_ids is known to the bot. The method is analogous to the method forwardMessage, but the copied message doesn't have a link to the original message. Returns the MessageId of the sent message on success.", "params": [ { "name": "ChatID", @@ -22352,7 +23593,7 @@ ] }, "required": true, - "doc": "Unique identifier for the target chat or username of the target bot, supergroup or channel in the format @username" + "doc": "Unique identifier for the target chat or username of the target bot, supergroup, or channel in the format @username" }, { "name": "MessageThreadID", @@ -22383,7 +23624,7 @@ ] }, "required": true, - "doc": "Unique identifier for the chat where the original message was sent (or username of the target bot, supergroup or channel in the format @username)" + "doc": "Unique identifier for the chat where the original message was sent (or username of the target bot, supergroup, or channel in the format @username)" }, { "name": "MessageID", @@ -22524,7 +23765,7 @@ }, { "name": "copyMessages", - "doc": "Use 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, and invoice messages can't be copied. A quiz poll can be copied only if the value of the field correct_option_ids is known to the bot. The method is analogous to the method forwardMessages, but the copied messages don't have a link to the original message. Album grouping is kept for copied messages. On success, an Array of MessageId of the sent messages is returned.", + "doc": "Use 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 messages, and widget messages can't be copied. A quiz poll can be copied only if the value of the field correct_option_ids is known to the bot. The method is analogous to the method forwardMessages, but the copied messages don't have a link to the original message. Album grouping is kept for copied messages. On success, an Array of MessageId of the sent messages is returned.", "params": [ { "name": "ChatID", @@ -22537,7 +23778,7 @@ ] }, "required": true, - "doc": "Unique identifier for the target chat or username of the target bot, supergroup or channel in the format @username" + "doc": "Unique identifier for the target chat or username of the target bot, supergroup, or channel in the format @username" }, { "name": "MessageThreadID", @@ -22568,7 +23809,7 @@ ] }, "required": true, - "doc": "Unique identifier for the chat where the original messages were sent (or username of the target bot, supergroup or channel in the format @username)" + "doc": "Unique identifier for the chat where the original messages were sent (or username of the target bot, supergroup, or channel in the format @username)" }, { "name": "MessageIds", @@ -22642,8 +23883,7 @@ "string" ] }, - "required": true, - "doc": "Unique identifier for the target chat or username of the target bot, supergroup or channel in the format @username" + "doc": "Unique identifier for the target chat or username of the target bot, supergroup, or channel in the format @username; required unless the message is sent as an ephemeral reply to a callback query" }, { "name": "MessageThreadID", @@ -22836,8 +24076,7 @@ "string" ] }, - "required": true, - "doc": "Unique identifier for the target chat or username of the target channel (in the format @channelusername)" + "doc": "Unique identifier for the target chat or username of the target bot, supergroup, or channel in the format @username; required unless the message is sent as an ephemeral reply to a callback query" }, { "name": "MessageThreadID", @@ -22890,7 +24129,7 @@ ] }, "required": true, - "doc": "The static photo to send. Pass a file_id as String to send a photo that exists on the Telegram servers (recommended) or upload a new video using multipart/form-data. More information on Sending Files ». Sending live photos by a URL is currently unsupported." + "doc": "The static photo to send. Pass a file_id as String to send a photo that exists on the Telegram servers (recommended) or upload a new photo using multipart/form-data. More information on Sending Files ». Sending live photos by a URL is currently unsupported." }, { "name": "Caption", @@ -22899,7 +24138,7 @@ "kind": "primitive", "name": "string" }, - "doc": "Video caption (may also be used when resending videos by file_id), 0-1024 characters after entities parsing" + "doc": "Live photo caption (may also be used when resending live photos by file_id), 0-1024 characters after entities parsing" }, { "name": "ParseMode", @@ -22908,7 +24147,7 @@ "kind": "primitive", "name": "string" }, - "doc": "Mode for parsing entities in the video caption. See formatting options for more details.", + "doc": "Mode for parsing entities in the live photo caption. See formatting options for more details.", "enum_values": [ "Markdown", "MarkdownV2", @@ -22943,7 +24182,7 @@ "kind": "primitive", "name": "bool" }, - "doc": "Pass True if the video needs to be covered with a spoiler animation" + "doc": "Pass True if the live photo needs to be covered with a spoiler animation" }, { "name": "DisableNotification", @@ -23022,7 +24261,7 @@ }, { "name": "sendAudio", - "doc": "Use 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 audio files of up to 50 MB in size, this limit may be changed in the future.\nFor sending voice messages, use the sendVoice method instead.", + "doc": "Use 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 audio files of up to 50 MB in size; this limit may be changed in the future.\nFor sending voice messages, use the sendVoice method instead.", "params": [ { "name": "BusinessConnectionID", @@ -23043,8 +24282,7 @@ "string" ] }, - "required": true, - "doc": "Unique identifier for the target chat or username of the target bot, supergroup or channel in the format @username" + "doc": "Unique identifier for the target chat or username of the target bot, supergroup, or channel in the format @username; required unless the message is sent as an ephemeral reply to a callback query" }, { "name": "MessageThreadID", @@ -23158,7 +24396,7 @@ "string" ] }, - "doc": "Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass “attach://” if the thumbnail was uploaded using multipart/form-data under . More information on Sending Files »" + "doc": "Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can only be uploaded as a new file, so you can pass “attach://” if the thumbnail was uploaded using multipart/form-data under . More information on Sending Files »" }, { "name": "DisableNotification", @@ -23237,7 +24475,7 @@ }, { "name": "sendDocument", - "doc": "Use 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.", + "doc": "Use 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.", "params": [ { "name": "BusinessConnectionID", @@ -23258,8 +24496,7 @@ "string" ] }, - "required": true, - "doc": "Unique identifier for the target chat or username of the target bot, supergroup or channel in the format @username" + "doc": "Unique identifier for the target chat or username of the target bot, supergroup, or channel in the format @username; required unless the message is sent as an ephemeral reply to a callback query" }, { "name": "MessageThreadID", @@ -23311,7 +24548,7 @@ "string" ] }, - "doc": "Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass “attach://” if the thumbnail was uploaded using multipart/form-data under . More information on Sending Files »" + "doc": "Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can only be uploaded as a new file, so you can pass “attach://” if the thumbnail was uploaded using multipart/form-data under . More information on Sending Files »" }, { "name": "Caption", @@ -23434,7 +24671,7 @@ }, { "name": "sendVideo", - "doc": "Use 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, this limit may be changed in the future.", + "doc": "Use 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; this limit may be changed in the future.", "params": [ { "name": "BusinessConnectionID", @@ -23455,8 +24692,7 @@ "string" ] }, - "required": true, - "doc": "Unique identifier for the target chat or username of the target bot, supergroup or channel in the format @username" + "doc": "Unique identifier for the target chat or username of the target bot, supergroup, or channel in the format @username; required unless the message is sent as an ephemeral reply to a callback query" }, { "name": "MessageThreadID", @@ -23535,7 +24771,7 @@ "string" ] }, - "doc": "Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass “attach://” if the thumbnail was uploaded using multipart/form-data under . More information on Sending Files »" + "doc": "Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can only be uploaded as a new file, so you can pass “attach://” if the thumbnail was uploaded using multipart/form-data under . More information on Sending Files »" }, { "name": "Cover", @@ -23697,7 +24933,7 @@ }, { "name": "sendAnimation", - "doc": "Use 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 in the future.", + "doc": "Use 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 in the future.", "params": [ { "name": "BusinessConnectionID", @@ -23718,8 +24954,7 @@ "string" ] }, - "required": true, - "doc": "Unique identifier for the target chat or username of the target bot, supergroup or channel in the format @username" + "doc": "Unique identifier for the target chat or username of the target bot, supergroup, or channel in the format @username; required unless the message is sent as an ephemeral reply to a callback query" }, { "name": "MessageThreadID", @@ -23798,7 +25033,7 @@ "string" ] }, - "doc": "Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass “attach://” if the thumbnail was uploaded using multipart/form-data under . More information on Sending Files »" + "doc": "Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can only be uploaded as a new file, so you can pass “attach://” if the thumbnail was uploaded using multipart/form-data under . More information on Sending Files »" }, { "name": "Caption", @@ -23807,7 +25042,7 @@ "kind": "primitive", "name": "string" }, - "doc": "Animation caption (may also be used when resending animation by file_id), 0-1024 characters after entities parsing" + "doc": "Animation caption (may also be used when resending animations by file_id), 0-1024 characters after entities parsing" }, { "name": "ParseMode", @@ -23930,7 +25165,7 @@ }, { "name": "sendVoice", - "doc": "Use 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 format (other formats may be sent as Audio or Document). On success, the sent Message is returned. Bots can currently send voice messages of up to 50 MB in size, this limit may be changed in the future.", + "doc": "Use 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 format (other formats may be sent as Audio or Document). On success, the sent Message is returned. Bots can currently send voice messages of up to 50 MB in size; this limit may be changed in the future.", "params": [ { "name": "BusinessConnectionID", @@ -23951,8 +25186,7 @@ "string" ] }, - "required": true, - "doc": "Unique identifier for the target chat or username of the target bot, supergroup or channel in the format @username" + "doc": "Unique identifier for the target chat or username of the target bot, supergroup, or channel in the format @username; required unless the message is sent as an ephemeral reply to a callback query" }, { "name": "MessageThreadID", @@ -24115,7 +25349,7 @@ }, { "name": "sendVideoNote", - "doc": "Use this method to send a rounded square MPEG4 video of up to 1 minute long. On success, the sent Message is returned.", + "doc": "Use this method to send a rounded square MPEG4 video up to 1 minute long. On success, the sent Message is returned.", "params": [ { "name": "BusinessConnectionID", @@ -24136,8 +25370,7 @@ "string" ] }, - "required": true, - "doc": "Unique identifier for the target chat or username of the target bot, supergroup or channel in the format @username" + "doc": "Unique identifier for the target chat or username of the target bot, supergroup, or channel in the format @username; required unless the message is sent as an ephemeral reply to a callback query" }, { "name": "MessageThreadID", @@ -24207,7 +25440,7 @@ "string" ] }, - "doc": "Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass “attach://” if the thumbnail was uploaded using multipart/form-data under . More information on Sending Files »" + "doc": "Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can only be uploaded as a new file, so you can pass “attach://” if the thumbnail was uploaded using multipart/form-data under . More information on Sending Files »" }, { "name": "DisableNotification", @@ -24284,6 +25517,359 @@ }, "has_files": true }, + { + "name": "sendWidget", + "doc": "Use 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 forwarded. On success, the sent Message is returned.", + "params": [ + { + "name": "ChatID", + "json_name": "chat_id", + "type": { + "kind": "oneOf", + "variants": [ + "int64", + "string" + ] + }, + "required": true, + "doc": "Unique identifier for the target chat or username of the target supergroup in the format @username" + }, + { + "name": "MessageThreadID", + "json_name": "message_thread_id", + "type": { + "kind": "primitive", + "name": "int64" + }, + "doc": "Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only" + }, + { + "name": "HTML", + "json_name": "html", + "type": { + "kind": "primitive", + "name": "string" + }, + "required": true, + "doc": "HTML code of the widget, 1-32768 bytes. The code must not exceed 4096 bytes when compressed by zlib with the maximum compression level." + }, + { + "name": "Width", + "json_name": "width", + "type": { + "kind": "primitive", + "name": "int64" + }, + "doc": "Width of the widget in logical pixels; omit if the widget must occupy the whole width of the message bubble. The width is clamped by the app to the range from 200 to the maximum width of the message bubble." + }, + { + "name": "Height", + "json_name": "height", + "type": { + "kind": "primitive", + "name": "int64" + }, + "doc": "Height of the widget in logical pixels; omit if the height of the widget isn't fixed. The height is clamped by the app to the range 50-600." + }, + { + "name": "PublicData", + "json_name": "public_data", + "type": { + "kind": "primitive", + "name": "string" + }, + "doc": "Public data of the widget, 0-1024 bytes, which will be available wherever the widget is shown. If the widget is shared, then all messages with it will have the same public data." + }, + { + "name": "ChatData", + "json_name": "chat_data", + "type": { + "kind": "primitive", + "name": "string" + }, + "doc": "Data of the widget, which is specific to the message, 0-1024 bytes" + }, + { + "name": "Caption", + "json_name": "caption", + "type": { + "kind": "primitive", + "name": "string" + }, + "doc": "Widget caption, 0-1024 characters after entities parsing" + }, + { + "name": "ParseMode", + "json_name": "parse_mode", + "type": { + "kind": "primitive", + "name": "string" + }, + "doc": "Mode for parsing entities in the widget caption. See formatting options for more details.", + "enum_values": [ + "Markdown", + "MarkdownV2", + "HTML" + ] + }, + { + "name": "CaptionEntities", + "json_name": "caption_entities", + "type": { + "kind": "array", + "elem_type": { + "kind": "named", + "name": "MessageEntity" + } + }, + "doc": "A JSON-serialized list of special entities that appear in the caption, which can be specified instead of parse_mode" + }, + { + "name": "ShowCaptionAboveMedia", + "json_name": "show_caption_above_media", + "type": { + "kind": "primitive", + "name": "bool" + }, + "doc": "Pass True if the caption must be shown above the widget" + }, + { + "name": "AllowQueries", + "json_name": "allow_queries", + "type": { + "kind": "primitive", + "name": "bool" + }, + "doc": "Pass True to allow the widget to send queries to the bot" + }, + { + "name": "IsShared", + "json_name": "is_shared", + "type": { + "kind": "primitive", + "name": "bool" + }, + "doc": "Pass True to create a shared widget, which can be sent again using the method sendSharedWidget" + }, + { + "name": "DisableNotification", + "json_name": "disable_notification", + "type": { + "kind": "primitive", + "name": "bool" + }, + "doc": "Sends the message silently. Users will receive a notification with no sound." + }, + { + "name": "ProtectContent", + "json_name": "protect_content", + "type": { + "kind": "primitive", + "name": "bool" + }, + "doc": "Protects the contents of the sent message from forwarding and saving" + }, + { + "name": "AllowPaidBroadcast", + "json_name": "allow_paid_broadcast", + "type": { + "kind": "primitive", + "name": "bool" + }, + "doc": "Pass True to allow up to 1000 messages per second, ignoring broadcasting limits for a fee of 0.1 Telegram Stars per message. The relevant Stars will be withdrawn from the bot's balance." + }, + { + "name": "MessageEffectID", + "json_name": "message_effect_id", + "type": { + "kind": "primitive", + "name": "string" + }, + "doc": "Unique identifier of the message effect to be added to the message; for private chats only" + }, + { + "name": "ReplyParameters", + "json_name": "reply_parameters", + "type": { + "kind": "named", + "name": "ReplyParameters" + }, + "doc": "Description of the message to reply to" + }, + { + "name": "ReplyMarkup", + "json_name": "reply_markup", + "type": { + "kind": "oneOf", + "variants": [ + "InlineKeyboardMarkup", + "ReplyKeyboardMarkup", + "ReplyKeyboardRemove", + "ForceReply" + ] + }, + "doc": "Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove a reply keyboard or to force a reply from the user." + } + ], + "returns": { + "kind": "named", + "name": "Message" + } + }, + { + "name": "sendSharedWidget", + "doc": "Use this method to resend 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 can't be forwarded. On success, the sent Message is returned.", + "params": [ + { + "name": "ChatID", + "json_name": "chat_id", + "type": { + "kind": "oneOf", + "variants": [ + "int64", + "string" + ] + }, + "required": true, + "doc": "Unique identifier for the target chat or username of the target supergroup in the format @username" + }, + { + "name": "MessageThreadID", + "json_name": "message_thread_id", + "type": { + "kind": "primitive", + "name": "int64" + }, + "doc": "Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only" + }, + { + "name": "WidgetID", + "json_name": "widget_id", + "type": { + "kind": "primitive", + "name": "string" + }, + "required": true, + "doc": "Unique identifier of the shared widget" + }, + { + "name": "ChatData", + "json_name": "chat_data", + "type": { + "kind": "primitive", + "name": "string" + }, + "doc": "Data of the widget, which is specific to the message, 0-1024 bytes" + }, + { + "name": "Caption", + "json_name": "caption", + "type": { + "kind": "primitive", + "name": "string" + }, + "doc": "Widget caption, 0-1024 characters after entities parsing" + }, + { + "name": "ParseMode", + "json_name": "parse_mode", + "type": { + "kind": "primitive", + "name": "string" + }, + "doc": "Mode for parsing entities in the widget caption. See formatting options for more details.", + "enum_values": [ + "Markdown", + "MarkdownV2", + "HTML" + ] + }, + { + "name": "CaptionEntities", + "json_name": "caption_entities", + "type": { + "kind": "array", + "elem_type": { + "kind": "named", + "name": "MessageEntity" + } + }, + "doc": "A JSON-serialized list of special entities that appear in the caption, which can be specified instead of parse_mode" + }, + { + "name": "ShowCaptionAboveMedia", + "json_name": "show_caption_above_media", + "type": { + "kind": "primitive", + "name": "bool" + }, + "doc": "Pass True if the caption must be shown above the widget" + }, + { + "name": "DisableNotification", + "json_name": "disable_notification", + "type": { + "kind": "primitive", + "name": "bool" + }, + "doc": "Sends the message silently. Users will receive a notification with no sound." + }, + { + "name": "ProtectContent", + "json_name": "protect_content", + "type": { + "kind": "primitive", + "name": "bool" + }, + "doc": "Protects the contents of the sent message from forwarding and saving" + }, + { + "name": "AllowPaidBroadcast", + "json_name": "allow_paid_broadcast", + "type": { + "kind": "primitive", + "name": "bool" + }, + "doc": "Pass True to allow up to 1000 messages per second, ignoring broadcasting limits for a fee of 0.1 Telegram Stars per message. The relevant Stars will be withdrawn from the bot's balance." + }, + { + "name": "MessageEffectID", + "json_name": "message_effect_id", + "type": { + "kind": "primitive", + "name": "string" + }, + "doc": "Unique identifier of the message effect to be added to the message; for private chats only" + }, + { + "name": "ReplyParameters", + "json_name": "reply_parameters", + "type": { + "kind": "named", + "name": "ReplyParameters" + }, + "doc": "Description of the message to reply to" + }, + { + "name": "ReplyMarkup", + "json_name": "reply_markup", + "type": { + "kind": "oneOf", + "variants": [ + "InlineKeyboardMarkup", + "ReplyKeyboardMarkup", + "ReplyKeyboardRemove", + "ForceReply" + ] + }, + "doc": "Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove a reply keyboard or to force a reply from the user." + } + ], + "returns": { + "kind": "named", + "name": "Message" + } + }, { "name": "sendPaidMedia", "doc": "Use this method to send paid media. On success, the sent Message is returned.", @@ -24308,7 +25894,7 @@ ] }, "required": true, - "doc": "Unique identifier for the target chat or username of the target bot, supergroup or channel in the format @username. If the chat is a channel, all Telegram Star proceeds from this media will be credited to the chat's balance. Otherwise, they will be credited to the bot's balance." + "doc": "Unique identifier for the target chat or username of the target bot, supergroup, or channel in the format @username. If the chat is a channel, all Telegram Star proceeds from this media will be credited to the chat's balance. Otherwise, they will be credited to the bot's balance." }, { "name": "MessageThreadID", @@ -24358,7 +25944,7 @@ "kind": "primitive", "name": "string" }, - "doc": "Bot-defined paid media payload, 0-128 bytes. This will not be displayed to the user, use it for your internal processes." + "doc": "Bot-defined paid media payload, 0-128 bytes. This will not be displayed to the user; use it for your internal processes." }, { "name": "Caption", @@ -24472,7 +26058,7 @@ }, { "name": "sendMediaGroup", - "doc": "Use 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 objects that were sent is returned.", + "doc": "Use this method to send a group of photos, live photos, videos, documents or audios as an album. Documents and audio files can only be grouped in an album with messages of the same type. On success, an Array of Message objects that were sent is returned.", "params": [ { "name": "BusinessConnectionID", @@ -24494,7 +26080,7 @@ ] }, "required": true, - "doc": "Unique identifier for the target chat or username of the target bot, supergroup or channel in the format @username" + "doc": "Unique identifier for the target chat or username of the target bot, supergroup, or channel in the format @username" }, { "name": "MessageThreadID", @@ -24590,7 +26176,7 @@ }, { "name": "sendLocation", - "doc": "Use this method to send point on the map. On success, the sent Message is returned.", + "doc": "Use this method to send a point on the map. On success, the sent Message is returned.", "params": [ { "name": "BusinessConnectionID", @@ -24611,8 +26197,7 @@ "string" ] }, - "required": true, - "doc": "Unique identifier for the target chat or username of the target bot, supergroup or channel in the format @username" + "doc": "Unique identifier for the target chat or username of the target bot, supergroup, or channel in the format @username; required unless the message is sent as an ephemeral reply to a callback query" }, { "name": "MessageThreadID", @@ -24794,8 +26379,7 @@ "string" ] }, - "required": true, - "doc": "Unique identifier for the target chat or username of the target bot, supergroup or channel in the format @username" + "doc": "Unique identifier for the target chat or username of the target bot, supergroup, or channel in the format @username; required unless the message is sent as an ephemeral reply to a callback query" }, { "name": "MessageThreadID", @@ -24997,8 +26581,7 @@ "string" ] }, - "required": true, - "doc": "Unique identifier for the target chat or username of the target bot, supergroup or channel in the format @username" + "doc": "Unique identifier for the target chat or username of the target bot, supergroup, or channel in the format @username; required unless the message is sent as an ephemeral reply to a callback query" }, { "name": "MessageThreadID", @@ -25163,7 +26746,7 @@ ] }, "required": true, - "doc": "Unique identifier for the target chat or username of the target bot, supergroup or channel in the format @username. Polls can't be sent to channel direct messages chats." + "doc": "Unique identifier for the target chat or username of the target bot, supergroup, or channel in the format @username. Polls can't be sent to channel direct messages chats." }, { "name": "MessageThreadID", @@ -25257,7 +26840,7 @@ "kind": "primitive", "name": "bool" }, - "doc": "Pass True if the poll allows to change chosen answer options, defaults to False for quizzes and to True for regular polls" + "doc": "Pass True if the poll allows changing the chosen answer options, defaults to False for quizzes and to True for regular polls" }, { "name": "ShuffleOptions", @@ -25611,7 +27194,7 @@ ] }, "required": true, - "doc": "Unique identifier for the target chat or username of the target bot, supergroup or channel in the format @username" + "doc": "Unique identifier for the target chat or username of the target bot, supergroup, or channel in the format @username" }, { "name": "MessageThreadID", @@ -25872,7 +27455,7 @@ ] }, "required": true, - "doc": "Unique identifier for the target chat or username of the target bot, supergroup or channel in the format @username" + "doc": "Unique identifier for the target chat or username of the target bot, supergroup, or channel in the format @username" }, { "name": "MessageID", @@ -26079,7 +27662,7 @@ "kind": "primitive", "name": "int64" }, - "doc": "Date when the user will be unbanned; Unix time. If user is banned for more than 366 days or less than 30 seconds from the current time they are considered to be banned forever. Applied for supergroups and channels only." + "doc": "Date when the user will be unbanned; Unix time. If the user is banned for more than 366 days or less than 30 seconds from the current time, they are considered to be banned forever. Applied for supergroups and channels only." }, { "name": "RevokeMessages", @@ -26191,7 +27774,7 @@ "kind": "primitive", "name": "int64" }, - "doc": "Date when restrictions will be lifted for the user; Unix time. If user is restricted for more than 366 days or less than 30 seconds from the current time, they are considered to be restricted forever." + "doc": "Date when restrictions will be lifted for the user; Unix time. If the user is restricted for more than 366 days or less than 30 seconds from the current time, they are considered to be restricted forever." } ], "returns": { @@ -26287,7 +27870,7 @@ "kind": "primitive", "name": "bool" }, - "doc": "Pass True if the administrator can change chat title, photo and other settings" + "doc": "Pass True if the administrator can change the chat title, photo and other settings" }, { "name": "CanInviteUsers", @@ -26547,7 +28130,7 @@ }, { "name": "setChatPermissions", - "doc": "Use 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 on success.", + "doc": "Use 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 right. Returns True on success.", "params": [ { "name": "ChatID", @@ -26612,7 +28195,7 @@ }, { "name": "createChatInviteLink", - "doc": "Use 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 revokeChatInviteLink. Returns the new invite link as ChatInviteLink object.", + "doc": "Use 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 revokeChatInviteLink. Returns the new invite link as a ChatInviteLink object.", "params": [ { "name": "ChatID", @@ -26740,7 +28323,7 @@ }, { "name": "createChatSubscriptionInviteLink", - "doc": "Use 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 using the method revokeChatInviteLink. Returns the new invite link as a ChatInviteLink object.", + "doc": "Use this method to create a subscription invite link for a channel chat. The bot must have the can_invite_users administrator right. The link can be edited using the method editChatSubscriptionInviteLink or revoked using the method revokeChatInviteLink. Returns the new invite link as a ChatInviteLink object.", "params": [ { "name": "ChatID", @@ -26792,7 +28375,7 @@ }, { "name": "editChatSubscriptionInviteLink", - "doc": "Use 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.", + "doc": "Use this method to edit a subscription invite link created by the bot. The bot must have the can_invite_users administrator right. Returns the edited invite link as a ChatInviteLink object.", "params": [ { "name": "ChatID", @@ -26834,7 +28417,7 @@ }, { "name": "revokeChatInviteLink", - "doc": "Use 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 appropriate administrator rights. Returns the revoked invite link as ChatInviteLink object.", + "doc": "Use 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 appropriate administrator rights. Returns the revoked invite link as a ChatInviteLink object.", "params": [ { "name": "ChatID", @@ -27370,6 +28953,14 @@ "name": "ChatMember" } }, + { + "name": "getChatShareThemeBackdrops", + "doc": "Use 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.", + "returns": { + "kind": "named", + "name": "ChatShareThemeBackdrops" + } + }, { "name": "getUserPersonalChatMessages", "doc": "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. On success, an Array of Message objects is returned.", @@ -27472,7 +29063,7 @@ }, { "name": "createForumTopic", - "doc": "Use 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_topics administrator right. Returns information about the created topic as a ForumTopic object.", + "doc": "Use 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_topics administrator right. In the case of a private chat, a link to the topic can be created in the format https://t.me//; the link opens the topic only for the user. Returns information about the created topic as a ForumTopic object.", "params": [ { "name": "ChatID", @@ -27523,7 +29114,7 @@ }, { "name": "editForumTopic", - "doc": "Use 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 can_manage_topics administrator rights, unless it is the creator of the topic. Returns True on success.", + "doc": "Use this method to edit the 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 can_manage_topics administrator right, unless it is the creator of the topic. Returns True on success.", "params": [ { "name": "ChatID", @@ -27574,7 +29165,7 @@ }, { "name": "closeForumTopic", - "doc": "Use 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 topic. Returns True on success.", + "doc": "Use 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 right, unless it is the creator of the topic. Returns True on success.", "params": [ { "name": "ChatID", @@ -27607,7 +29198,7 @@ }, { "name": "reopenForumTopic", - "doc": "Use 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 the topic. Returns True on success.", + "doc": "Use 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 right, unless it is the creator of the topic. Returns True on success.", "params": [ { "name": "ChatID", @@ -27640,7 +29231,7 @@ }, { "name": "deleteForumTopic", - "doc": "Use this method to delete a forum topic along with all its messages in a forum supergroup chat or a private chat with a user. 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_delete_messages administrator rights. Returns True on success.", + "doc": "Use this method to delete a forum topic along with all its messages in a forum supergroup chat or a private chat with a user. 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_delete_messages administrator right. Returns True on success.", "params": [ { "name": "ChatID", @@ -27706,7 +29297,7 @@ }, { "name": "editGeneralForumTopic", - "doc": "Use 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 success.", + "doc": "Use 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 right. Returns True on success.", "params": [ { "name": "ChatID", @@ -27739,7 +29330,7 @@ }, { "name": "closeGeneralForumTopic", - "doc": "Use 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 success.", + "doc": "Use 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 right. Returns True on success.", "params": [ { "name": "ChatID", @@ -27762,7 +29353,7 @@ }, { "name": "reopenGeneralForumTopic", - "doc": "Use 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 automatically unhidden if it was hidden. Returns True on success.", + "doc": "Use 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 right. The topic will be automatically unhidden if it was hidden. Returns True on success.", "params": [ { "name": "ChatID", @@ -27785,7 +29376,7 @@ }, { "name": "hideGeneralForumTopic", - "doc": "Use 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 automatically closed if it was open. Returns True on success.", + "doc": "Use 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 right. The topic will be automatically closed if it was open. Returns True on success.", "params": [ { "name": "ChatID", @@ -27808,7 +29399,7 @@ }, { "name": "unhideGeneralForumTopic", - "doc": "Use 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.", + "doc": "Use 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 right. Returns True on success.", "params": [ { "name": "ChatID", @@ -27854,7 +29445,7 @@ }, { "name": "answerCallbackQuery", - "doc": "Use 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.\nAlternatively, the user can be redirected to the specified Game URL. For this option to work, you must first create a game for your bot via @BotFather and accept the terms. Otherwise, you may use links like t.me/your_bot?start=XXXX that open your bot with a parameter.", + "doc": "Use this method to send answers to callback queries sent from inline keyboards or rich messages. 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.\nAlternatively, the user can be redirected to the specified Game URL. For this option to work, you must first create a game for your bot via @BotFather and accept the terms. Otherwise, you may use links like t.me/your_bot?start=XXXX that open your bot with a parameter.", "params": [ { "name": "CallbackQueryID", @@ -27908,6 +29499,35 @@ "name": "bool" } }, + { + "name": "answerWidgetQuery", + "doc": "Use 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 editMessageWidgetData or editSharedWidgetData to change it. On success, True is returned.", + "params": [ + { + "name": "WidgetQueryID", + "json_name": "widget_query_id", + "type": { + "kind": "primitive", + "name": "string" + }, + "required": true, + "doc": "Unique identifier for the query to be answered" + }, + { + "name": "Data", + "json_name": "data", + "type": { + "kind": "primitive", + "name": "string" + }, + "doc": "Data to be returned to the widget, 0-1024 bytes" + } + ], + "returns": { + "kind": "primitive", + "name": "bool" + } + }, { "name": "answerGuestQuery", "doc": "Use this method to reply to a received guest message. On success, a SentGuestMessage object is returned.", @@ -28093,6 +29713,156 @@ "name": "bool" } }, + { + "name": "setMySettings", + "doc": "Use this method to change the settings of the bot. Settings that aren't specified remain unchanged. Returns True on success.", + "params": [ + { + "name": "SupportsInlineQueries", + "json_name": "supports_inline_queries", + "type": { + "kind": "primitive", + "name": "bool" + }, + "doc": "Pass True to enable inline mode for the bot or False to disable it" + }, + { + "name": "InlineQueryPlaceholder", + "json_name": "inline_query_placeholder", + "type": { + "kind": "primitive", + "name": "string" + }, + "doc": "New placeholder for inline queries, which is shown in the input field after the bot's username. Pass an empty string to use the default placeholder." + }, + { + "name": "NeedsInlineQueryLocation", + "json_name": "needs_inline_query_location", + "type": { + "kind": "primitive", + "name": "bool" + }, + "doc": "Pass True to request the location of the user with every inline query to the bot or False to stop requesting it" + }, + { + "name": "InlineFeedbackShareDenominator", + "json_name": "inline_feedback_share_denominator", + "type": { + "kind": "primitive", + "name": "int64" + }, + "doc": "Denominator of the share of chosen inline results received by the bot; the bot receives 1 out of inline_feedback_share_denominator chosen results. Must be one of 1, 10, 100, or 1000. Pass 0 to stop receiving chosen inline results." + }, + { + "name": "CanJoinGroups", + "json_name": "can_join_groups", + "type": { + "kind": "primitive", + "name": "bool" + }, + "doc": "Pass True to allow adding the bot to groups or False to disallow it" + }, + { + "name": "CanReadAllGroupMessages", + "json_name": "can_read_all_group_messages", + "type": { + "kind": "primitive", + "name": "bool" + }, + "doc": "Pass True to disable privacy mode for the bot or False to enable it" + }, + { + "name": "CanConnectToBusiness", + "json_name": "can_connect_to_business", + "type": { + "kind": "primitive", + "name": "bool" + }, + "doc": "Pass True to allow connecting the bot to user accounts to manage them or False to disallow it" + }, + { + "name": "CanManageBots", + "json_name": "can_manage_bots", + "type": { + "kind": "primitive", + "name": "bool" + }, + "doc": "Pass True to allow creating other bots that will be controlled by the bot or False to disallow it" + }, + { + "name": "SupportsGuestQueries", + "json_name": "supports_guest_queries", + "type": { + "kind": "primitive", + "name": "bool" + }, + "doc": "Pass True to allow guest queries to the bot from chats it isn't a member of or False to disallow them" + }, + { + "name": "SupportsJoinRequestQueries", + "json_name": "supports_join_request_queries", + "type": { + "kind": "primitive", + "name": "bool" + }, + "doc": "Pass True to allow assigning the bot to process join request queries or False to disallow it" + }, + { + "name": "HasTopicsEnabled", + "json_name": "has_topics_enabled", + "type": { + "kind": "primitive", + "name": "bool" + }, + "doc": "Pass True to enable forum topic mode in private chats with the bot or False to disable it" + }, + { + "name": "AllowsUsersToCreateTopics", + "json_name": "allows_users_to_create_topics", + "type": { + "kind": "primitive", + "name": "bool" + }, + "doc": "Pass True to allow users to create and delete topics in private chats with the bot or False to disallow it" + }, + { + "name": "HasTopicSidebar", + "json_name": "has_topic_sidebar", + "type": { + "kind": "primitive", + "name": "bool" + }, + "doc": "Pass True to show topics in private chats with the bot in a sidebar or False to stop showing them in a sidebar" + }, + { + "name": "CanCommunicateWithBots", + "json_name": "can_communicate_with_bots", + "type": { + "kind": "primitive", + "name": "bool" + }, + "doc": "Pass True to allow the bot to communicate with other bots in groups, private chats, and through business accounts or False to disallow it" + }, + { + "name": "CallbackQueryMode", + "json_name": "callback_query_mode", + "type": { + "kind": "primitive", + "name": "string" + }, + "doc": "Mode in which the bot receives callback queries from buttons in messages sent by the bot. Must be one of “default” (the field message is always used and contains an InaccessibleMessage if the message is inaccessible to the bot), “auto” (the field inline_message_id is used instead of the field message if the message is inaccessible to the bot; the field message can still contain an inaccessible message if the message has just been deleted), or “inline” (the field inline_message_id is always used instead of the field message).", + "enum_values": [ + "default", + "auto", + "inline" + ] + } + ], + "returns": { + "kind": "primitive", + "name": "bool" + } + }, { "name": "setMyCommands", "doc": "Use this method to change the list of the bot's commands. See this manual for more details about bot commands. Returns True on success.", @@ -28448,7 +30218,7 @@ "kind": "primitive", "name": "bool" }, - "doc": "Pass True to get default administrator rights of the bot in channels. Otherwise, default administrator rights of the bot for groups and supergroups will be returned." + "doc": "Pass True to get the default administrator rights of the bot in channels. Otherwise, the default administrator rights of the bot for groups and supergroups will be returned." } ], "returns": { @@ -28487,7 +30257,7 @@ "string" ] }, - "doc": "Required if user_id is not specified. Unique identifier for the chat or username of the channel (in the format @username) that will receive the gift." + "doc": "Required if user_id is not specified. Unique identifier for the chat that will receive the gift or username of the channel in the format @username." }, { "name": "GiftID", @@ -28646,6 +30416,32 @@ "name": "string" }, "doc": "Custom description for the verification; 0-70 characters. Must be empty if the organization isn't allowed to provide a custom verification description." + }, + { + "name": "CustomDescriptionParseMode", + "json_name": "custom_description_parse_mode", + "type": { + "kind": "primitive", + "name": "string" + }, + "doc": "Mode for parsing entities in the custom description. See formatting options for more details. Only “text_link” entities are supported.", + "enum_values": [ + "Markdown", + "MarkdownV2", + "HTML" + ] + }, + { + "name": "CustomDescriptionEntities", + "json_name": "custom_description_entities", + "type": { + "kind": "array", + "elem_type": { + "kind": "named", + "name": "MessageEntity" + } + }, + "doc": "A JSON-serialized list of special entities that appear in the custom description, which can be specified instead of custom_description_parse_mode. Only “text_link” entities are supported." } ], "returns": { @@ -28668,7 +30464,7 @@ ] }, "required": true, - "doc": "Unique identifier for the target chat or username of the target bot, supergroup or channel in the format @username. Channel direct messages chats can't be verified." + "doc": "Unique identifier for the target chat or username of the target bot, supergroup, or channel in the format @username. Channel direct messages chats can't be verified." }, { "name": "CustomDescription", @@ -28678,6 +30474,32 @@ "name": "string" }, "doc": "Custom description for the verification; 0-70 characters. Must be empty if the organization isn't allowed to provide a custom verification description." + }, + { + "name": "CustomDescriptionParseMode", + "json_name": "custom_description_parse_mode", + "type": { + "kind": "primitive", + "name": "string" + }, + "doc": "Mode for parsing entities in the custom description. See formatting options for more details. Only “text_link” entities are supported.", + "enum_values": [ + "Markdown", + "MarkdownV2", + "HTML" + ] + }, + { + "name": "CustomDescriptionEntities", + "json_name": "custom_description_entities", + "type": { + "kind": "array", + "elem_type": { + "kind": "named", + "name": "MessageEntity" + } + }, + "doc": "A JSON-serialized list of special entities that appear in the custom description, which can be specified instead of custom_description_parse_mode. Only “text_link” entities are supported." } ], "returns": { @@ -28720,7 +30542,7 @@ ] }, "required": true, - "doc": "Unique identifier for the target chat or username of the target bot or channel in the format @username" + "doc": "Unique identifier for the target chat or username of the target bot, supergroup, or channel in the format @username" } ], "returns": { @@ -28730,7 +30552,7 @@ }, { "name": "readBusinessMessage", - "doc": "Marks incoming message as read on behalf of a business account. Requires the can_read_messages business bot right. Returns True on success.", + "doc": "Marks an incoming message as read on behalf of a business account. Requires the can_read_messages business bot right. Returns True on success.", "params": [ { "name": "BusinessConnectionID", @@ -28770,7 +30592,7 @@ }, { "name": "deleteBusinessMessages", - "doc": "Delete 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 message. Returns True on success.", + "doc": "Deletes 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 message. Returns True on success.", "params": [ { "name": "BusinessConnectionID", @@ -28803,7 +30625,7 @@ }, { "name": "setBusinessAccountName", - "doc": "Changes the first and last name of a managed business account. Requires the can_change_name business bot right. Returns True on success.", + "doc": "Changes the first and last name of a managed business account. Requires the can_edit_name business bot right. Returns True on success.", "params": [ { "name": "BusinessConnectionID", @@ -28842,7 +30664,7 @@ }, { "name": "setBusinessAccountUsername", - "doc": "Changes the username of a managed business account. Requires the can_change_username business bot right. Returns True on success.", + "doc": "Changes the username of a managed business account. Requires the can_edit_username business bot right. Returns True on success.", "params": [ { "name": "BusinessConnectionID", @@ -28871,7 +30693,7 @@ }, { "name": "setBusinessAccountBio", - "doc": "Changes the bio of a managed business account. Requires the can_change_bio business bot right. Returns True on success.", + "doc": "Changes the bio of a managed business account. Requires the can_edit_bio business bot right. Returns True on success.", "params": [ { "name": "BusinessConnectionID", @@ -29149,7 +30971,7 @@ "kind": "primitive", "name": "string" }, - "doc": "Offset of the first entry to return as received from the previous request; use empty string to get the first chunk of results" + "doc": "Offset of the first entry to return as received from the previous request; use an empty string to get the first chunk of results" }, { "name": "Limit", @@ -29371,6 +31193,26 @@ "name": "OwnedGifts" } }, + { + "name": "getUniqueGift", + "doc": "Use this method to get information about a unique gift by its name. Returns a UniqueGift object on success.", + "params": [ + { + "name": "Name", + "json_name": "name", + "type": { + "kind": "primitive", + "name": "string" + }, + "required": true, + "doc": "Unique name of the gift" + } + ], + "returns": { + "kind": "named", + "name": "UniqueGift" + } + }, { "name": "convertGiftToStars", "doc": "Converts a given regular gift to Telegram Stars. Requires the can_convert_gifts_to_stars business bot right. Returns True on success.", @@ -29441,7 +31283,7 @@ "kind": "primitive", "name": "int64" }, - "doc": "The amount of Telegram Stars that will be paid for the upgrade from the business account balance. If gift.prepaid_upgrade_star_count > 0, then pass 0, otherwise, the can_transfer_stars business bot right is required and gift.upgrade_star_count must be passed." + "doc": "The amount of Telegram Stars that will be paid for the upgrade from the business account balance. If gift.prepaid_upgrade_star_count > 0, then pass 0; otherwise, the can_transfer_stars business bot right is required and gift.upgrade_star_count must be passed." } ], "returns": { @@ -29451,7 +31293,7 @@ }, { "name": "transferGift", - "doc": "Transfers 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.", + "doc": "Transfers an owned unique gift to another user. Requires the can_transfer_and_upgrade_gifts business bot right. Requires the can_transfer_stars business bot right if the transfer is paid. Returns True on success.", "params": [ { "name": "BusinessConnectionID", @@ -29471,7 +31313,7 @@ "name": "string" }, "required": true, - "doc": "Unique identifier of the regular gift that should be transferred" + "doc": "Unique identifier of the unique gift that should be transferred" }, { "name": "NewOwnerChatID", @@ -29481,7 +31323,7 @@ "name": "int64" }, "required": true, - "doc": "Unique identifier of the chat which will own the gift. The chat must be active in the last 24 hours." + "doc": "Unique identifier of the chat which will own the gift. The chat must have been active in the last 24 hours." }, { "name": "StarCount", @@ -29498,6 +31340,36 @@ "name": "bool" } }, + { + "name": "deleteBusinessAccountGift", + "doc": "Deletes 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 total_count of the Gift is omitted) and wasn't refunded. Returns True on success.", + "params": [ + { + "name": "BusinessConnectionID", + "json_name": "business_connection_id", + "type": { + "kind": "primitive", + "name": "string" + }, + "required": true, + "doc": "Unique identifier of the business connection" + }, + { + "name": "OwnedGiftID", + "json_name": "owned_gift_id", + "type": { + "kind": "primitive", + "name": "string" + }, + "required": true, + "doc": "Unique identifier of the regular gift that should be deleted" + } + ], + "returns": { + "kind": "primitive", + "name": "bool" + } + }, { "name": "postStory", "doc": "Posts a story on behalf of a managed business account. Requires the can_manage_stories business bot right. Returns Story on success.", @@ -29916,7 +31788,7 @@ }, { "name": "editMessageText", - "doc": "Use 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 sent by the bot and do not contain an inline keyboard can only be edited within 48 hours from the time they were sent.", + "doc": "Use 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 sent by the bot and do not contain an inline keyboard can only be edited within 48 hours from the time they were sent.", "params": [ { "name": "BusinessConnectionID", @@ -29937,7 +31809,7 @@ "string" ] }, - "doc": "Required if inline_message_id is not specified. Unique identifier for the target chat or username of the target bot, supergroup or channel in the format @username." + "doc": "Required if inline_message_id is not specified. Unique identifier for the target chat or username of the target bot, supergroup, or channel in the format @username." }, { "name": "MessageID", @@ -30008,7 +31880,7 @@ "kind": "named", "name": "InputRichMessage" }, - "doc": "New rich content of the message; required if text isn't specified. Direct upload of new files and explicit upload of files by a URL isn't supported when an inline message is edited." + "doc": "New rich content of the message; required if text isn't specified. Direct upload of new files and explicit upload of files by a URL aren't supported when an inline message is edited." }, { "name": "ReplyMarkup", @@ -30021,13 +31893,13 @@ } ], "returns": { - "kind": "named", - "name": "MessageOrBool" + "kind": "primitive", + "name": "bool" } }, { "name": "editMessageCaption", - "doc": "Use 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 bot and do not contain an inline keyboard can only be edited within 48 hours from the time they were sent.", + "doc": "Use 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 bot and do not contain an inline keyboard can only be edited within 48 hours from the time they were sent.", "params": [ { "name": "BusinessConnectionID", @@ -30048,7 +31920,7 @@ "string" ] }, - "doc": "Required if inline_message_id is not specified. Unique identifier for the target chat or username of the target bot, supergroup or channel in the format @username." + "doc": "Required if inline_message_id is not specified. Unique identifier for the target chat or username of the target bot, supergroup, or channel in the format @username." }, { "name": "MessageID", @@ -30110,7 +31982,7 @@ "kind": "primitive", "name": "bool" }, - "doc": "Pass True if the caption must be shown above the message media. Supported only for animation, photo and video messages." + "doc": "Pass True if the caption must be shown above the message media. Supported only for animation, live photo, paid media, photo, video and widget messages." }, { "name": "ReplyMarkup", @@ -30123,13 +31995,13 @@ } ], "returns": { - "kind": "named", - "name": "MessageOrBool" + "kind": "primitive", + "name": "bool" } }, { "name": "editMessageMedia", - "doc": "Use 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 audio for audio albums, only to a document for document albums and to a photo, a live photo, or a video otherwise. When an inline message is edited, a new file can't be uploaded; use a previously uploaded file via its file_id or specify a URL. 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 bot and do not contain an inline keyboard can only be edited within 48 hours from the time they were sent.", + "doc": "Use this method to edit animation, audio, document, live photo, photo, or video messages, or to replace a text or a rich message with media. If a message is part of a message album, then it can be edited only to an audio for audio albums, only to a document for document albums and to a photo, a live photo, or a video otherwise. When an inline message is edited, a new file can't be uploaded; use a previously uploaded file via its file_id or specify a URL. 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 bot and do not contain an inline keyboard can only be edited within 48 hours from the time they were sent.", "params": [ { "name": "BusinessConnectionID", @@ -30150,7 +32022,7 @@ "string" ] }, - "doc": "Required if inline_message_id is not specified. Unique identifier for the target chat or username of the target bot, supergroup or channel in the format @username." + "doc": "Required if inline_message_id is not specified. Unique identifier for the target chat or username of the target bot, supergroup, or channel in the format @username." }, { "name": "MessageID", @@ -30191,14 +32063,14 @@ } ], "returns": { - "kind": "named", - "name": "MessageOrBool" + "kind": "primitive", + "name": "bool" }, "has_files": true }, { "name": "editMessageLiveLocation", - "doc": "Use 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 inline message, the edited Message is returned, otherwise True is returned.", + "doc": "Use 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 inline message, the edited Message is returned; otherwise, True is returned.", "params": [ { "name": "BusinessConnectionID", @@ -30219,7 +32091,7 @@ "string" ] }, - "doc": "Required if inline_message_id is not specified. Unique identifier for the target chat or username of the target bot, supergroup or channel in the format @username." + "doc": "Required if inline_message_id is not specified. Unique identifier for the target chat or username of the target bot, supergroup, or channel in the format @username." }, { "name": "MessageID", @@ -30306,13 +32178,13 @@ } ], "returns": { - "kind": "named", - "name": "MessageOrBool" + "kind": "primitive", + "name": "bool" } }, { "name": "stopMessageLiveLocation", - "doc": "Use 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.", + "doc": "Use 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.", "params": [ { "name": "BusinessConnectionID", @@ -30333,7 +32205,7 @@ "string" ] }, - "doc": "Required if inline_message_id is not specified. Unique identifier for the target chat or username of the target bot, supergroup or channel in the format @username." + "doc": "Required if inline_message_id is not specified. Unique identifier for the target chat or username of the target bot, supergroup, or channel in the format @username." }, { "name": "MessageID", @@ -30364,8 +32236,8 @@ } ], "returns": { - "kind": "named", - "name": "MessageOrBool" + "kind": "primitive", + "name": "bool" } }, { @@ -30380,7 +32252,7 @@ "name": "string" }, "required": true, - "doc": "Unique identifier of the business connection on behalf of which the message will be sent" + "doc": "Unique identifier of the business connection on behalf of which the message to be edited was sent" }, { "name": "ChatID", @@ -30430,9 +32302,106 @@ "name": "Message" } }, + { + "name": "editMessageWidgetData", + "doc": "Use 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.", + "params": [ + { + "name": "ChatID", + "json_name": "chat_id", + "type": { + "kind": "oneOf", + "variants": [ + "int64", + "string" + ] + }, + "doc": "Required if inline_message_id is not specified. Unique identifier for the target chat or username of the target supergroup in the format @username." + }, + { + "name": "MessageID", + "json_name": "message_id", + "type": { + "kind": "primitive", + "name": "int64" + }, + "doc": "Required if inline_message_id is not specified. Identifier of the message with the widget." + }, + { + "name": "InlineMessageID", + "json_name": "inline_message_id", + "type": { + "kind": "primitive", + "name": "string" + }, + "doc": "Required if chat_id and message_id are not specified. Identifier of the inline message." + }, + { + "name": "PublicData", + "json_name": "public_data", + "type": { + "kind": "primitive", + "name": "string" + }, + "doc": "New public data of the widget, 0-1024 bytes; pass an empty string to remove the public data. If omitted, then the public data isn't changed." + }, + { + "name": "ChatData", + "json_name": "chat_data", + "type": { + "kind": "primitive", + "name": "string" + }, + "doc": "New data of the widget, which is specific to the message, 0-1024 bytes; pass an empty string to remove the data. If omitted, then the data isn't changed." + } + ], + "returns": { + "kind": "primitive", + "name": "bool" + } + }, + { + "name": "editSharedWidgetData", + "doc": "Use 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.", + "params": [ + { + "name": "WidgetID", + "json_name": "widget_id", + "type": { + "kind": "primitive", + "name": "string" + }, + "required": true, + "doc": "Unique identifier of the shared widget" + }, + { + "name": "PublicData", + "json_name": "public_data", + "type": { + "kind": "primitive", + "name": "string" + }, + "required": true, + "doc": "New public data of the widget, 0-1024 bytes; pass an empty string to remove the public data" + }, + { + "name": "CacheTime", + "json_name": "cache_time", + "type": { + "kind": "primitive", + "name": "int64" + }, + "doc": "The maximum amount of time in seconds that the public data of the widget may be cached client-side; 5-3600. If omitted, then the current value is kept, which is 30 by default." + } + ], + "returns": { + "kind": "primitive", + "name": "bool" + } + }, { "name": "editMessageReplyMarkup", - "doc": "Use 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 not sent by the bot and do not contain an inline keyboard can only be edited within 48 hours from the time they were sent.", + "doc": "Use 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 not sent by the bot and do not contain an inline keyboard can only be edited within 48 hours from the time they were sent.", "params": [ { "name": "BusinessConnectionID", @@ -30453,7 +32422,7 @@ "string" ] }, - "doc": "Required if inline_message_id is not specified. Unique identifier for the target chat or username of the target bot, supergroup or channel in the format @username." + "doc": "Required if inline_message_id is not specified. Unique identifier for the target chat or username of the target bot, supergroup, or channel in the format @username." }, { "name": "MessageID", @@ -30484,8 +32453,8 @@ } ], "returns": { - "kind": "named", - "name": "MessageOrBool" + "kind": "primitive", + "name": "bool" } }, { @@ -30512,7 +32481,7 @@ ] }, "required": true, - "doc": "Unique identifier for the target chat or username of the target bot, supergroup or channel in the format @username" + "doc": "Unique identifier for the target chat or username of the target bot, supergroup, or channel in the format @username" }, { "name": "MessageID", @@ -30786,7 +32755,7 @@ "kind": "primitive", "name": "bool" }, - "doc": "Pass True if the caption must be shown above the message media. Supported only for animation, photo and video messages." + "doc": "Pass True if the caption must be shown above the message media. Supported only for animation, live photo, photo and video messages." }, { "name": "ReplyMarkup", @@ -30886,7 +32855,7 @@ "kind": "primitive", "name": "int64" }, - "doc": "Point in time (Unix timestamp) when the post is expected to be published; omit if the date has already been specified when the suggested post was created. If specified, then the date must be not more than 2678400 seconds (30 days) in the future." + "doc": "Point in time (Unix timestamp) when the post is expected to be published; omit if the date has already been specified when the suggested post was created. If specified, then the date must not be more than 2678400 seconds (30 days) in the future." } ], "returns": { @@ -30935,7 +32904,7 @@ }, { "name": "deleteMessage", - "doc": "Use this method to delete a message, including service messages, with the following limitations:- A message can only be deleted if it was sent less than 48 hours ago.- Service messages about a supergroup, channel, or forum topic creation can't be deleted.- A dice message in a private chat can only be deleted if it was sent more than 24 hours ago.- Bots can delete outgoing messages in private chats, groups, and supergroups.- Bots can delete incoming messages in private chats.- Bots granted can_post_messages permissions can delete outgoing messages in channels.- If the bot is an administrator of a group, it can delete any message there.- If the bot has can_delete_messages administrator right in a supergroup or a channel, it can delete any message there.- If the bot has can_manage_direct_messages administrator right in a channel, it can delete any message in the corresponding direct messages chat.Returns True on success.", + "doc": "Use this method to delete a message, including service messages, with the following limitations:- A message can only be deleted if it was sent less than 48 hours ago.- Service messages about a supergroup, channel, or forum topic creation can't be deleted.- A dice message in a private chat can only be deleted if it was sent more than 24 hours ago.- Bots can delete outgoing messages in private chats, groups, and supergroups.- Bots can delete incoming messages in private chats.- Bots granted can_post_messages permissions can delete outgoing messages in channels.- If the bot is an administrator of a group, it can delete any message there.- If the bot has the can_delete_messages administrator right in a supergroup or a channel, it can delete any message there.- If the bot has the can_manage_direct_messages administrator right in a channel, it can delete any message in the corresponding direct messages chat.Returns True on success.", "params": [ { "name": "ChatID", @@ -30948,7 +32917,7 @@ ] }, "required": true, - "doc": "Unique identifier for the target chat or username of the target bot, supergroup or channel in the format @username" + "doc": "Unique identifier for the target chat or username of the target bot, supergroup, or channel in the format @username" }, { "name": "MessageID", @@ -30981,7 +32950,7 @@ ] }, "required": true, - "doc": "Unique identifier for the target chat or username of the target bot, supergroup or channel in the format @username" + "doc": "Unique identifier for the target chat or username of the target bot, supergroup, or channel in the format @username" }, { "name": "MessageIds", @@ -31160,8 +33129,7 @@ "string" ] }, - "required": true, - "doc": "Unique identifier for the target chat or username of the target bot, supergroup or channel in the format @username" + "doc": "Unique identifier for the target chat or username of the target bot, supergroup, or channel in the format @username; required unless the message is sent as an ephemeral reply to a callback query" }, { "name": "MessageThreadID", @@ -31647,7 +33615,7 @@ "name": "string" } }, - "doc": "A JSON-serialized list of 0-20 search keywords for the sticker with total length of up to 64 characters" + "doc": "A JSON-serialized list of 0-20 search keywords for the sticker with a total length of up to 64 characters" } ], "returns": { @@ -31832,7 +33800,7 @@ "kind": "primitive", "name": "string" }, - "doc": "Unique identifier of the business connection on behalf of which the message will be sent. Bot can send rich messages on behalf of a business account only if the corresponding user can send rich messages." + "doc": "Unique identifier of the business connection on behalf of which the message will be sent. The bot can send rich messages on behalf of a business account only if the corresponding user can send rich messages." }, { "name": "ChatID", @@ -31844,8 +33812,7 @@ "string" ] }, - "required": true, - "doc": "Unique identifier for the target chat or username of the target bot, supergroup or channel in the format @username" + "doc": "Unique identifier for the target chat or username of the target bot, supergroup, or channel in the format @username; required unless the message is sent as an ephemeral reply to a callback query" }, { "name": "MessageThreadID", @@ -31999,7 +33966,7 @@ "name": "InputRichMessage" }, "required": true, - "doc": "The partial message to be streamed. Direct upload of new files and explicit upload of files by a URL isn't supported." + "doc": "The partial message to be streamed. Direct upload of new files and explicit upload of files by a URL aren't supported." }, { "name": "CanStop", @@ -32109,7 +34076,7 @@ ] }, "required": true, - "doc": "Unique identifier for the target chat or username of the target bot, supergroup or channel in the format @username" + "doc": "Unique identifier for the target chat or username of the target bot, supergroup, or channel in the format @username" }, { "name": "MessageThreadID", @@ -32157,7 +34124,7 @@ "name": "string" }, "required": true, - "doc": "Bot-defined invoice payload, 1-128 bytes. This will not be displayed to the user, use it for your internal processes." + "doc": "Bot-defined invoice payload, 1-128 bytes. This will not be displayed to the user; use it for your internal processes." }, { "name": "ProviderToken", @@ -32198,7 +34165,7 @@ "kind": "primitive", "name": "int64" }, - "doc": "The maximum accepted amount for tips in the smallest units of the currency (integer, not float/double). For example, for a maximum tip of US$ 1.45 pass max_tip_amount = 145. See the exp parameter in currencies.json, it shows the number of digits past the decimal point for each currency (2 for the majority of currencies). Defaults to 0. Not supported for payments in Telegram Stars." + "doc": "The maximum accepted amount for tips in the smallest units of the currency (integer, not float/double). For example, for a maximum tip of US$ 1.45 pass max_tip_amount = 145. See the exp parameter in currencies.json; it shows the number of digits past the decimal point for each currency (2 for the majority of currencies). Defaults to 0. Not supported for payments in Telegram Stars." }, { "name": "SuggestedTipAmounts", @@ -32210,7 +34177,7 @@ "name": "int64" } }, - "doc": "A JSON-serialized Array of suggested amounts of tips in the smallest units of the currency (integer, not float/double). At most 4 suggested tip amounts can be specified. The suggested tip amounts must be positive, passed in a strictly increased order and must not exceed max_tip_amount." + "doc": "A JSON-serialized Array of suggested amounts of tips in the smallest units of the currency (integer, not float/double). At most 4 suggested tip amounts can be specified. The suggested tip amounts must be positive, passed in a strictly increasing order and must not exceed max_tip_amount." }, { "name": "StartParameter", @@ -32228,7 +34195,7 @@ "kind": "primitive", "name": "string" }, - "doc": "JSON-serialized data about the invoice, which will be shared with the payment provider. A detailed description of required fields should be provided by the payment provider." + "doc": "JSON-serialized data about the invoice, which will be shared with the payment provider. A detailed description of the required fields should be provided by the payment provider." }, { "name": "PhotoURL", @@ -32439,7 +34406,7 @@ "name": "string" }, "required": true, - "doc": "Bot-defined invoice payload, 1-128 bytes. This will not be displayed to the user, use it for your internal processes." + "doc": "Bot-defined invoice payload, 1-128 bytes. This will not be displayed to the user; use it for your internal processes." }, { "name": "ProviderToken", @@ -32480,7 +34447,7 @@ "kind": "primitive", "name": "int64" }, - "doc": "The number of seconds the subscription will be active for before the next payment. The currency must be set to “XTR” (Telegram Stars) if the parameter is used. Currently, it must always be 2592000 (30 days) if specified. Any number of subscriptions can be active for a given bot at the same time, including multiple concurrent subscriptions from the same user. Subscription price must no exceed 10000 Telegram Stars." + "doc": "The number of seconds the subscription will be active for before the next payment. The currency must be set to “XTR” (Telegram Stars) if the parameter is used. Currently, it must always be 2592000 (30 days) if specified. Any number of subscriptions can be active for a given bot at the same time, including multiple concurrent subscriptions from the same user. Subscription price must not exceed 10000 Telegram Stars." }, { "name": "MaxTipAmount", @@ -32489,7 +34456,7 @@ "kind": "primitive", "name": "int64" }, - "doc": "The maximum accepted amount for tips in the smallest units of the currency (integer, not float/double). For example, for a maximum tip of US$ 1.45 pass max_tip_amount = 145. See the exp parameter in currencies.json, it shows the number of digits past the decimal point for each currency (2 for the majority of currencies). Defaults to 0. Not supported for payments in Telegram Stars." + "doc": "The maximum accepted amount for tips in the smallest units of the currency (integer, not float/double). For example, for a maximum tip of US$ 1.45 pass max_tip_amount = 145. See the exp parameter in currencies.json; it shows the number of digits past the decimal point for each currency (2 for the majority of currencies). Defaults to 0. Not supported for payments in Telegram Stars." }, { "name": "SuggestedTipAmounts", @@ -32501,7 +34468,7 @@ "name": "int64" } }, - "doc": "A JSON-serialized Array of suggested amounts of tips in the smallest units of the currency (integer, not float/double). At most 4 suggested tip amounts can be specified. The suggested tip amounts must be positive, passed in a strictly increased order and must not exceed max_tip_amount." + "doc": "A JSON-serialized Array of suggested amounts of tips in the smallest units of the currency (integer, not float/double). At most 4 suggested tip amounts can be specified. The suggested tip amounts must be positive, passed in a strictly increasing order and must not exceed max_tip_amount." }, { "name": "ProviderData", @@ -32510,7 +34477,7 @@ "kind": "primitive", "name": "string" }, - "doc": "JSON-serialized data about the invoice, which will be shared with the payment provider. A detailed description of required fields should be provided by the payment provider." + "doc": "JSON-serialized data about the invoice, which will be shared with the payment provider. A detailed description of the required fields should be provided by the payment provider." }, { "name": "PhotoURL", @@ -32660,7 +34627,7 @@ "kind": "primitive", "name": "string" }, - "doc": "Required if ok is False. Error message in human readable form that explains why it is impossible to complete the order (e.g. “Sorry, delivery to your desired address is unavailable”). Telegram will display this message to the user." + "doc": "Required if ok is False. Error message in human-readable form that explains why it is impossible to complete the order (e.g. “Sorry, delivery to your desired address is unavailable”). Telegram will display this message to the user." } ], "returns": { @@ -32699,7 +34666,7 @@ "kind": "primitive", "name": "string" }, - "doc": "Required if ok is False. Error message in human readable form that explains the reason for failure to proceed with the checkout (e.g. \"Sorry, somebody just bought the last of our amazing black T-shirts while you were busy filling out your payment details. Please choose a different color or garment!\"). Telegram will display this message to the user." + "doc": "Required if ok is False. Error message in human-readable form that explains the reason for failure to proceed with the checkout (e.g. \"Sorry, somebody just bought the last of our amazing black T-shirts while you were busy filling out your payment details. Please choose a different color or garment!\"). Telegram will display this message to the user." } ], "returns": { @@ -32815,7 +34782,7 @@ }, { "name": "setPassportDataErrors", - "doc": "Informs 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 returned the error must change). Returns True on success.\nUse this if the data submitted by the user doesn't satisfy the standards your service requires for any reason. For example, if a birthday date seems invalid, a submitted document is blurry, a scan shows evidence of tampering, etc. Supply some details in the error message to make sure the user knows how to correct the issues.", + "doc": "Informs a user that some of the Telegram Passport elements they provided contain 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 returned the error must change). Returns True on success.\nUse this if the data submitted by the user doesn't satisfy the standards your service requires for any reason. For example, if a birthday date seems invalid, a submitted document is blurry, a scan shows evidence of tampering, etc. Supply some details in the error message to make sure the user knows how to correct the issues.", "params": [ { "name": "UserID", @@ -32953,7 +34920,7 @@ }, { "name": "setGameScore", - "doc": "Use 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 not greater than the user's current score in the chat and force is False.", + "doc": "Use 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 not greater than the user's current score in the chat and force is False.", "params": [ { "name": "UserID", @@ -33022,8 +34989,8 @@ } ], "returns": { - "kind": "named", - "name": "MessageOrBool" + "kind": "primitive", + "name": "bool" } }, { diff --git a/testdata/html/latest.html b/testdata/html/latest.html index 03aa634..ce5d0d6 120000 --- a/testdata/html/latest.html +++ b/testdata/html/latest.html @@ -1 +1 @@ -snapshot_2026-09-14.html \ No newline at end of file +snapshot_2026-11-29.html \ No newline at end of file diff --git a/testdata/html/snapshot_2026-11-29.html b/testdata/html/snapshot_2026-11-29.html new file mode 100644 index 0000000..fd1694b --- /dev/null +++ b/testdata/html/snapshot_2026-11-29.html @@ -0,0 +1,24911 @@ + + + + + Telegram Bot API + + + + + + + + + + + + + + + + + + + +
+ +
+
+

Machine-readable version of this page: /bots/api.md.

+
+ +

Telegram Bot API

+ +
+ +
+

The Bot API is an HTTP-based interface created for developers keen on building bots for Telegram.
To learn how to create and set up a bot, please consult our Introduction to Bots and Bot FAQ.

+
+

Recent changes

+
+

Subscribe to @BotNews to be the first to know about the latest updates and join the discussion in @BotTalk

+
+

November 22, 2026

+

Bot API 10.5

+

Bot Settings

+
    +
  • Added the method setMySettings, allowing bots to change their settings, including inline mode settings, privacy mode, the ability to be added to groups, forum topic mode in private chats, and the mode of receiving callback queries.
  • +
  • Added the ability to receive callback queries from buttons in messages sent by the bot with the field inline_message_id instead of the field message in the class CallbackQuery, depending on the parameter callback_query_mode of the method setMySettings.
  • +
  • Added the ability for bots to show the list of topics in a sidebar in private chats with the bot using the parameter has_topic_sidebar of the method setMySettings.
  • +
  • Split out the class BotFullInfo from the class User and changed the return type of the method getMe to BotFullInfo. The fields that were returned only in getMe were removed from the class User.
  • +
  • Added the field active_usernames to the class BotFullInfo, allowing the bot to get the list of all its active usernames.
  • +
  • Added the field inline_query_placeholder to the class BotFullInfo, allowing the bot to get its placeholder for inline queries.
  • +
  • Added the field needs_inline_query_location to the class BotFullInfo, allowing the bot to check whether it requests the location of the user with every inline query.
  • +
  • Added the field has_topic_sidebar to the class BotFullInfo, allowing the bot to check whether topics in private chats with the bot are shown in a sidebar.
  • +
+

General

+
    +
  • Added the ability for bot owners to invite up to 10 users at once to private chats with the bot by pressing the link https://t.me/botinvite/<bot_username>. The bot can send messages to the invited users.
  • +
  • Added the field inviter to the class WriteAccessAllowed for service messages about users invited to the private chat with the bot by the owner of the bot.
  • +
  • Replaced the field text with the field blocks in the classes RichBlockExpandableBlockQuotation and InputRichBlockExpandableBlockQuotation, allowing expandable block quotations to contain arbitrary blocks.
  • +
+

November 9, 2026

+

Bot API 10.4

+

Widgets

+ +

Ephemeral messages

+ +

Quotes from rich messages

+
    +
  • Added the field rich_texts to the class TextQuote for quotes chosen from a RichMessage.
  • +
  • Added the field quote_rich_texts to the class ReplyParameters, allowing bots to quote rich messages.
  • +
+

TON wallet

+ +

Chat share themes

+ +

Gifts

+
    +
  • Added the method getUniqueGift, allowing bots to get information about a unique gift by its name.
  • +
  • Added the method deleteBusinessAccountGift, allowing bots to delete regular gifts owned by a managed business account without receiving Telegram Stars for them.
  • +
+

General

+
    +
  • Allowed users with a Telegram Premium subscription to assign secondary usernames ending with “agent”, “ai”, “app”, “game”, or “gay” to up to 2 owned bots. Such usernames can be suggested in the field suggested_username of the class KeyboardButtonRequestManagedBot.
  • +
  • Added the class RichTextTonAddress representing an address in the TON blockchain in a RichMessage.
  • +
  • Added the type “ton_address” to the class MessageEntity for addresses in the TON blockchain.
  • +
  • Added the type “bank_card_number” to the class MessageEntity for bank card numbers.
  • +
  • Added the parameters custom_description_parse_mode and custom_description_entities to the methods verifyUser and verifyChat.
  • +
  • Added the class PaidMessagesWaived and the field paid_messages_waived to the class Message for service messages about the sender using a link which allows sending messages without paying Telegram Stars.
  • +
  • Added the ability to create links to topics in private chats with the bot in the format https://t.me/<bot_username>/<message_thread_id>. Such a link opens the topic only for the user in the private chat with whom the topic exists.
  • +
+

August 24, 2026

+

Bot API 10.3

+

Rich Messages

+ +

Ephemeral messages

+ +

Reply markup

+ +

General

+ +

July 14, 2026

+

Bot API 10.2

+

Rich Messages

+ +

Ephemeral Messages

+ +

Communities

+
    +
  • Introduced initial support for Communities - several supergroups, channels, and bots linked together around a shared topic or audience.
  • +
  • Added the class Community which represents a community.
  • +
  • Added the class CommunityChatAdded and the field community_chat_added to the class Message.
  • +
  • Added the class CommunityChatRemoved and the field community_chat_removed to the class Message.
  • +
  • Added the field community to the class ChatFullInfo.
  • +
+

General

+
    +
  • Added updates about changes to a user payment subscription, represented by the class BotSubscriptionUpdated and the field subscription in the class Update.
  • +
  • Hardened the security of Mini Apps by disallowing the usage of Mini App methods from origins different from the original Mini App domain. The protection will be automatically enabled for all Mini Apps on July 20, 2026. You can opt-out from the protection through the @BotFather Mini App. If you do so, you acknowledge that it is the responsibility of the bot to ensure that the Mini App has no links to untrusted sites.
  • +
+

See earlier changes »

+

Authorizing your bot

+

Each bot is given a unique authentication token when it is created. The token looks something like 123456:ABC-DEF1234ghIkl-zyx57W2v1u123ew11, but we'll use simply <token> in this document instead. You can learn about obtaining tokens and generating new ones in this document.

+

Making requests

+

All 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>/METHOD_NAME. Like this for example:

+
https://api.telegram.org/bot123456:ABC-DEF1234ghIkl-zyx57W2v1u123ew11/getMe
+

We support GET and POST HTTP methods. We support four ways of passing parameters in Bot API requests:

+
    +
  • URL query string
  • +
  • application/x-www-form-urlencoded
  • +
  • application/json (except for uploading files)
  • +
  • multipart/form-data (use to upload files)
  • +
+

The response contains a JSON object, which always has a Boolean field 'ok' and may have an optional String field 'description' with a human-readable description of the result. If 'ok' equals True, the request was successful and the result of the query can be found in the 'result' field. In case of an unsuccessful request, 'ok' equals False and the error is explained in the 'description'. An Integer 'error_code' field is also returned, but its contents are subject to change in the future. Some errors may also have an optional field 'parameters' of the type ResponseParameters, which can help to automatically handle the error.

+
    +
  • All methods in the Bot API are case-insensitive.
  • +
  • All queries must be made using UTF-8.
  • +
+

Making requests when getting updates

+

If 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 passing parameters. Specify the method to be invoked in the method parameter of the request. It's not possible to know that such a request was successful or get its result.

+
+

Please see our FAQ for examples.

+
+

Using a Local Bot API Server

+

The 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 will be able to:

+
    +
  • Download files without a size limit.
  • +
  • Upload files up to 2000 MB.
  • +
  • Upload files using their local path and the file URI scheme.
  • +
  • Use an HTTP URL for the webhook.
  • +
  • Use any local IP address for the webhook.
  • +
  • Use any port for the webhook.
  • +
  • Set max_webhook_connections up to 100000.
  • +
  • Receive the absolute local path as a value of the file_path field without the need to download the file after a getFile request.
  • +
+

Do I need a Local Bot API Server

+

The 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

+

There 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, but they will not be kept longer than 24 hours.

+

Regardless of which option you choose, you will receive JSON-serialized Update objects as a result.

+

Update

+

This object represents an incoming update.
At most one of the optional fields can be present in any given update.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
update_idIntegerThe update's unique identifier. Update identifiers start from a certain positive number and increase sequentially. This identifier becomes especially handy if you're using webhooks, since it allows you to ignore repeated updates or to restore the correct update sequence, should they get out of order. If there are no new updates for at least a week, then the identifier of the next update will be chosen randomly instead of sequentially.
messageMessageOptional. New incoming message of any kind - text, photo, sticker, etc.
edited_messageMessageOptional. New version of a message that is known to the bot and was edited. This update may at times be triggered by changes to message fields that are either unavailable or not actively used by your bot.
channel_postMessageOptional. New incoming channel post of any kind - text, photo, sticker, etc.
edited_channel_postMessageOptional. New version of a channel post that is known to the bot and was edited. This update may at times be triggered by changes to message fields that are either unavailable or not actively used by your bot.
business_connectionBusinessConnectionOptional. The bot was connected to or disconnected from a business account, or a user edited an existing connection with the bot
business_messageMessageOptional. New message from a connected business account
edited_business_messageMessageOptional. New version of a message from a connected business account
deleted_business_messagesBusinessMessagesDeletedOptional. Messages were deleted from a connected business account
guest_messageMessageOptional. New guest message. The bot can use the field Message.guest_query_id and the method answerGuestQuery to send a message in response.
message_reactionMessageReactionUpdatedOptional. A reaction to a message was changed by a user. The bot must be an administrator in the chat and must explicitly specify "message_reaction" in the list of allowed_updates to receive these updates. The update isn't received for reactions set by bots.
message_reaction_countMessageReactionCountUpdatedOptional. Reactions to a message with anonymous reactions were changed. The bot must be an administrator in the chat and must explicitly specify "message_reaction_count" in the list of allowed_updates to receive these updates. The updates are grouped and can be sent with a delay of up to a few minutes.
inline_queryInlineQueryOptional. New incoming inline query
chosen_inline_resultChosenInlineResultOptional. The result of an inline query that was chosen by a user and sent to their chat partner. Please see our documentation on the feedback collecting for details on how to enable these updates for your bot. The updates can also be enabled using the parameter inline_feedback_share_denominator of the method setMySettings.
callback_queryCallbackQueryOptional. New incoming callback query
widget_queryWidgetQueryOptional. New incoming query from a widget in a message sent by the bot or via the bot
shared_widget_querySharedWidgetQueryOptional. New incoming query from a forwarded message with a shared widget
shipping_queryShippingQueryOptional. New incoming shipping query. Only for invoices with flexible price.
pre_checkout_queryPreCheckoutQueryOptional. New incoming pre-checkout query. Contains full information about checkout.
purchased_paid_mediaPaidMediaPurchasedOptional. A user purchased paid media with a non-empty payload sent by the bot in a non-channel chat
pollPollOptional. New poll state. Bots receive only updates about manually stopped polls and polls which are sent by the bot.
poll_answerPollAnswerOptional. A user changed their answer in a non-anonymous poll. Bots receive new votes only in polls that were sent by the bot itself.
my_chat_memberChatMemberUpdatedOptional. The bot's chat member status was updated in a chat. For private chats, this update is received only when the bot is blocked or unblocked by the user.
chat_memberChatMemberUpdatedOptional. A chat member's status was updated in a chat. The bot must be an administrator in the chat and must explicitly specify "chat_member" in the list of allowed_updates to receive these updates.
chat_join_requestChatJoinRequestOptional. A request to join the chat has been sent. The bot must have the can_invite_users administrator right in the chat to receive these updates.
chat_boostChatBoostUpdatedOptional. A chat boost was added or changed. The bot must be an administrator in the chat to receive these updates.
removed_chat_boostChatBoostRemovedOptional. A boost was removed from a chat. The bot must be an administrator in the chat to receive these updates.
managed_botManagedBotUpdatedOptional. A new bot was created to be managed by the bot, or the token or owner of a managed bot was changed
subscriptionBotSubscriptionUpdatedOptional. User payment subscription has changed
stopped_message_generationMessageGenerationStoppedOptional. A user asked the bot to stop the generation of a message
+

getUpdates

+

Use this method to receive incoming updates using long polling (wiki). Returns an Array of Update objects.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ParameterTypeRequiredDescription
offsetIntegerOptionalIdentifier of the first update to be returned. Must be greater by one than the highest among the identifiers of previously received updates. By default, updates starting with the earliest unconfirmed update are returned. An update is considered confirmed as soon as getUpdates is called with an offset higher than its update_id. The negative offset can be specified to retrieve updates starting from -offset update from the end of the updates queue. All previous updates will be forgotten.
limitIntegerOptionalLimits the number of updates to be retrieved. Values between 1-100 are accepted. Defaults to 100.
timeoutIntegerOptionalTimeout in seconds for long polling. Defaults to 0, i.e. usual short polling. Should be positive; short polling should be used for testing purposes only.
allowed_updatesArray of StringOptionalA JSON-serialized list of the update types you want your bot to receive. For example, specify ["message", "edited_channel_post", "callback_query"] to only receive updates of these types. See Update for a complete list of available update types. Specify an empty list to receive all update types except chat_member, message_reaction, and message_reaction_count (default). If not specified, the previous setting will be used.

Please note that this parameter doesn't affect updates created before the call to getUpdates, so unwanted updates may be received for a short period of time.
+
+

Notes
1. This method will not work if an outgoing webhook is set up.
2. In order to avoid getting duplicate updates, recalculate offset after each server response.

+
+

setWebhook

+

Use 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 Update. In case of an unsuccessful request (a request with response HTTP status code different from 2XY), we will repeat the request and give up after a reasonable number of attempts. Returns True on success.

+

If you'd like to make sure that the webhook was set by you, you can specify secret data in the parameter secret_token. If specified, the request will contain a header “X-Telegram-Bot-Api-Secret-Token” with the secret token as content.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ParameterTypeRequiredDescription
urlStringYesHTTPS URL to send updates to. Use an empty string to remove webhook integration.
certificateInputFileOptionalUpload your public key certificate so that the root certificate in use can be checked. See our self-signed guide for details.
ip_addressStringOptionalThe fixed IP address which will be used to send webhook requests instead of the IP address resolved through DNS
max_connectionsIntegerOptionalThe maximum allowed number of simultaneous HTTPS connections to the webhook for update delivery, 1-100. Defaults to 40. Use lower values to limit the load on your bot's server, and higher values to increase your bot's throughput.
allowed_updatesArray of StringOptionalA JSON-serialized list of the update types you want your bot to receive. For example, specify ["message", "edited_channel_post", "callback_query"] to only receive updates of these types. See Update for a complete list of available update types. Specify an empty list to receive all update types except chat_member, message_reaction, and message_reaction_count (default). If not specified, the previous setting will be used.
Please note that this parameter doesn't affect updates created before the call to setWebhook, so unwanted updates may be received for a short period of time.
drop_pending_updatesBooleanOptionalPass True to drop all pending updates
secret_tokenStringOptionalA secret token to be sent in a header “X-Telegram-Bot-Api-Secret-Token” in every webhook request, 1-256 characters. Only characters A-Z, a-z, 0-9, _ and - are allowed. The header is useful to ensure that the request comes from a webhook set by you.
+
+

Notes
1. You will not be able to receive updates using getUpdates for as long as an outgoing webhook is set up.
2. To use a self-signed certificate, you need to upload your public key certificate using the certificate parameter. Please upload it as InputFile; sending a String will not work.
3. Ports currently supported for webhooks: 443, 80, 88, 8443.

+

If you're having any trouble setting up webhooks, please check out this amazing guide to webhooks.

+
+

deleteWebhook

+

Use this method to remove webhook integration if you decide to switch back to getUpdates. Returns True on success.

+ + + + + + + + + + + + + + + + + +
ParameterTypeRequiredDescription
drop_pending_updatesBooleanOptionalPass True to drop all pending updates
+

getWebhookInfo

+

Use this method to get the current webhook status. Requires no parameters. On success, returns a WebhookInfo object. If the bot is using getUpdates, it will return an object with the url field empty.

+

WebhookInfo

+

Describes the current status of a webhook.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
urlStringWebhook URL, may be empty if webhook is not set up
has_custom_certificateBooleanTrue, if a custom certificate was provided for webhook certificate checks
pending_update_countIntegerNumber of updates awaiting delivery
ip_addressStringOptional. Currently used webhook IP address
last_error_dateIntegerOptional. Unix time for the most recent error that happened when trying to deliver an update via webhook
last_error_messageStringOptional. Error message in human-readable format for the most recent error that happened when trying to deliver an update via webhook
last_synchronization_error_dateIntegerOptional. Unix time of the most recent error that happened when trying to synchronize available updates with Telegram datacenters
max_connectionsIntegerOptional. The maximum allowed number of simultaneous HTTPS connections to the webhook for update delivery
allowed_updatesArray of StringOptional. A list of update types the bot is subscribed to. Defaults to all update types except chat_member, message_reaction, and message_reaction_count.
+

Available types

+

All types used in the Bot API responses are represented as JSON objects.

+

It is safe to use 32-bit signed integers for storing all Integer fields unless otherwise noted.

+
+

Optional fields may not be returned when irrelevant.

+
+

BotFullInfo

+

This object contains full information about the bot itself.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
idIntegerUnique identifier for this bot. This number may have more than 32 significant bits and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a 64-bit integer or double-precision float type is safe for storing this identifier.
is_botTrueAlways True
first_nameStringBot's first name
usernameStringOptional. Bot's username
active_usernamesArray of StringOptional. If non-empty, the list of all active usernames of the bot
can_join_groupsBooleanTrue, if the bot can be added to groups
can_read_all_group_messagesBooleanTrue, if privacy mode is disabled for the bot
supports_guest_queriesBooleanTrue, if the bot supports guest queries from chats it is not a member of
supports_inline_queriesBooleanTrue, if the bot supports inline queries
inline_query_placeholderStringOptional. Placeholder for inline queries, which is shown in the input field after the bot's username; omitted if the default placeholder is used
needs_inline_query_locationBooleanTrue, if the bot requests the location of the user with every inline query
can_connect_to_businessBooleanTrue, if the bot can be connected to a user account to manage it
has_main_web_appBooleanTrue, if the bot has a main Web App
has_topics_enabledBooleanTrue, if the bot has forum topic mode enabled in private chats
allows_users_to_create_topicsBooleanTrue, if the bot allows users to create and delete topics in private chats
has_topic_sidebarBooleanTrue, if topics in private chats with the bot are shown in a sidebar
can_manage_botsBooleanTrue, if other bots can be created to be controlled by the bot
supports_join_request_queriesBooleanTrue, if the bot supports join request queries and can be assigned to process them
+

User

+

This object represents a Telegram user or bot.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
idIntegerUnique identifier for this user or bot. This number may have more than 32 significant bits and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a 64-bit integer or double-precision float type is safe for storing this identifier.
is_botBooleanTrue, if this user is a bot
first_nameStringUser's or bot's first name
last_nameStringOptional. User's or bot's last name
usernameStringOptional. User's or bot's username
language_codeStringOptional. IETF language tag of the user's language
is_premiumTrueOptional. True, if this user is a Telegram Premium user
added_to_attachment_menuTrueOptional. True, if this user added the bot to the attachment menu
+

Chat

+

This object represents a chat.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
idIntegerUnique identifier for this chat. This number may have more than 32 significant bits and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a signed 64-bit integer or double-precision float type is safe for storing this identifier.
typeStringType of the chat, can be either “private”, “group”, “supergroup” or “channel”
titleStringOptional. Title, for supergroups, channels and group chats
usernameStringOptional. Username, for private chats, supergroups and channels if available
first_nameStringOptional. First name of the other party in a private chat
last_nameStringOptional. Last name of the other party in a private chat
is_forumTrueOptional. True, if the supergroup chat is a forum (has topics enabled)
is_direct_messagesTrueOptional. True, if the chat is the direct messages chat of a channel
+

ChatFullInfo

+

This object contains full information about a chat.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
idIntegerUnique identifier for this chat. This number may have more than 32 significant bits and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a signed 64-bit integer or double-precision float type is safe for storing this identifier.
typeStringType of the chat, can be either “private”, “group”, “supergroup” or “channel”
titleStringOptional. Title, for supergroups, channels and group chats
usernameStringOptional. Username, for private chats, supergroups and channels if available
first_nameStringOptional. First name of the other party in a private chat
last_nameStringOptional. Last name of the other party in a private chat
is_forumTrueOptional. True, if the supergroup chat is a forum (has topics enabled)
is_direct_messagesTrueOptional. True, if the chat is the direct messages chat of a channel
accent_color_idIntegerIdentifier of the accent color for the chat name and backgrounds of the chat photo, reply header, and link preview. See accent colors for more details.
max_reaction_countIntegerThe maximum number of reactions that can be set on a message in the chat
photoChatPhotoOptional. Chat photo
active_usernamesArray of StringOptional. If non-empty, the list of all active chat usernames; for private chats, supergroups and channels
birthdateBirthdateOptional. For private chats, the date of birth of the user
business_introBusinessIntroOptional. For private chats with business accounts, the intro of the business
business_locationBusinessLocationOptional. For private chats with business accounts, the location of the business
business_opening_hoursBusinessOpeningHoursOptional. For private chats with business accounts, the opening hours of the business
personal_chatChatOptional. For private chats, the personal channel of the user
parent_chatChatOptional. Information about the corresponding channel chat; for direct messages chats only
available_reactionsArray of ReactionTypeOptional. List of available reactions allowed in the chat. If omitted, then all emoji reactions are allowed.
background_custom_emoji_idStringOptional. Custom emoji identifier of the emoji chosen by the chat for the reply header and link preview background
profile_accent_color_idIntegerOptional. Identifier of the accent color for the chat's profile background. See profile accent colors for more details.
profile_background_custom_emoji_idStringOptional. Custom emoji identifier of the emoji chosen by the chat for its profile background
emoji_status_custom_emoji_idStringOptional. Custom emoji identifier of the emoji status of the chat or the other party in a private chat
emoji_status_expiration_dateIntegerOptional. Expiration date of the emoji status of the chat or the other party in a private chat, in Unix time, if any
bioStringOptional. Bio of the other party in a private chat
has_private_forwardsTrueOptional. True, if the privacy settings of the other party in the private chat allow using tg://user?id=<user_id> links only in chats with the user
has_restricted_voice_and_video_messagesTrueOptional. True, if the privacy settings of the other party restrict sending voice and video note messages in the private chat
join_to_send_messagesTrueOptional. True, if users need to join the supergroup before they can send messages
join_by_requestTrueOptional. True, if all users directly joining the supergroup without using an invite link need to be approved by supergroup administrators
descriptionStringOptional. Description, for groups, supergroups and channel chats
invite_linkStringOptional. Primary invite link, for groups, supergroups and channel chats
pinned_messageMessageOptional. The most recent pinned message (by sending date)
permissionsChatPermissionsOptional. Default chat member permissions, for groups and supergroups
accepted_gift_typesAcceptedGiftTypesInformation about types of gifts that are accepted by the chat or by the corresponding user for private chats
can_send_paid_mediaTrueOptional. True, if paid media messages can be sent or forwarded to the channel chat. The field is available only for channel chats.
slow_mode_delayIntegerOptional. For supergroups, the minimum allowed delay between consecutive messages sent by each unprivileged user; in seconds
unrestrict_boost_countIntegerOptional. For supergroups, the minimum number of boosts that a non-administrator user needs to add in order to ignore slow mode and chat permissions
message_auto_delete_timeIntegerOptional. The time after which all messages sent to the chat will be automatically deleted; in seconds
has_aggressive_anti_spam_enabledTrueOptional. True, if aggressive anti-spam checks are enabled in the supergroup. The field is only available to chat administrators.
has_hidden_membersTrueOptional. True, if non-administrators can only get the list of bots and administrators in the chat
has_protected_contentTrueOptional. True, if messages from the chat can't be forwarded to other chats
has_visible_historyTrueOptional. True, if new chat members will have access to old messages; available only to chat administrators
sticker_set_nameStringOptional. For supergroups, name of the group sticker set
can_set_sticker_setTrueOptional. True, if the bot can change the group sticker set
custom_emoji_sticker_set_nameStringOptional. For supergroups, the name of the group's custom emoji sticker set. Custom emoji from this set can be used by all users and bots in the group.
linked_chat_idIntegerOptional. Unique identifier for the linked chat, i.e. the discussion group identifier for a channel and vice versa; for supergroups and channel chats. This identifier may be greater than 32 bits and some programming languages may have difficulty/silent defects in interpreting it. But it is smaller than 52 bits, so a signed 64-bit integer or double-precision float type is safe for storing this identifier.
locationChatLocationOptional. For supergroups, the location to which the supergroup is connected
ratingUserRatingOptional. For private chats, the rating of the user if any
first_profile_audioAudioOptional. For private chats, the first audio added to the profile of the user
unique_gift_colorsUniqueGiftColorsOptional. The color scheme based on a unique gift that must be used for the chat's name, message replies and link previews
paid_message_star_countIntegerOptional. The number of Telegram Stars a general user has to pay to send a message to the chat
guard_botUserOptional. The bot that processes join request queries in the chat. The field is only available to chat administrators.
communityCommunityOptional. The Community to which the chat belongs
ton_wallet_cardTonWalletCardOptional. For private chats, the TON wallet card of the user, which is shown on their profile page
share_themeChatShareThemeOptional. For private chats, supergroups and channels, the theme of the screen for sharing a link to the user or the chat; omitted if the default theme is used
+

Message

+

This object represents a message.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
message_idIntegerUnique message identifier inside this chat; 0 for ephemeral messages. In specific instances (e.g., a message containing a video sent to a big chat), the server might automatically schedule a message instead of sending it immediately. In such cases, this field will be 0 and the relevant message will be unusable until it is actually sent.
message_thread_idIntegerOptional. Unique identifier of a message thread or forum topic to which the message belongs; for supergroups and private chats only
direct_messages_topicDirectMessagesTopicOptional. Information about the direct messages chat topic that contains the message
fromUserOptional. Sender of the message; may be empty for messages sent to channels. For backward compatibility, if the message was sent on behalf of a chat, the field contains a fake sender user in non-channel chats.
sender_chatChatOptional. Sender of the message when sent on behalf of a chat. For example, the supergroup itself for messages sent by its anonymous administrators or a linked channel for messages automatically forwarded to the channel's discussion group. For backward compatibility, if the message was sent on behalf of a chat, the field from contains a fake sender user in non-channel chats.
sender_boost_countIntegerOptional. If the sender of the message boosted the chat, the number of boosts added by the user
sender_business_botUserOptional. The bot that actually sent the message on behalf of the business account. Available only for outgoing messages sent on behalf of the connected business account.
sender_tagStringOptional. Tag or custom title of the sender of the message; for supergroups only
receiver_userUserOptional. For ephemeral messages, the user who received the message
ephemeral_message_idIntegerOptional. For ephemeral messages, identifier of the ephemeral message inside this chat. The identifier may be reused for another ephemeral message after the message is deleted or expires.
dateIntegerDate the message was sent in Unix time. It is always a positive number, representing a valid date.
guest_query_idStringOptional. The unique identifier for the guest query. Use this identifier with the method answerGuestQuery to send a response message. If non-empty, the message belongs to the chat where the guest bot was summoned, which may not coincide with other existing bot chats sharing the same identifier.
business_connection_idStringOptional. Unique identifier of the business connection from which the message was received. If non-empty, the message belongs to a chat of the corresponding business account that is independent from any potential bot chat which might share the same identifier.
chatChatChat the message belongs to
forward_originMessageOriginOptional. Information about the original message for forwarded messages
is_topic_messageTrueOptional. True, if the message is sent to a topic in a forum supergroup or a private chat with the bot
is_automatic_forwardTrueOptional. True, if the message is a channel post that was automatically forwarded to the connected discussion group
reply_to_messageMessageOptional. For replies in the same chat and message thread, the original message. Note that the Message object in this field will not contain further reply_to_message fields even if it itself is a reply. If the message is a reply to an ephemeral message, then this field may be omitted.
external_replyExternalReplyInfoOptional. Information about the message that is being replied to, which may come from another chat or forum topic
quoteTextQuoteOptional. For replies that quote part of the original message, the quoted part of the message
reply_to_storyStoryOptional. For replies to a story, the original story
reply_to_checklist_task_idIntegerOptional. Identifier of the specific checklist task that is being replied to
reply_to_poll_option_idStringOptional. Persistent identifier of the specific poll option that is being replied to
via_botUserOptional. Bot through which the message was sent
guest_bot_caller_userUserOptional. For a message sent by a guest bot, this is the user whose original message triggered the bot's response
guest_bot_caller_chatChatOptional. For a message sent by a guest bot, this is the chat whose original message triggered the bot's response
edit_dateIntegerOptional. Date the message was last edited in Unix time
has_protected_contentTrueOptional. True, if the message can't be forwarded
is_from_offlineTrueOptional. True, if the message was sent by an implicit action, for example, as an away or a greeting business message, or as a scheduled message
is_paid_postTrueOptional. True, if the message is a paid post. Note that such posts must not be deleted for 24 hours to receive the payment and can't be edited.
media_group_idStringOptional. The unique identifier inside this chat of a media message group this message belongs to
author_signatureStringOptional. Signature of the post author for messages in channels, or the custom title of an anonymous group administrator
paid_star_countIntegerOptional. The number of Telegram Stars that were paid by the sender of the message to send it
textStringOptional. For text messages, the actual UTF-8 text of the message
entitiesArray of MessageEntityOptional. For text messages, special entities like usernames, URLs, bot commands, etc. that appear in the text
link_preview_optionsLinkPreviewOptionsOptional. Options used for link preview generation for the message, if it is a text message and link preview options were changed
suggested_post_infoSuggestedPostInfoOptional. Information about suggested post parameters if the message is a suggested post in a channel direct messages chat. If the message is an approved or declined suggested post, then it can't be edited.
effect_idStringOptional. Unique identifier of the message effect added to the message
rich_messageRichMessageOptional. Message is a rich formatted message
animationAnimationOptional. Message is an animation, information about the animation. For backward compatibility, when this field is set, the document field will also be set.
audioAudioOptional. Message is an audio file, information about the file
documentDocumentOptional. Message is a general file, information about the file
live_photoLivePhotoOptional. Message is a live photo, information about the live photo. For backward compatibility, when this field is set, the photo field will also be set.
paid_mediaPaidMediaInfoOptional. Message contains paid media; information about the paid media
photoArray of PhotoSizeOptional. Message is a photo, available sizes of the photo
stickerStickerOptional. Message is a sticker, information about the sticker
storyStoryOptional. Message is a forwarded story
videoVideoOptional. Message is a video, information about the video
video_noteVideoNoteOptional. Message is a video note, information about the video message
voiceVoiceOptional. Message is a voice message, information about the file
widgetWidgetOptional. Message is an HTML widget, information about the widget
captionStringOptional. Caption for the animation, audio, document, live photo, paid media, photo, video, voice, or widget
caption_entitiesArray of MessageEntityOptional. For messages with a caption, special entities like usernames, URLs, bot commands, etc. that appear in the caption
show_caption_above_mediaTrueOptional. True, if the caption must be shown above the message media or the widget
has_media_spoilerTrueOptional. True, if the message media is covered by a spoiler animation
checklistChecklistOptional. Message is a checklist
contactContactOptional. Message is a shared contact, information about the contact
diceDiceOptional. Message is a dice with random value
gameGameOptional. Message is a game, information about the game. More about games »
pollPollOptional. Message is a native poll, information about the poll
venueVenueOptional. Message is a venue, information about the venue. For backward compatibility, when this field is set, the location field will also be set.
locationLocationOptional. Message is a shared location, information about the location
new_chat_membersArray of UserOptional. New members that were added to the group or supergroup and information about them (the bot itself may be one of these members)
left_chat_memberUserOptional. A member was removed from the group, information about them (this member may be the bot itself)
chat_owner_leftChatOwnerLeftOptional. Service message: chat owner has left
chat_owner_changedChatOwnerChangedOptional. Service message: chat owner has changed
new_chat_titleStringOptional. A chat title was changed to this value
new_chat_photoArray of PhotoSizeOptional. A chat photo was changed to this value
delete_chat_photoTrueOptional. Service message: the chat photo was deleted
group_chat_createdTrueOptional. Service message: the group has been created
supergroup_chat_createdTrueOptional. Service message: the supergroup has been created. This field can't be received in a message coming through updates, because a bot can't be a member of a supergroup when it is created. It can only be found in reply_to_message if someone replies to the very first message in a directly created supergroup.
channel_chat_createdTrueOptional. Service message: the channel has been created. This field can't be received in a message coming through updates, because a bot can't be a member of a channel when it is created. It can only be found in reply_to_message if someone replies to the very first message in a channel.
message_auto_delete_timer_changedMessageAutoDeleteTimerChangedOptional. Service message: auto-delete timer settings changed in the chat
migrate_to_chat_idIntegerOptional. The group has been migrated to a supergroup with the specified identifier. This number may have more than 32 significant bits and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a signed 64-bit integer or double-precision float type is safe for storing this identifier.
migrate_from_chat_idIntegerOptional. The supergroup has been migrated from a group with the specified identifier. This number may have more than 32 significant bits and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a signed 64-bit integer or double-precision float type is safe for storing this identifier.
pinned_messageMaybeInaccessibleMessageOptional. Specified message was pinned. Note that the Message object in this field will not contain further reply_to_message fields even if it itself is a reply.
invoiceInvoiceOptional. Message is an invoice for a payment, information about the invoice. More about payments »
successful_paymentSuccessfulPaymentOptional. Message is a service message about a successful payment, information about the payment. More about payments »
refunded_paymentRefundedPaymentOptional. Message is a service message about a refunded payment, information about the payment. More about payments »
users_sharedUsersSharedOptional. Service message: users were shared with the bot
chat_sharedChatSharedOptional. Service message: a chat was shared with the bot
giftGiftInfoOptional. Service message: a regular gift was sent or received
unique_giftUniqueGiftInfoOptional. Service message: a unique gift was sent or received
gift_upgrade_sentGiftInfoOptional. Service message: upgrade of a gift was purchased after the gift was sent
connected_websiteStringOptional. The domain name of the website on which the user has logged in. More about Telegram Login »
write_access_allowedWriteAccessAllowedOptional. Service message: the user allowed the bot to write messages after adding it to the attachment or side menu, launching a Web App from a link, or accepting an explicit request from a Web App sent by the method requestWriteAccess, or the user was invited to the private chat with the bot by the owner of the bot
passport_dataPassportDataOptional. Telegram Passport data
proximity_alert_triggeredProximityAlertTriggeredOptional. Service message: a user in the chat triggered another user's proximity alert while sharing Live Location
boost_addedChatBoostAddedOptional. Service message: user boosted the chat
chat_background_setChatBackgroundOptional. Service message: chat background set
checklist_tasks_doneChecklistTasksDoneOptional. Service message: some tasks in a checklist were marked as done or not done
checklist_tasks_addedChecklistTasksAddedOptional. Service message: tasks were added to a checklist
community_chat_addedCommunityChatAddedOptional. Service message: chat or bot added to a Community
community_chat_joinedCommunityChatJoinedOptional. Service message: chat was joined by a user from a Community
community_chat_removedCommunityChatRemovedOptional. Service message: chat or bot removed from a Community
direct_message_price_changedDirectMessagePriceChangedOptional. Service message: the price for paid messages in the corresponding direct messages chat of a channel has changed
forum_topic_createdForumTopicCreatedOptional. Service message: forum topic created
forum_topic_editedForumTopicEditedOptional. Service message: forum topic edited
forum_topic_closedForumTopicClosedOptional. Service message: forum topic closed
forum_topic_reopenedForumTopicReopenedOptional. Service message: forum topic reopened
general_forum_topic_hiddenGeneralForumTopicHiddenOptional. Service message: the 'General' forum topic hidden
general_forum_topic_unhiddenGeneralForumTopicUnhiddenOptional. Service message: the 'General' forum topic unhidden
giveaway_createdGiveawayCreatedOptional. Service message: a scheduled giveaway was created
giveawayGiveawayOptional. The message is a scheduled giveaway message
giveaway_winnersGiveawayWinnersOptional. A giveaway with public winners was completed
giveaway_completedGiveawayCompletedOptional. Service message: a giveaway without public winners was completed
managed_bot_createdManagedBotCreatedOptional. Service message: user created a bot that will be managed by the current bot
paid_message_price_changedPaidMessagePriceChangedOptional. Service message: the price for paid messages has changed in the chat
paid_messages_waivedPaidMessagesWaivedOptional. Service message: the sender of the message used a link of the other user, which allows sending messages to the user without paying Telegram Stars
poll_option_addedPollOptionAddedOptional. Service message: answer option was added to a poll
poll_option_deletedPollOptionDeletedOptional. Service message: answer option was deleted from a poll
suggested_post_approvedSuggestedPostApprovedOptional. Service message: a suggested post was approved
suggested_post_approval_failedSuggestedPostApprovalFailedOptional. Service message: approval of a suggested post has failed
suggested_post_declinedSuggestedPostDeclinedOptional. Service message: a suggested post was declined
suggested_post_paidSuggestedPostPaidOptional. Service message: payment for a suggested post was received
suggested_post_refundedSuggestedPostRefundedOptional. Service message: payment for a suggested post was refunded
ton_wallet_transferTonWalletTransferOptional. Service message: a transfer with a TON wallet
video_chat_scheduledVideoChatScheduledOptional. Service message: video chat scheduled
video_chat_startedVideoChatStartedOptional. Service message: video chat started
video_chat_endedVideoChatEndedOptional. Service message: video chat ended
video_chat_participants_invitedVideoChatParticipantsInvitedOptional. Service message: new participants invited to a video chat
web_app_dataWebAppDataOptional. Service message: data sent by a Web App
reply_markupInlineKeyboardMarkupOptional. Inline keyboard attached to the message. login_url buttons are represented as ordinary url buttons.
+

MessageId

+

This object represents a unique message identifier.

+ + + + + + + + + + + + + + + +
FieldTypeDescription
message_idIntegerUnique message identifier. In specific instances (e.g., a message containing a video sent to a big chat), the server might automatically schedule a message instead of sending it immediately. In such cases, this field will be 0 and the relevant message will be unusable until it is actually sent.
+

InaccessibleMessage

+

This object describes a message that was deleted or is otherwise inaccessible to the bot.

+ + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
chatChatChat the message belonged to
message_idIntegerUnique message identifier inside the chat
dateIntegerAlways 0. The field can be used to differentiate regular and inaccessible messages.
+

MaybeInaccessibleMessage

+

This object describes a message that can be inaccessible to the bot. It can be one of

+ +

MessageEntity

+

This object represents one special entity in a text message. For example, hashtags, usernames, URLs, etc.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
typeStringType of the entity. Currently, can be “mention” (@username), “hashtag” (#hashtag or #hashtag@chatusername), “cashtag” ($USD or $USD@chatusername), “bot_command” (/start@jobs_bot), “url” (https://telegram.org), “email” (do-not-reply@telegram.org), “phone_number” (+1-212-555-0123), “bank_card_number” (bank card number), “ton_address” (address in the TON blockchain), “bold” (bold text), “italic” (italic text), “underline” (underlined text), “strikethrough” (strikethrough text), “spoiler” (spoiler message), “blockquote” (block quotation), “expandable_blockquote” (collapsed-by-default block quotation), “code” (monowidth string), “pre” (monowidth block), “text_link” (for clickable text URLs), “text_mention” (for users without usernames), “custom_emoji” (for inline custom emoji stickers), or “date_time” (for formatted date and time).
offsetIntegerOffset in UTF-16 code units to the start of the entity
lengthIntegerLength of the entity in UTF-16 code units
urlStringOptional. For “text_link” only, URL that will be opened after the user taps on the text
userUserOptional. For “text_mention” only, the mentioned user
languageStringOptional. For “pre” only, the programming language of the entity text
custom_emoji_idStringOptional. For “custom_emoji” only, unique identifier of the custom emoji. Use getCustomEmojiStickers to get full information about the sticker.
unix_timeIntegerOptional. For “date_time” only, the Unix time associated with the entity
date_time_formatStringOptional. For “date_time” only, the string that defines the formatting of the date and time. See date-time entity formatting for more details.
+

TextQuote

+

This object contains information about the quoted part of a message that is replied to by the given message.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
textStringText of the quoted part of a message that is replied to by the given message; may be empty if the quote was chosen from a rich message
entitiesArray of MessageEntityOptional. Special entities that appear in the quote. Currently, only bold, italic, underline, strikethrough, spoiler, custom_emoji, and date_time entities are kept in quotes.
rich_textsArray of RichTextOptional. Rich text of the quote if it was chosen from a rich message. May contain only plain text, RichTextBold, RichTextItalic, RichTextUnderline, RichTextStrikethrough, RichTextSpoiler, RichTextSubscript, RichTextSuperscript, RichTextDateTime, RichTextCustomEmoji, RichTextMathematicalExpression, and arrays of them.
positionIntegerApproximate quote position in the original message in UTF-16 code units as specified by the sender. For quotes from rich messages, it is the position in the text formed by joining plain texts of all quotable texts of the message, separated by line feeds.
is_manualTrueOptional. True, if the quote was chosen manually by the message sender. Otherwise, the quote was added automatically by the server.
+

ExternalReplyInfo

+

This object contains information about a message that is being replied to, which may come from another chat or forum topic.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
originMessageOriginOrigin of the message replied to by the given message
chatChatOptional. Chat the original message belongs to. Available only if the chat is a supergroup or a channel.
message_idIntegerOptional. Unique message identifier inside the original chat. Available only if the original chat is a supergroup or a channel.
link_preview_optionsLinkPreviewOptionsOptional. Options used for link preview generation for the original message, if it is a text message
animationAnimationOptional. Message is an animation, information about the animation
audioAudioOptional. Message is an audio file, information about the file
documentDocumentOptional. Message is a general file, information about the file
live_photoLivePhotoOptional. Message is a live photo, information about the live photo
paid_mediaPaidMediaInfoOptional. Message contains paid media; information about the paid media
photoArray of PhotoSizeOptional. Message is a photo, available sizes of the photo
stickerStickerOptional. Message is a sticker, information about the sticker
storyStoryOptional. Message is a forwarded story
videoVideoOptional. Message is a video, information about the video
video_noteVideoNoteOptional. Message is a video note, information about the video message
voiceVoiceOptional. Message is a voice message, information about the file
widgetWidgetOptional. Message is an HTML widget, information about the widget
has_media_spoilerTrueOptional. True, if the message media is covered by a spoiler animation
checklistChecklistOptional. Message is a checklist
contactContactOptional. Message is a shared contact, information about the contact
diceDiceOptional. Message is a dice with random value
gameGameOptional. Message is a game, information about the game. More about games »
giveawayGiveawayOptional. Message is a scheduled giveaway, information about the giveaway
giveaway_winnersGiveawayWinnersOptional. A giveaway with public winners was completed
invoiceInvoiceOptional. Message is an invoice for a payment, information about the invoice. More about payments »
locationLocationOptional. Message is a shared location, information about the location
pollPollOptional. Message is a native poll, information about the poll
venueVenueOptional. Message is a venue, information about the venue
+

ReplyParameters

+

Describes reply parameters for the message that is being sent.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
message_idIntegerOptional. Identifier of the message that will be replied to in the current chat, or in the chat chat_id if it is specified. Required if ephemeral_message_id isn't specified.
chat_idInteger or StringOptional. If the message to be replied to is from a different chat, unique identifier for the chat or username of the bot, supergroup, or channel in the format @username. Not supported for messages sent on behalf of a business account, messages from channel direct messages chats and ephemeral messages.
ephemeral_message_idIntegerOptional. Identifier of the incoming ephemeral message that will be replied to in the current chat. A reply to an ephemeral message must itself be an ephemeral message. An ephemeral message may only be replied to within 15 seconds of being sent. Required if message_id isn't specified.
allow_sending_without_replyBooleanOptional. Pass True if the message should be sent even if the specified message to be replied to is not found. Always False for replies in another chat or forum topic, and sent ephemeral messages. Always True for messages sent on behalf of a business account.
quoteStringOptional. Quoted part of the message to be replied to; 0-1024 characters after entities parsing. The quote must be an exact substring of the message to be replied to, including bold, italic, underline, strikethrough, spoiler, custom_emoji, and date_time entities. The message will fail to send if the quote isn't found in the original message. Ignored for ephemeral messages.
quote_parse_modeStringOptional. Mode for parsing entities in the quote. See formatting options for more details.
quote_entitiesArray of MessageEntityOptional. A JSON-serialized list of special entities that appear in the quote. It can be specified instead of quote_parse_mode.
quote_rich_textsArray of RichTextOptional. A JSON-serialized list of quoted parts of the rich message to be replied to. Must contain one element for each quoted text of the message in the order of their appearance. Each of the following is a separate quoted text: the text of a paragraph, a heading, a preformatted block, a footer, or a mathematical expression; the text and the credit of a block quotation or a pull quotation; the summary of a details block; the caption and each cell of a table; the text and the credit of a caption of a media block, a collage, a slideshow, or a map. Texts of blocks nested in lists, block quotations, details, collages, and slideshows are separate quoted texts too. The first and the last elements can contain only a part of the corresponding text; all other elements must contain the whole text. Formatting of the quoted parts must be kept, and rich texts must be nested in the same way as in the message received from the server. Mathematical expressions must be quoted entirely. Buttons in RichBlockButtons, anchors and dividers can't be quoted. Up to 32 quoted texts with a total length of up to 1024 characters can be specified. Only plain text, RichTextBold, RichTextItalic, RichTextUnderline, RichTextStrikethrough, RichTextSpoiler, RichTextSubscript, RichTextSuperscript, RichTextDateTime, RichTextCustomEmoji, RichTextMathematicalExpression, and arrays of them are kept in the quote; other rich text types are replaced with their text. If non-empty, then quote, quote_parse_mode and quote_entities are ignored.
quote_positionIntegerOptional. Position of the quote in the original message in UTF-16 code units. For quotes from rich messages, it is the position in the text formed by joining plain texts of all quotable texts of the message, separated by line feeds.
checklist_task_idIntegerOptional. Identifier of the specific checklist task to be replied to
poll_option_idStringOptional. Persistent identifier of the specific poll option to be replied to
+

EphemeralMessageParameters

+

Describes the parameters of an ephemeral message to be sent.

+ + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
receiver_user_idIntegerOptional. Identifier of the user who will receive the message; required unless the message is sent as an ephemeral reply to a callback query. If omitted, then the parameter chat_id of the method is ignored. If specified together with callback_query_id, then it must be the identifier of the user who pressed the button. Must be omitted for messages sent in chats where the bot isn't a member, unless the message is a reply to an ephemeral message. It is not guaranteed that the user will receive the message, especially if they are offline. See here for more details.
callback_query_idStringOptional. Identifier of the callback query which triggered the message, if any. If specified and receiver_user_id is omitted, then the message is sent as an ephemeral reply to the callback query and will be shown only to the user who pressed the button. Ephemeral replies can't be sent to callback queries from messages in channel direct messages chats. The bot must still answer the callback query using answerCallbackQuery.
replace_callback_query_messageBooleanOptional. Pass True if the ephemeral message must be shown in place of the original message. Must be False for callback queries from ephemeral messages, which must be edited using regular editEphemeralMessage… methods.
+

MessageOrigin

+

This object describes the origin of a message. It can be one of

+ +

MessageOriginUser

+

The message was originally sent by a known user.

+ + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
typeStringType of the message origin, always “user”
dateIntegerDate the message was sent originally in Unix time
sender_userUserUser that sent the message originally
+

MessageOriginHiddenUser

+

The message was originally sent by an unknown user.

+ + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
typeStringType of the message origin, always “hidden_user”
dateIntegerDate the message was sent originally in Unix time
sender_user_nameStringName of the user that sent the message originally
+

MessageOriginChat

+

The message was originally sent on behalf of a chat to a group chat.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
typeStringType of the message origin, always “chat”
dateIntegerDate the message was sent originally in Unix time
sender_chatChatChat that sent the message originally
author_signatureStringOptional. For messages originally sent by an anonymous chat administrator, original message author signature
+

MessageOriginChannel

+

The message was originally sent to a channel chat.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
typeStringType of the message origin, always “channel”
dateIntegerDate the message was sent originally in Unix time
chatChatChannel chat to which the message was originally sent
message_idIntegerUnique message identifier inside the chat
author_signatureStringOptional. Signature of the original post author
+

PhotoSize

+

This object represents one size of a photo or a file / sticker thumbnail.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
file_idStringIdentifier for this file, which can be used to download or reuse the file
file_unique_idStringUnique identifier for this file, which is supposed to be the same over time and for different bots. Can't be used to download or reuse the file.
widthIntegerPhoto width
heightIntegerPhoto height
file_sizeIntegerOptional. File size in bytes
+

Animation

+

This object represents an animation file (GIF or H.264/MPEG-4 AVC video without sound).

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
file_idStringIdentifier for this file, which can be used to download or reuse the file
file_unique_idStringUnique identifier for this file, which is supposed to be the same over time and for different bots. Can't be used to download or reuse the file.
widthIntegerVideo width as defined by the sender
heightIntegerVideo height as defined by the sender
durationIntegerDuration of the video in seconds as defined by the sender
thumbnailPhotoSizeOptional. Animation thumbnail as defined by the sender
file_nameStringOptional. Original animation filename as defined by the sender
mime_typeStringOptional. MIME type of the file as defined by the sender
file_sizeIntegerOptional. File size in bytes. It can be bigger than 2^31 and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a signed 64-bit integer or double-precision float type is safe for storing this value.
+

Audio

+

This object represents an audio file to be treated as music by the Telegram clients.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
file_idStringIdentifier for this file, which can be used to download or reuse the file
file_unique_idStringUnique identifier for this file, which is supposed to be the same over time and for different bots. Can't be used to download or reuse the file.
durationIntegerDuration of the audio in seconds as defined by the sender
performerStringOptional. Performer of the audio as defined by the sender or by audio tags
titleStringOptional. Title of the audio as defined by the sender or by audio tags
file_nameStringOptional. Original filename as defined by the sender
mime_typeStringOptional. MIME type of the file as defined by the sender
file_sizeIntegerOptional. File size in bytes. It can be bigger than 2^31 and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a signed 64-bit integer or double-precision float type is safe for storing this value.
thumbnailPhotoSizeOptional. Thumbnail of the album cover to which the music file belongs
+

Document

+

This object represents a general file (as opposed to photos, voice messages and audio files).

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
file_idStringIdentifier for this file, which can be used to download or reuse the file
file_unique_idStringUnique identifier for this file, which is supposed to be the same over time and for different bots. Can't be used to download or reuse the file.
thumbnailPhotoSizeOptional. Document thumbnail as defined by the sender
file_nameStringOptional. Original filename as defined by the sender
mime_typeStringOptional. MIME type of the file as defined by the sender
file_sizeIntegerOptional. File size in bytes. It can be bigger than 2^31 and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a signed 64-bit integer or double-precision float type is safe for storing this value.
+

LivePhoto

+

This object represents a live photo.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
photoArray of PhotoSizeOptional. Available sizes of the corresponding static photo
file_idStringIdentifier for the video file, which can be used to download or reuse the file
file_unique_idStringUnique identifier for the video file, which is supposed to be the same over time and for different bots. Can't be used to download or reuse the file.
widthIntegerVideo width as defined by the sender
heightIntegerVideo height as defined by the sender
durationIntegerDuration of the video in seconds as defined by the sender
mime_typeStringOptional. MIME type of the file as defined by the sender
file_sizeIntegerOptional. File size in bytes. It can be bigger than 2^31 and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a signed 64-bit integer or double-precision float type is safe for storing this value.
+

Story

+

This object represents a story.

+ + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
chatChatChat that posted the story
idIntegerUnique identifier for the story in the chat
+

VideoQuality

+

This object represents a video file of a specific quality.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
file_idStringIdentifier for this file, which can be used to download or reuse the file
file_unique_idStringUnique identifier for this file, which is supposed to be the same over time and for different bots. Can't be used to download or reuse the file.
widthIntegerVideo width
heightIntegerVideo height
codecStringCodec that was used to encode the video, for example, “h264”, “h265”, or “av01”
file_sizeIntegerOptional. File size in bytes. It can be bigger than 2^31 and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a signed 64-bit integer or double-precision float type is safe for storing this value.
+

Video

+

This object represents a video file.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
file_idStringIdentifier for this file, which can be used to download or reuse the file
file_unique_idStringUnique identifier for this file, which is supposed to be the same over time and for different bots. Can't be used to download or reuse the file.
widthIntegerVideo width as defined by the sender
heightIntegerVideo height as defined by the sender
durationIntegerDuration of the video in seconds as defined by the sender
thumbnailPhotoSizeOptional. Video thumbnail
coverArray of PhotoSizeOptional. Available sizes of the cover of the video in the message
start_timestampIntegerOptional. Timestamp in seconds from which the video will play in the message
qualitiesArray of VideoQualityOptional. List of available qualities of the video
file_nameStringOptional. Original filename as defined by the sender
mime_typeStringOptional. MIME type of the file as defined by the sender
file_sizeIntegerOptional. File size in bytes. It can be bigger than 2^31 and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a signed 64-bit integer or double-precision float type is safe for storing this value.
+

VideoNote

+

This object represents a video message.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
file_idStringIdentifier for this file, which can be used to download or reuse the file
file_unique_idStringUnique identifier for this file, which is supposed to be the same over time and for different bots. Can't be used to download or reuse the file.
lengthIntegerVideo width and height (diameter of the video message) as defined by the sender
durationIntegerDuration of the video in seconds as defined by the sender
thumbnailPhotoSizeOptional. Video thumbnail
file_sizeIntegerOptional. File size in bytes
+

Voice

+

This object represents a voice note.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
file_idStringIdentifier for this file, which can be used to download or reuse the file
file_unique_idStringUnique identifier for this file, which is supposed to be the same over time and for different bots. Can't be used to download or reuse the file.
durationIntegerDuration of the audio in seconds as defined by the sender
mime_typeStringOptional. MIME type of the file as defined by the sender
file_sizeIntegerOptional. File size in bytes. It can be bigger than 2^31 and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a signed 64-bit integer or double-precision float type is safe for storing this value.
+

Widget

+

This object describes an HTML widget.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
idStringOptional. Unique identifier of the shared widget, which can be used to send the widget again using the method sendSharedWidget; omitted if the widget isn't shared
widthIntegerOptional. Width of the widget in logical pixels; omitted if the widget must occupy the whole width of the message bubble
heightIntegerOptional. Height of the widget in logical pixels; omitted if the height of the widget isn't fixed
htmlStringHTML code of the widget
public_dataStringOptional. Public data of the widget, which is available wherever the widget is shown. All messages with a shared widget have the same public data.
chat_dataStringOptional. Data of the widget, which is specific to the message
+

PaidMediaInfo

+

Describes the paid media added to a message.

+ + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
star_countIntegerThe number of Telegram Stars that must be paid to buy access to the media
paid_mediaArray of PaidMediaInformation about the paid media
+

PaidMedia

+

This object describes paid media. Currently, it can be one of

+ +

PaidMediaLivePhoto

+

The paid media is a live photo.

+ + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
typeStringType of the paid media, always “live_photo”
live_photoLivePhotoThe photo
+

PaidMediaPhoto

+

The paid media is a photo.

+ + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
typeStringType of the paid media, always “photo”
photoArray of PhotoSizeThe photo
+

PaidMediaPreview

+

The paid media isn't available before the payment.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
typeStringType of the paid media, always “preview”
widthIntegerOptional. Media width as defined by the sender
heightIntegerOptional. Media height as defined by the sender
durationIntegerOptional. Duration of the media in seconds as defined by the sender
+

PaidMediaVideo

+

The paid media is a video.

+ + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
typeStringType of the paid media, always “video”
videoVideoThe video
+

Contact

+

This object represents a phone contact.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
phone_numberStringContact's phone number
first_nameStringContact's first name
last_nameStringOptional. Contact's last name
user_idIntegerOptional. Contact's user identifier in Telegram. This number may have more than 32 significant bits and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a 64-bit integer or double-precision float type is safe for storing this identifier.
vcardStringOptional. Additional data about the contact in the form of a vCard
+

Dice

+

This object represents an animated emoji that displays a random value.

+ + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
emojiStringEmoji on which the dice throw animation is based
valueIntegerValue of the dice, 1-6 for “🎲”, “🎯” and “🎳” base emoji, 1-5 for “🏀” and “⚽” base emoji, 1-64 for “🎰” base emoji
+

Link

+

Represents an HTTP link.

+ + + + + + + + + + + + + + + +
FieldTypeDescription
urlStringURL of the link
+

PollMedia

+

At most one of the optional fields can be present in any given object.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
animationAnimationOptional. Media is an animation, information about the animation
audioAudioOptional. Media is an audio file, information about the file; currently, can't be received in a poll option
documentDocumentOptional. Media is a general file, information about the file; currently, can't be received in a poll option
linkLinkOptional. The HTTP link attached to the poll option
live_photoLivePhotoOptional. Media is a live photo, information about the live photo
locationLocationOptional. Media is a shared location, information about the location
photoArray of PhotoSizeOptional. Media is a photo, available sizes of the photo
stickerStickerOptional. Media is a sticker, information about the sticker; currently, for poll options only
venueVenueOptional. Media is a venue, information about the venue
videoVideoOptional. Media is a video, information about the video
+

InputPollMedia

+

This object represents the content of a poll description or a quiz explanation to be sent. It should be one of

+ +

InputPollOptionMedia

+

This object represents the content of a poll option to be sent. It should be one of

+ +

PollOption

+

This object contains information about one answer option in a poll.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
persistent_idStringUnique identifier of the option, persistent on option addition and deletion
textStringOption text, 1-100 characters
text_entitiesArray of MessageEntityOptional. Special entities that appear in the option text. Currently, only custom emoji entities are allowed in poll option texts
mediaPollMediaOptional. Media added to the poll option
voter_countIntegerNumber of users who voted for this option; may be 0 if unknown
added_by_userUserOptional. User who added the option; omitted if the option wasn't added by a user after poll creation
added_by_chatChatOptional. Chat that added the option; omitted if the option wasn't added by a chat after poll creation
addition_dateIntegerOptional. Point in time (Unix timestamp) when the option was added; omitted if the option existed in the original poll
+

InputPollOption

+

This object contains information about one answer option in a poll to be sent.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
textStringOption text, 1-100 characters
text_parse_modeStringOptional. Mode for parsing entities in the text. See formatting options for more details. Currently, only custom emoji entities are allowed.
text_entitiesArray of MessageEntityOptional. A JSON-serialized list of special entities that appear in the poll option text. It can be specified instead of text_parse_mode.
mediaInputPollOptionMediaOptional. Media added to the poll option
+

PollAnswer

+

This object represents an answer of a user in a non-anonymous poll.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
poll_idStringUnique poll identifier
voter_chatChatOptional. The chat that changed the answer to the poll, if the voter is anonymous
userUserOptional. The user that changed the answer to the poll, if the voter isn't anonymous
option_idsArray of Integer0-based identifiers of chosen answer options. May be empty if the vote was retracted.
option_persistent_idsArray of StringPersistent identifiers of the chosen answer options. May be empty if the vote was retracted.
+

Poll

+

This object contains information about a poll.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
idStringUnique poll identifier
questionStringPoll question, 1-300 characters
question_entitiesArray of MessageEntityOptional. Special entities that appear in the question. Currently, only custom emoji entities are allowed in poll questions
optionsArray of PollOptionList of poll options
total_voter_countIntegerTotal number of users that voted in the poll
is_closedBooleanTrue, if the poll is closed
is_anonymousBooleanTrue, if the poll is anonymous
typeStringPoll type, currently can be “regular” or “quiz”
allows_multiple_answersBooleanTrue, if the poll allows multiple answers
allows_revotingBooleanTrue, if the poll allows changing the chosen answer options
members_onlyBooleanTrue, if voting is limited to users who have been members of the chat where the poll was originally sent for more than 24 hours
country_codesArray of StringOptional. A list of two-letter ISO 3166-1 alpha-2 country codes indicating the countries from which users can vote in the poll. The country code “FT” is used for users with anonymous numbers. If omitted, then users from any country can participate in the poll.
correct_option_idsArray of IntegerOptional. Array of 0-based identifiers of the correct answer options. Available only for polls in quiz mode which are closed or were sent (not forwarded) by the bot or to the private chat with the bot.
explanationStringOptional. Text that is shown when a user chooses an incorrect answer or taps on the lamp icon in a quiz-style poll, 0-200 characters
explanation_entitiesArray of MessageEntityOptional. Special entities like usernames, URLs, bot commands, etc. that appear in the explanation
explanation_mediaPollMediaOptional. Media added to the quiz explanation
open_periodIntegerOptional. Amount of time in seconds the poll will be active after creation
close_dateIntegerOptional. Point in time (Unix timestamp) when the poll will be automatically closed
descriptionStringOptional. Description of the poll; for polls inside the Message object only
description_entitiesArray of MessageEntityOptional. Special entities like usernames, URLs, bot commands, etc. that appear in the description
mediaPollMediaOptional. Media added to the poll description; for polls inside the Message object only
+

ChecklistTask

+

Describes a task in a checklist.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
idIntegerUnique identifier of the task
textStringText of the task
text_entitiesArray of MessageEntityOptional. Special entities that appear in the task text
completed_by_userUserOptional. User that completed the task; omitted if the task wasn't completed by a user
completed_by_chatChatOptional. Chat that completed the task; omitted if the task wasn't completed by a chat
completion_dateIntegerOptional. Point in time (Unix timestamp) when the task was completed; 0 if the task wasn't completed
+

Checklist

+

Describes a checklist.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
titleStringTitle of the checklist
title_entitiesArray of MessageEntityOptional. Special entities that appear in the checklist title
tasksArray of ChecklistTaskList of tasks in the checklist
others_can_add_tasksTrueOptional. True, if users other than the creator of the list can add tasks to the list
others_can_mark_tasks_as_doneTrueOptional. True, if users other than the creator of the list can mark tasks as done or not done
+

InputChecklistTask

+

Describes a task to add to a checklist.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
idIntegerUnique identifier of the task; must be positive and unique among all task identifiers currently present in the checklist
textStringText of the task; 1-100 characters after entities parsing
parse_modeStringOptional. Mode for parsing entities in the text. See formatting options for more details.
text_entitiesArray of MessageEntityOptional. List of special entities that appear in the text, which can be specified instead of parse_mode. Currently, only bold, italic, underline, strikethrough, spoiler, custom_emoji, and date_time entities are allowed.
+

InputChecklist

+

Describes a checklist to create.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
titleStringTitle of the checklist; 1-255 characters after entities parsing
parse_modeStringOptional. Mode for parsing entities in the title. See formatting options for more details.
title_entitiesArray of MessageEntityOptional. List of special entities that appear in the title, which can be specified instead of parse_mode. Currently, only bold, italic, underline, strikethrough, spoiler, custom_emoji, and date_time entities are allowed.
tasksArray of InputChecklistTaskList of 1-30 tasks in the checklist
others_can_add_tasksBooleanOptional. Pass True if other users can add tasks to the checklist
others_can_mark_tasks_as_doneBooleanOptional. Pass True if other users can mark tasks as done or not done in the checklist
+

Location

+

This object represents a point on the map.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
latitudeFloatLatitude as defined by the sender
longitudeFloatLongitude as defined by the sender
horizontal_accuracyFloatOptional. The radius of uncertainty for the location, measured in meters; 0-1500
live_periodIntegerOptional. Time relative to the message sending date, during which the location can be updated; in seconds. For active live locations only.
headingIntegerOptional. The direction in which the user is moving, in degrees; 1-360. For active live locations only.
proximity_alert_radiusIntegerOptional. The maximum distance for proximity alerts about approaching another chat member, in meters. For sent live locations only.
+

Venue

+

This object represents a venue.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
locationLocationVenue location. Can't be a live location.
titleStringName of the venue
addressStringAddress of the venue
foursquare_idStringOptional. Foursquare identifier of the venue
foursquare_typeStringOptional. Foursquare type of the venue. (For example, “arts_entertainment/default”, “arts_entertainment/aquarium” or “food/icecream”.)
google_place_idStringOptional. Google Places identifier of the venue
google_place_typeStringOptional. Google Places type of the venue. (See supported types.)
+

WebAppData

+

Describes data sent from a Web App to the bot.

+ + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
dataStringThe data. Be aware that a bad client can send arbitrary data in this field.
button_textStringText of the web_app keyboard button from which the Web App was opened. Be aware that a bad client can send arbitrary data in this field.
+

ProximityAlertTriggered

+

This object represents the content of a service message, sent whenever a user in the chat triggers a proximity alert set by another user.

+ + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
travelerUserUser that triggered the alert
watcherUserUser that set the alert
distanceIntegerThe distance between the users
+

MessageAutoDeleteTimerChanged

+

This object represents a service message about a change in auto-delete timer settings.

+ + + + + + + + + + + + + + + +
FieldTypeDescription
message_auto_delete_timeIntegerNew auto-delete time for messages in the chat; in seconds
+

ManagedBotCreated

+

This object contains information about the bot that was created to be managed by the current bot.

+ + + + + + + + + + + + + + + +
FieldTypeDescription
botUserInformation about the bot. The bot's token can be fetched using the method getManagedBotToken.
+

ManagedBotUpdated

+

This object contains information about the creation, token update, or owner update of a bot that is managed by the current bot.

+ + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
userUserUser that created the bot
botUserInformation about the bot. The token of the bot can be fetched using the method getManagedBotToken.
+

BotSubscriptionUpdated

+

This object contains information about changes to a user payment subscription toward the current bot.

+ + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
userUserUser who subscribed for payments toward the bot
invoice_payloadStringBot-specified invoice payload
stateStringThe new state of the subscription. Currently, it can be one of “canceled” if the user canceled the subscription, “active” if the user re-enabled a previously canceled subscription, or “failed” if payment for the subscription failed.
+

MessageGenerationStopped

+

This object describes an update about a user stopping message generation.

+ + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
chatChatChat in which the message is generated
message_thread_idIntegerOptional. Unique identifier of the message thread in which the message is generated
draft_idIntegerUnique identifier of the message draft which was stopped
+

PollOptionAdded

+

Describes a service message about an option added to a poll.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
poll_messageMaybeInaccessibleMessageOptional. Message containing the poll to which the option was added, if known. Note that the Message object in this field will not contain the reply_to_message field even if it itself is a reply.
option_persistent_idStringUnique identifier of the added option
option_textStringOption text
option_text_entitiesArray of MessageEntityOptional. Special entities that appear in the option_text
+

PollOptionDeleted

+

Describes a service message about an option deleted from a poll.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
poll_messageMaybeInaccessibleMessageOptional. Message containing the poll from which the option was deleted, if known. Note that the Message object in this field will not contain the reply_to_message field even if it itself is a reply.
option_persistent_idStringUnique identifier of the deleted option
option_textStringOption text
option_text_entitiesArray of MessageEntityOptional. Special entities that appear in the option_text
+

ChatBoostAdded

+

This object represents a service message about a user boosting a chat.

+ + + + + + + + + + + + + + + +
FieldTypeDescription
boost_countIntegerNumber of boosts added by the user
+

BackgroundFill

+

This object describes the way a background is filled based on the selected colors. Currently, it can be one of

+ +

BackgroundFillSolid

+

The background is filled using the selected color.

+ + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
typeStringType of the background fill, always “solid”
colorIntegerThe color of the background fill in the RGB24 format
+

BackgroundFillGradient

+

The background is a gradient fill.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
typeStringType of the background fill, always “gradient”
top_colorIntegerTop color of the gradient in the RGB24 format
bottom_colorIntegerBottom color of the gradient in the RGB24 format
rotation_angleIntegerClockwise rotation angle of the background fill in degrees; 0-359
+

BackgroundFillFreeformGradient

+

The background is a freeform gradient that rotates after every message in the chat.

+ + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
typeStringType of the background fill, always “freeform_gradient”
colorsArray of IntegerA list of the 3 or 4 base colors that are used to generate the freeform gradient in the RGB24 format
+

BackgroundType

+

This object describes the type of a background. Currently, it can be one of

+ +

BackgroundTypeFill

+

The background is automatically filled based on the selected colors.

+ + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
typeStringType of the background, always “fill”
fillBackgroundFillThe background fill
dark_theme_dimmingIntegerDimming of the background in dark themes, as a percentage; 0-100
+

BackgroundTypeWallpaper

+

The background is a wallpaper in the JPEG format.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
typeStringType of the background, always “wallpaper”
documentDocumentDocument with the wallpaper
dark_theme_dimmingIntegerDimming of the background in dark themes, as a percentage; 0-100
is_blurredTrueOptional. True, if the wallpaper is downscaled to fit in a 450x450 square and then box-blurred with radius 12
is_movingTrueOptional. True, if the background moves slightly when the device is tilted
+

BackgroundTypePattern

+

The 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.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
typeStringType of the background, always “pattern”
documentDocumentDocument with the pattern
fillBackgroundFillThe background fill that is combined with the pattern
intensityIntegerIntensity of the pattern when it is shown above the filled background; 0-100
is_invertedTrueOptional. True, if the background fill must be applied only to the pattern itself. All other pixels are black in this case. For dark themes only.
is_movingTrueOptional. True, if the background moves slightly when the device is tilted
+

BackgroundTypeChatTheme

+

The background is taken directly from a built-in chat theme.

+ + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
typeStringType of the background, always “chat_theme”
theme_nameStringName of the chat theme, which is usually an emoji
+

ChatBackground

+

This object represents a chat background.

+ + + + + + + + + + + + + + + +
FieldTypeDescription
typeBackgroundTypeType of the background
+

ChecklistTasksDone

+

Describes a service message about checklist tasks marked as done or not done.

+ + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
checklist_messageMessageOptional. Message containing the checklist whose tasks were marked as done or not done. Note that the Message object in this field will not contain the reply_to_message field even if it itself is a reply.
marked_as_done_task_idsArray of IntegerOptional. Identifiers of the tasks that were marked as done
marked_as_not_done_task_idsArray of IntegerOptional. Identifiers of the tasks that were marked as not done
+

ChecklistTasksAdded

+

Describes a service message about tasks added to a checklist.

+ + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
checklist_messageMessageOptional. Message containing the checklist to which the tasks were added. Note that the Message object in this field will not contain the reply_to_message field even if it itself is a reply.
tasksArray of ChecklistTaskList of tasks added to the checklist
+

CommunityChatAdded

+

Describes a service message about a chat or a bot being added to a community.

+ + + + + + + + + + + + + + + +
FieldTypeDescription
communityCommunityThe new community to which the chat or the bot belongs
+

CommunityChatJoined

+

Describes a service message about a chat being joined by a user from a community.

+ + + + + + + + + + + + + + + +
FieldTypeDescription
communityCommunityThe community from which the chat was joined
+

CommunityChatRemoved

+

Describes a service message about a chat or a bot being removed from a community. Currently holds no information.

+

ForumTopicCreated

+

This object represents a service message about a new forum topic created in the chat.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
nameStringName of the topic
icon_colorIntegerColor of the topic icon in RGB format
icon_custom_emoji_idStringOptional. Unique identifier of the custom emoji shown as the topic icon
is_name_implicitTrueOptional. True, if the name of the topic wasn't specified explicitly by its creator and likely needs to be changed by the bot
+

ForumTopicClosed

+

This object represents a service message about a forum topic closed in the chat. Currently holds no information.

+

ForumTopicEdited

+

This object represents a service message about an edited forum topic.

+ + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
nameStringOptional. New name of the topic, if it was edited
icon_custom_emoji_idStringOptional. New identifier of the custom emoji shown as the topic icon, if it was edited; an empty string if the icon was removed
+

ForumTopicReopened

+

This object represents a service message about a forum topic reopened in the chat. Currently holds no information.

+

GeneralForumTopicHidden

+

This object represents a service message about the General forum topic hidden in the chat. Currently holds no information.

+

GeneralForumTopicUnhidden

+

This object represents a service message about the General forum topic unhidden in the chat. Currently holds no information.

+

SharedUser

+

This object contains information about a user that was shared with the bot using a KeyboardButtonRequestUsers button.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
user_idIntegerIdentifier of the shared user. This number may have more than 32 significant bits and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so 64-bit integers or double-precision float types are safe for storing these identifiers. The bot may not have access to the user and could be unable to use this identifier, unless the user is already known to the bot by some other means.
first_nameStringOptional. First name of the user, if the name was requested by the bot
last_nameStringOptional. Last name of the user, if the name was requested by the bot
usernameStringOptional. Username of the user, if the username was requested by the bot
photoArray of PhotoSizeOptional. Available sizes of the chat photo, if the photo was requested by the bot
+

UsersShared

+

This object contains information about the users whose identifiers were shared with the bot using a KeyboardButtonRequestUsers button.

+ + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
request_idIntegerIdentifier of the request
usersArray of SharedUserInformation about users shared with the bot
+

ChatShared

+

This object contains information about a chat that was shared with the bot using a KeyboardButtonRequestChat button.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
request_idIntegerIdentifier of the request
chat_idIntegerIdentifier of the shared chat. This number may have more than 32 significant bits and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a 64-bit integer or double-precision float type is safe for storing this identifier. The bot may not have access to the chat and could be unable to use this identifier, unless the chat is already known to the bot by some other means.
titleStringOptional. Title of the chat, if the title was requested by the bot
usernameStringOptional. Username of the chat, if the username was requested by the bot and available
photoArray of PhotoSizeOptional. Available sizes of the chat photo, if the photo was requested by the bot
+

WriteAccessAllowed

+

This 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 method requestWriteAccess, or about a user being invited to the private chat with the bot by the owner of the bot.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
from_requestBooleanOptional. True, if the access was granted after the user accepted an explicit request from a Web App sent by the method requestWriteAccess
web_app_nameStringOptional. Name of the Web App, if the access was granted when the Web App was launched from a link
from_attachment_menuBooleanOptional. True, if the access was granted when the bot was added to the attachment or side menu
inviterUserOptional. The owner of the bot, if the access was granted when the owner invited the user to the private chat with the bot. Bot owners can invite up to 10 users at once by pressing the link https://t.me/botinvite/<bot_username>.
+

VideoChatScheduled

+

This object represents a service message about a video chat scheduled in the chat.

+ + + + + + + + + + + + + + + +
FieldTypeDescription
start_dateIntegerPoint in time (Unix timestamp) when the video chat is supposed to be started by a chat administrator
+

VideoChatStarted

+

This object represents a service message about a video chat started in the chat. Currently holds no information.

+

VideoChatEnded

+

This object represents a service message about a video chat ended in the chat.

+ + + + + + + + + + + + + + + +
FieldTypeDescription
durationIntegerVideo chat duration in seconds
+

VideoChatParticipantsInvited

+

This object represents a service message about new members invited to a video chat.

+ + + + + + + + + + + + + + + +
FieldTypeDescription
usersArray of UserNew members that were invited to the video chat
+

PaidMessagePriceChanged

+

Describes a service message about a change in the price of paid messages within a chat.

+ + + + + + + + + + + + + + + +
FieldTypeDescription
paid_message_star_countIntegerThe new number of Telegram Stars that must be paid by non-administrator users of the supergroup chat for each sent message
+

DirectMessagePriceChanged

+

Describes a service message about a change in the price of direct messages sent to a channel chat.

+ + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
are_direct_messages_enabledBooleanTrue, if direct messages are enabled for the channel chat; False otherwise
direct_message_star_countIntegerOptional. The new number of Telegram Stars that must be paid by users for each direct message sent to the channel. Does not apply to users who have been exempted by administrators. Defaults to 0.
+

SuggestedPostApproved

+

Describes a service message about the approval of a suggested post.

+ + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
suggested_post_messageMessageOptional. Message containing the suggested post. Note that the Message object in this field will not contain the reply_to_message field even if it itself is a reply.
priceSuggestedPostPriceOptional. Amount paid for the post
send_dateIntegerDate when the post will be published
+

SuggestedPostApprovalFailed

+

Describes a service message about the failed approval of a suggested post. Currently, only caused by insufficient user funds at the time of approval.

+ + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
suggested_post_messageMessageOptional. Message containing the suggested post whose approval has failed. Note that the Message object in this field will not contain the reply_to_message field even if it itself is a reply.
priceSuggestedPostPriceExpected price of the post
+

SuggestedPostDeclined

+

Describes a service message about the rejection of a suggested post.

+ + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
suggested_post_messageMessageOptional. Message containing the suggested post. Note that the Message object in this field will not contain the reply_to_message field even if it itself is a reply.
commentStringOptional. Comment with which the post was declined
+

SuggestedPostPaid

+

Describes a service message about a successful payment for a suggested post.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
suggested_post_messageMessageOptional. Message containing the suggested post. Note that the Message object in this field will not contain the reply_to_message field even if it itself is a reply.
currencyStringCurrency in which the payment was made. Currently, one of “XTR” for Telegram Stars or “TON” for TON grams.
amountIntegerOptional. The amount of the currency that was received by the channel in nanograms; for payments in TON grams only
star_amountStarAmountOptional. The amount of Telegram Stars that was received by the channel; for payments in Telegram Stars only
+

SuggestedPostRefunded

+

Describes a service message about a payment refund for a suggested post.

+ + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
suggested_post_messageMessageOptional. Message containing the suggested post. Note that the Message object in this field will not contain the reply_to_message field even if it itself is a reply.
reasonStringReason for the refund. Currently, one of “post_deleted” if the post was deleted within 24 hours of being posted or removed from scheduled messages without being posted, or “payment_refunded” if the payer refunded their payment.
+

PaidMessagesWaived

+

Describes 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.

+

TonWalletTransfer

+

Describes a service message about a transfer with a TON wallet.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
transaction_idStringUnique identifier of the transaction; may be empty if the transfer hasn't been sent yet
peer_addressStringAddress of the transfer peer in the TON blockchain
amountStringThe amount of transferred cryptocurrency, in the smallest units of the cryptocurrency, as a decimal number; negative for outgoing transfers
commentStringOptional. Comment added to the transfer; omitted if the comment is encrypted
+

GiveawayCreated

+

This object represents a service message about the creation of a scheduled giveaway.

+ + + + + + + + + + + + + + + +
FieldTypeDescription
prize_star_countIntegerOptional. The number of Telegram Stars to be split between giveaway winners; for Telegram Star giveaways only
+

Giveaway

+

This object represents a message about a scheduled giveaway.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
chatsArray of ChatThe list of chats which the user must join to participate in the giveaway
winners_selection_dateIntegerPoint in time (Unix timestamp) when winners of the giveaway will be selected
winner_countIntegerThe number of users who are supposed to be selected as winners of the giveaway
only_new_membersTrueOptional. True, if only users who join the chats after the giveaway started should be eligible to win
has_public_winnersTrueOptional. True, if the list of giveaway winners will be visible to everyone
prize_descriptionStringOptional. Description of an additional giveaway prize
country_codesArray of StringOptional. A list of two-letter ISO 3166-1 alpha-2 country codes indicating the countries from which eligible users for the giveaway must come. If empty, then all users can participate in the giveaway. Users with a phone number that was bought on Fragment can always participate in giveaways.
prize_star_countIntegerOptional. The number of Telegram Stars to be split between giveaway winners; for Telegram Star giveaways only
premium_subscription_month_countIntegerOptional. The number of months the Telegram Premium subscription won from the giveaway will be active for; for Telegram Premium giveaways only
+

GiveawayWinners

+

This object represents a message about the completion of a giveaway with public winners.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
chatChatThe chat that created the giveaway
giveaway_message_idIntegerIdentifier of the message with the giveaway in the chat
winners_selection_dateIntegerPoint in time (Unix timestamp) when winners of the giveaway were selected
winner_countIntegerTotal number of winners in the giveaway
winnersArray of UserList of up to 100 winners of the giveaway
additional_chat_countIntegerOptional. The number of other chats the user had to join in order to be eligible for the giveaway
prize_star_countIntegerOptional. The number of Telegram Stars that were split between giveaway winners; for Telegram Star giveaways only
premium_subscription_month_countIntegerOptional. The number of months the Telegram Premium subscription won from the giveaway will be active for; for Telegram Premium giveaways only
unclaimed_prize_countIntegerOptional. Number of undistributed prizes
only_new_membersTrueOptional. True, if only users who had joined the chats after the giveaway started were eligible to win
was_refundedTrueOptional. True, if the giveaway was canceled because the payment for it was refunded
prize_descriptionStringOptional. Description of an additional giveaway prize
+

GiveawayCompleted

+

This object represents a service message about the completion of a giveaway without public winners.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
winner_countIntegerNumber of winners in the giveaway
unclaimed_prize_countIntegerOptional. Number of undistributed prizes
giveaway_messageMessageOptional. Message with the giveaway that was completed, if it wasn't deleted
is_star_giveawayTrueOptional. True, if the giveaway is a Telegram Star giveaway. Otherwise, currently, the giveaway is a Telegram Premium giveaway.
+

LinkPreviewOptions

+

Describes the options used for link preview generation.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
is_disabledBooleanOptional. True, if the link preview is disabled
urlStringOptional. URL to use for the link preview. If empty, then the first URL found in the message text will be used.
prefer_small_mediaBooleanOptional. True, if the media in the link preview is supposed to be shrunk; ignored if the URL isn't explicitly specified or media size change isn't supported for the preview
prefer_large_mediaBooleanOptional. True, if the media in the link preview is supposed to be enlarged; ignored if the URL isn't explicitly specified or media size change isn't supported for the preview
show_above_textBooleanOptional. True, if the link preview must be shown above the message text; otherwise, the link preview will be shown below the message text
+

SuggestedPostPrice

+

Describes the price of a suggested post.

+ + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
currencyStringCurrency in which the post will be paid. Currently, must be one of “XTR” for Telegram Stars or “TON” for TON grams.
amountIntegerThe amount of the currency that will be paid for the post in the smallest units of the currency, i.e. Telegram Stars or nanograms. Currently, price in Telegram Stars must be between 5 and 100000, and price in nanograms must be between 10000000 and 10000000000000.
+

SuggestedPostInfo

+

Contains information about a suggested post.

+ + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
stateStringState of the suggested post. Currently, it can be one of “pending”, “approved”, “declined”.
priceSuggestedPostPriceOptional. Proposed price of the post. If the field is omitted, then the post is unpaid.
send_dateIntegerOptional. Proposed send date of the post. If the field is omitted, then the post can be published at any time within 30 days at the sole discretion of the user or administrator who approves it.
+

SuggestedPostParameters

+

Contains parameters of a post that is being suggested by the bot.

+ + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
priceSuggestedPostPriceOptional. Proposed price for the post. If the field is omitted, then the post is unpaid.
send_dateIntegerOptional. Proposed send date of the post. If specified, then the date must be between 300 seconds and 2678400 seconds (30 days) in the future. If the field is omitted, then the post can be published at any time within 30 days at the sole discretion of the user who approves it.
+

DirectMessagesTopic

+

Describes a topic of a direct messages chat.

+ + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
topic_idIntegerUnique identifier of the topic. This number may have more than 32 significant bits and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a 64-bit integer or double-precision float type is safe for storing this identifier.
userUserOptional. Information about the user that created the topic. Currently, it is always present.
+

UserProfilePhotos

+

This object represents a user's profile pictures.

+ + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
total_countIntegerTotal number of profile pictures the target user has
photosArray of Array of PhotoSizeRequested profile pictures (in up to 4 sizes each)
+

UserProfileAudios

+

This object represents the audios displayed on a user's profile.

+ + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
total_countIntegerTotal number of profile audios for the target user
audiosArray of AudioRequested profile audios
+

File

+

This object represents a file ready to be downloaded. The file can be downloaded via the link https://api.telegram.org/file/bot<token>/<file_path>. It is guaranteed that the link will be valid for at least 1 hour. When the link expires, a new one can be requested by calling getFile.

+
+

The maximum file size to download is 20 MB

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
file_idStringIdentifier for this file, which can be used to download or reuse the file
file_unique_idStringUnique identifier for this file, which is supposed to be the same over time and for different bots. Can't be used to download or reuse the file.
file_sizeIntegerOptional. File size in bytes. It can be bigger than 2^31 and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a signed 64-bit integer or double-precision float type is safe for storing this value.
file_pathStringOptional. File path. Use https://api.telegram.org/file/bot<token>/<file_path> to get the file.
+

WebAppInfo

+

Describes a Web App.

+ + + + + + + + + + + + + + + +
FieldTypeDescription
urlStringAn HTTPS URL of a Web App to be opened with additional data as specified in Initializing Web Apps
+

ReplyKeyboardMarkup

+

This 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.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
keyboardArray of Array of KeyboardButtonArray of button rows, each represented by an Array of KeyboardButton objects
is_persistentBooleanOptional. Requests clients to always show the keyboard when the regular keyboard is hidden. Defaults to False, in which case the custom keyboard can be hidden and opened with a keyboard icon.
resize_keyboardBooleanOptional. Requests clients to resize the keyboard vertically for optimal fit (e.g., make the keyboard smaller if there are just two rows of buttons). Defaults to False, in which case the custom keyboard is always of the same height as the app's standard keyboard.
one_time_keyboardBooleanOptional. Requests clients to hide the keyboard as soon as it's been used. The keyboard will still be available, but clients will automatically display the usual letter-keyboard in the chat - the user can press a special button in the input field to see the custom keyboard again. Defaults to False.
input_field_placeholderStringOptional. The placeholder to be shown in the input field when the keyboard is active; 1-64 characters
selectiveBooleanOptional. Use this parameter if you want to show the keyboard to specific users only. Targets: 1) users that are @mentioned in the text of the Message object; 2) if the bot's message is a reply to a message in the same chat and forum topic, sender of the original message.

Example: A user requests to change the bot's language, and the bot replies to the request with a keyboard to select the new language. Other users in the group don't see the keyboard.
force_replyBooleanOptional. Pass True if the reply interface must be shown to the user, as if they had manually selected the bot's message and tapped 'Reply'
+

KeyboardButton

+

This 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 used instead of this object to specify the button text.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
textStringText of the button. If none of the fields other than text, icon_custom_emoji_id, and style are used, it will be sent as a message when the button is pressed.
icon_custom_emoji_idStringOptional. Unique identifier of the custom emoji shown before the text of the button. Can only be used by bots that purchased additional usernames on Fragment or in the messages directly sent by the bot to private, group and supergroup chats if the owner of the bot has a Telegram Premium subscription.
styleStringOptional. Style of the button. Must be one of “danger” (red), “success” (green) or “primary” (blue). If omitted, then an app-specific style is used.
request_usersKeyboardButtonRequestUsersOptional. If specified, pressing the button will open a list of suitable users. Identifiers of selected users will be sent to the bot in a “users_shared” service message. Available in private chats only.
request_chatKeyboardButtonRequestChatOptional. If specified, pressing the button will open a list of suitable chats. Tapping on a chat will send its identifier to the bot in a “chat_shared” service message. Available in private chats only.
request_managed_botKeyboardButtonRequestManagedBotOptional. If specified, pressing the button will ask the user to create and share a bot that will be managed by the current bot. Available for bots that enabled management of other bots in the @BotFather Mini App or using the parameter can_manage_bots of the method setMySettings. Available in private chats only.
request_contactBooleanOptional. If True, the user's phone number will be sent as a contact when the button is pressed. Available in private chats only.
request_locationBooleanOptional. If True, the user's current location will be sent when the button is pressed. Available in private chats only.
request_pollKeyboardButtonPollTypeOptional. If specified, the user will be asked to create a poll and send it to the bot when the button is pressed. Available in private chats only.
web_appWebAppInfoOptional. If specified, the described Web App will be launched when the button is pressed. The Web App will be able to send a “web_app_data” service message. Available in private chats only.
+

KeyboardButtonRequestUsers

+

This 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 »

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
request_idIntegerSigned 32-bit identifier of the request that will be received back in the UsersShared object. Must be unique within the message.
user_is_botBooleanOptional. Pass True to request bots, pass False to request regular users. If not specified, no additional restrictions are applied.
user_is_premiumBooleanOptional. Pass True to request premium users, pass False to request non-premium users. If not specified, no additional restrictions are applied.
max_quantityIntegerOptional. The maximum number of users to be selected; 1-10. Defaults to 1.
request_nameBooleanOptional. Pass True to request the users' first and last names
request_usernameBooleanOptional. Pass True to request the users' usernames
request_photoBooleanOptional. Pass True to request the users' photos
+

KeyboardButtonRequestChat

+

This 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 the requested rights in the chat if appropriate. More about requesting chats ».

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
request_idIntegerSigned 32-bit identifier of the request, which will be received back in the ChatShared object. Must be unique within the message.
chat_is_channelBooleanPass True to request a channel chat, pass False to request a group or a supergroup chat
chat_is_forumBooleanOptional. Pass True to request a forum supergroup, pass False to request a non-forum chat. If not specified, no additional restrictions are applied.
chat_has_usernameBooleanOptional. Pass True to request a supergroup or a channel with a username, pass False to request a chat without a username. If not specified, no additional restrictions are applied.
chat_is_createdBooleanOptional. Pass True to request a chat owned by the user. Otherwise, no additional restrictions are applied.
user_administrator_rightsChatAdministratorRightsOptional. A JSON-serialized object listing the required administrator rights of the user in the chat. The rights must be a superset of bot_administrator_rights. If not specified, no additional restrictions are applied.
bot_administrator_rightsChatAdministratorRightsOptional. A JSON-serialized object listing the required administrator rights of the bot in the chat. The rights must be a subset of user_administrator_rights. If not specified, no additional restrictions are applied.
bot_is_memberBooleanOptional. Pass True to request a chat with the bot as a member. Otherwise, no additional restrictions are applied.
request_titleBooleanOptional. Pass True to request the chat's title
request_usernameBooleanOptional. Pass True to request the chat's username
request_photoBooleanOptional. Pass True to request the chat's photo
+

KeyboardButtonRequestManagedBot

+

This 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.

+ + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
request_idIntegerSigned 32-bit identifier of the request. Must be unique within the message.
suggested_nameStringOptional. Suggested name for the bot
suggested_usernameStringOptional. Suggested username for the bot. The username must end with “bot”. If the user creating the bot has a Telegram Premium subscription, then the username can also end with “agent”, “ai”, “app”, “game”, or “gay”; in this case, the username will be assigned to the bot as a secondary username, and a regular username ending with “bot” will be assigned to the bot automatically.
+

KeyboardButtonPollType

+

This object represents the type of a poll, which is allowed to be created and sent when the corresponding button is pressed.

+ + + + + + + + + + + + + + + +
FieldTypeDescription
typeStringOptional. If quiz is passed, the user will be allowed to create only polls in the quiz mode. If regular is passed, only regular polls will be allowed. Otherwise, the user will be allowed to create a poll of any type.
+

ReplyKeyboardRemove

+

Upon 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 bot. An exception is made for one-time keyboards that are hidden immediately after the user presses a button (see ReplyKeyboardMarkup). Not supported in channels and for messages sent on behalf of a business account.

+ + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
remove_keyboardTrueRequests clients to remove the custom keyboard (the user will not be able to summon this keyboard; if you want to hide the keyboard from sight but keep it accessible, use one_time_keyboard in ReplyKeyboardMarkup)
selectiveBooleanOptional. Use this parameter if you want to remove the keyboard for specific users only. Targets: 1) users that are @mentioned in the text of the Message object; 2) if the bot's message is a reply to a message in the same chat and forum topic, sender of the original message.

Example: A user votes in a poll, and the bot returns a confirmation message in reply to the vote and removes the keyboard for that user, while still showing the keyboard with poll options to users who haven't voted yet.
+

InlineKeyboardMarkup

+

This object represents an inline keyboard that appears right next to the message it belongs to.

+ + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
inline_keyboardArray of Array of InlineKeyboardButtonArray of button rows, each represented by an Array of InlineKeyboardButton objects
force_replyBooleanOptional. Pass True if the reply interface must be shown to the user, as if they had manually selected the bot's message and tapped 'Reply'. The value of the field can't be changed when the inline keyboard is edited.
+

InlineKeyboardButton

+

This 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.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
textStringLabel text on the button
icon_custom_emoji_idStringOptional. Unique identifier of the custom emoji shown before the text of the button. Can only be used by bots that purchased additional usernames on Fragment or in the messages directly sent by the bot to private, group and supergroup chats if the owner of the bot has a Telegram Premium subscription.
styleStringOptional. Style of the button. Must be one of “danger” (red), “success” (green) or “primary” (blue). If omitted, then an app-specific style is used.
urlStringOptional. HTTP or tg:// URL to be opened when the button is pressed. Links tg://user?id=<user_id> can be used to mention a user by their identifier without using a username, if this is allowed by their privacy settings.
callback_dataStringOptional. Data to be sent in a callback query to the bot when the button is pressed, 1-64 bytes
web_appWebAppInfoOptional. Description of the Web App that will be launched when the user presses the button. The Web App will be able to send an arbitrary message on behalf of the user using the method answerWebAppQuery. Available only in private chats between a user and the bot. Not supported for messages sent on behalf of a business account and ephemeral messages.
login_urlLoginUrlOptional. An HTTPS URL used to automatically authorize the user. Can be used as a replacement for the Telegram Login Widget. Not supported for ephemeral messages.
switch_inline_queryStringOptional. If set, pressing the button will prompt the user to select one of their chats, open that chat and insert the bot's username and the specified inline query in the input field. May be empty, in which case just the bot's username will be inserted. Not supported for messages sent in channel direct messages chats and on behalf of a business account.
switch_inline_query_current_chatStringOptional. If set, pressing the button will insert the bot's username and the specified inline query in the current chat's input field. May be empty, in which case only the bot's username will be inserted.

This offers a quick way for the user to open your bot in inline mode in the same chat - good for selecting something from multiple options. Not supported in channels and for messages sent in channel direct messages chats and on behalf of a business account.
switch_inline_query_chosen_chatSwitchInlineQueryChosenChatOptional. If set, pressing the button will prompt the user to select one of their chats of the specified type, open that chat and insert the bot's username and the specified inline query in the input field. Not supported for messages sent in channel direct messages chats and on behalf of a business account.
copy_textCopyTextButtonOptional. Description of the button that copies the specified text to the clipboard
callback_gameCallbackGameOptional. Description of the game that will be launched when the user presses the button.

NOTE: This type of button must always be the first button in the first row.
payBooleanOptional. Specify True to send a Pay button. Substrings “⭐” and “XTR” in the button's text will be replaced with a Telegram Star icon.

NOTE: This type of button must always be the first button in the first row and can only be used in invoice messages.
disabledDisabledButtonOptional. If set, then the button is disabled and does nothing
+

LoginUrl

+

This 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 needs to do is tap/click a button and confirm that they want to log in:

+
+ TITLE +
+ +
+

Sample bot: @DiscussBot

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
urlStringAn HTTPS URL to be opened with user authorization data added to the query string when the button is pressed. If the user refuses to provide authorization data, the original URL without information about the user will be opened. The data added is the same as described in Receiving authorization data.

NOTE: You must always check the hash of the received data to verify the authentication and the integrity of the data as described in Checking authorization.
forward_textStringOptional. New text of the button in forwarded messages
bot_usernameStringOptional. Username of a bot, which will be used for user authorization; not supported in RichMessageButton. See Setting up a bot for more details. If not specified, the current bot's username will be assumed. The url's domain must be the same as the domain linked with the bot. See Linking your domain to the bot for more details.
request_write_accessBooleanOptional. Pass True to request the permission for your bot to send messages to the user
+

SwitchInlineQueryChosenChat

+

This object represents an inline button that switches the current user to inline mode in a chosen chat, with an optional default inline query.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
queryStringOptional. The default inline query to be inserted in the input field. If left empty, only the bot's username will be inserted.
allow_user_chatsBooleanOptional. True, if private chats with users can be chosen
allow_bot_chatsBooleanOptional. True, if private chats with bots can be chosen
allow_group_chatsBooleanOptional. True, if group and supergroup chats can be chosen
allow_channel_chatsBooleanOptional. True, if channel chats can be chosen
+

CopyTextButton

+

This object represents an inline keyboard button that copies specified text to the clipboard.

+ + + + + + + + + + + + + + + +
FieldTypeDescription
textStringThe text to be copied to the clipboard; 1-256 characters
+

DisabledButton

+

This object represents a disabled button which does nothing. Currently holds no information.

+

CallbackQuery

+

This object represents an incoming callback query from a callback button in an inline keyboard or in a rich message. If the button that originated the query belongs to a message sent by the bot, the field message will be present, unless the field inline_message_id is used instead as specified by the parameter callback_query_mode of the method setMySettings. If the button belongs to a message sent via the bot (in inline mode), the field inline_message_id will be present. Exactly one of the fields data or game_short_name will be present.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
idStringUnique identifier for this query
fromUserSender
messageMaybeInaccessibleMessageOptional. Message sent by the bot with the callback button that originated the query
inline_message_idStringOptional. Identifier of the message sent via the bot in inline mode, that originated the query. Can also be present for messages sent by the bot, depending on the parameter callback_query_mode of the method setMySettings.
chat_instanceStringGlobal identifier, uniquely corresponding to the chat to which the message with the callback button was sent. Useful for high scores in games.
dataStringOptional. Data associated with the callback button. Be aware that the message that originated the query can contain no callback buttons with this data.
game_short_nameStringOptional. Short name of a Game to be returned, serves as the unique identifier for the game
+
+

NOTE: After the user presses a callback button, Telegram clients will display a progress bar until you call answerCallbackQuery. It is, therefore, necessary to react by calling answerCallbackQuery even if no notification to the user is needed (e.g., without specifying any of the optional parameters).

+
+

WidgetQueryType

+

This object describes the type of a query from a widget. Currently, it can be one of

+ +

WidgetQueryTypeData

+

The query contains data for the bot.

+ + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
typeStringType of the query, always “data”
wallet_cardTonWalletCardOptional. TON wallet card of the user who sent the query, if it was sent to the bot along with the query
+

WidgetQueryTypeSignData

+

The query contains data signed by a TON wallet of the user who sent the query. The data is signed for the domain bot<bot_id>, where <bot_id> is the identifier of the bot.

+ + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
typeStringType of the query, always “sign_data”
walletWidgetQueryWalletThe wallet that signed the data
sign_dataStringJSON-serialized signed data
+

WidgetQueryTypeSentTransaction

+

The query notifies the bot about a transaction sent from a TON wallet of the user who sent the query.

+ + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
typeStringType of the query, always “sent_transaction”
walletWidgetQueryWalletThe wallet from which the transaction was sent
msg_hashStringValue of msg_hash of the transaction
+

WidgetQueryWallet

+

This object describes a TON wallet of the user, which is used in a query from a widget.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
addressStringAddress of the wallet
amountStringBalance of the wallet, in the smallest units of the cryptocurrency, as a decimal number
public_keyStringOptional. Hex-encoded public key of the wallet; omitted if unknown
state_initStringOptional. Base64-encoded serialized StateInit of the wallet contract; omitted if and only if public_key is omitted
+

WidgetQuery

+

This 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 widgets.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
idStringUnique identifier for this query
fromUserSender
chatChatOptional. Chat with the message containing the widget; omitted if the widget is in an inline message
message_idIntegerOptional. Identifier of the message containing the widget; omitted if the widget is in an inline message
inline_message_idStringOptional. Identifier of the inline message containing the widget
chat_instanceStringGlobal identifier, uniquely corresponding to the chat to which the message with the widget was sent
chat_typeStringOptional. For widgets in inline messages, type of the chat to which the message was sent. Can be either “sender” for a private chat with the inline query sender, “private”, “group”, “supergroup”, or “channel”.
typeWidgetQueryTypeType of the query
dataStringData of the query, 1-64 bytes
widget_idStringOptional. Unique identifier of the shared widget, which sent the query; omitted if the widget isn't shared
+

SharedWidgetQuery

+

This 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 all its widgets.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
idStringUnique identifier for this query
fromUserSender
typeWidgetQueryTypeType of the query
dataStringData of the query, 1-64 bytes
widget_idStringUnique identifier of the shared widget, which sent the query
+

ForceReply

+

Upon 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 create user-friendly step-by-step interfaces without having to sacrifice privacy mode. Not supported in channels and for messages sent on behalf of a business account.

+ + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
force_replyTrueShows reply interface to the user, as if they had manually selected the bot's message and tapped 'Reply'
input_field_placeholderStringOptional. The placeholder to be shown in the input field when the reply is active; 1-64 characters
selectiveBooleanOptional. Use this parameter if you want to force reply from specific users only. Targets: 1) users that are @mentioned in the text of the Message object; 2) if the bot's message is a reply to a message in the same chat and forum topic, sender of the original message.
+
+

Example: A poll bot for groups runs in privacy mode (only receives commands, replies to its messages and mentions). There could be two ways to create a new poll:

+
    +
  • Explain to the user how to send a command with parameters (e.g. /newpoll question answer1 answer2). May be appealing for hardcore users but lacks modern-day polish.
  • +
  • Guide the user through a step-by-step process. 'Please send me your question', 'Cool, now let's add the first answer option', 'Great. Keep adding answer options, then send /done when you're ready'.
  • +
+

The last option is definitely more attractive. And if you use ForceReply in your bot's questions, it will receive the user's answers even if it only receives replies, commands and mentions - without any extra work for the user.

+
+

Community

+

Represents a community (a group of chats).

+ + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
idIntegerUnique identifier for this community. This number may have more than 32 significant bits and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a signed 64-bit integer or double-precision float type is safe for storing this identifier.
nameStringName of the community
+

ChatPhoto

+

This object represents a chat photo.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
small_file_idStringFile identifier of small (160x160) chat photo. This file_id can be used only for photo download and only for as long as the photo is not changed.
small_file_unique_idStringUnique file identifier of small (160x160) chat photo, which is supposed to be the same over time and for different bots. Can't be used to download or reuse the file.
big_file_idStringFile identifier of big (640x640) chat photo. This file_id can be used only for photo download and only for as long as the photo is not changed.
big_file_unique_idStringUnique file identifier of big (640x640) chat photo, which is supposed to be the same over time and for different bots. Can't be used to download or reuse the file.
+

ChatInviteLink

+

Represents an invite link for a chat.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
invite_linkStringThe invite link. If the link was created by another chat administrator, then the second part of the link will be replaced with “…”.
creatorUserCreator of the link
creates_join_requestBooleanTrue, if users joining the chat via the link need to be approved by chat administrators
is_primaryBooleanTrue, if the link is primary
is_revokedBooleanTrue, if the link is revoked
nameStringOptional. Invite link name
expire_dateIntegerOptional. Point in time (Unix timestamp) when the link will expire or has expired
member_limitIntegerOptional. The maximum number of users that can be members of the chat simultaneously after joining the chat via this invite link; 1-99999
pending_join_request_countIntegerOptional. Number of pending join requests created using this link
subscription_periodIntegerOptional. The number of seconds the subscription will be active for before the next payment
subscription_priceIntegerOptional. The amount of Telegram Stars a user must pay initially and after each subsequent subscription period to be a member of the chat using the link
+

ChatAdministratorRights

+

Represents the rights of an administrator in a chat.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
is_anonymousBooleanTrue, if the user's presence in the chat is hidden
can_manage_chatBooleanTrue, if the administrator can access the chat event log, get boost list, see hidden supergroup and channel members, report spam messages, ignore slow mode, and send messages to the chat without paying Telegram Stars. Implied by any other administrator privilege.
can_delete_messagesBooleanTrue, if the administrator can delete messages of other users
can_manage_video_chatsBooleanTrue, if the administrator can manage video chats
can_restrict_membersBooleanTrue, if the administrator can restrict, ban or unban chat members, or access supergroup statistics
can_promote_membersBooleanTrue, if the administrator can add new administrators with a subset of their own privileges or demote administrators that they have promoted, directly or indirectly (promoted by administrators that were appointed by the user)
can_change_infoBooleanTrue, if the user is allowed to change the chat title, photo and other settings
can_invite_usersBooleanTrue, if the user is allowed to invite new users to the chat
can_post_storiesBooleanTrue, if the administrator can post stories to the chat
can_edit_storiesBooleanTrue, if the administrator can edit stories posted by other users, post stories to the chat page, pin chat stories, and access the chat's story archive
can_delete_storiesBooleanTrue, if the administrator can delete stories posted by other users
can_post_messagesBooleanOptional. True, if the administrator can post messages in the channel, approve suggested posts, or access channel statistics; for channels only
can_edit_messagesBooleanOptional. True, if the administrator can edit messages of other users and can pin messages; for channels only
can_pin_messagesBooleanOptional. True, if the user is allowed to pin messages; for groups and supergroups only
can_manage_topicsBooleanOptional. True, if the user is allowed to create, rename, close, and reopen forum topics; for supergroups only
can_manage_direct_messagesBooleanOptional. True, if the administrator can manage direct messages of the channel and decline suggested posts; for channels only
can_manage_tagsBooleanOptional. True, if the administrator can edit the tags of regular members; for groups and supergroups only
can_send_welcome_messagesBooleanTrue, if the administrator can manage chat welcome messages or directly send them in the case of bots
+

ChatMemberUpdated

+

This object represents changes in the status of a chat member.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
chatChatChat the user belongs to
fromUserPerformer of the action, which resulted in the change
dateIntegerDate the change was done in Unix time
old_chat_memberChatMemberPrevious information about the chat member
new_chat_memberChatMemberNew information about the chat member
invite_linkChatInviteLinkOptional. Chat invite link, which was used by the user to join the chat; for joining by invite link events only
via_join_requestBooleanOptional. True, if the user joined the chat after sending a direct join request without using an invite link and being approved by an administrator
via_chat_folder_invite_linkBooleanOptional. True, if the user joined the chat via a chat folder invite link
+

ChatMember

+

This object contains information about one member of a chat. Currently, the following 6 types of chat members are supported:

+ +

ChatMemberOwner

+

Represents a chat member that owns the chat and has all administrator privileges.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
statusStringThe member's status in the chat, always “creator”
userUserInformation about the user
is_anonymousBooleanTrue, if the user's presence in the chat is hidden
custom_titleStringOptional. Custom title for this user
+

ChatMemberAdministrator

+

Represents a chat member that has some additional privileges.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
statusStringThe member's status in the chat, always “administrator”
userUserInformation about the user
can_be_editedBooleanTrue, if the bot is allowed to edit administrator privileges of that user
is_anonymousBooleanTrue, if the user's presence in the chat is hidden
can_manage_chatBooleanTrue, if the administrator can access the chat event log, get boost list, see hidden supergroup and channel members, report spam messages, ignore slow mode, and send messages to the chat without paying Telegram Stars. Implied by any other administrator privilege.
can_delete_messagesBooleanTrue, if the administrator can delete messages of other users
can_manage_video_chatsBooleanTrue, if the administrator can manage video chats
can_restrict_membersBooleanTrue, if the administrator can restrict, ban or unban chat members, or access supergroup statistics
can_promote_membersBooleanTrue, if the administrator can add new administrators with a subset of their own privileges or demote administrators that they have promoted, directly or indirectly (promoted by administrators that were appointed by the user)
can_change_infoBooleanTrue, if the user is allowed to change the chat title, photo and other settings
can_invite_usersBooleanTrue, if the user is allowed to invite new users to the chat
can_post_storiesBooleanTrue, if the administrator can post stories to the chat
can_edit_storiesBooleanTrue, if the administrator can edit stories posted by other users, post stories to the chat page, pin chat stories, and access the chat's story archive
can_delete_storiesBooleanTrue, if the administrator can delete stories posted by other users
can_post_messagesBooleanOptional. True, if the administrator can post messages in the channel, approve suggested posts, or access channel statistics; for channels only
can_edit_messagesBooleanOptional. True, if the administrator can edit messages of other users and can pin messages; for channels only
can_pin_messagesBooleanOptional. True, if the user is allowed to pin messages; for groups and supergroups only
can_manage_topicsBooleanOptional. True, if the user is allowed to create, rename, close, and reopen forum topics; for supergroups only
can_manage_direct_messagesBooleanOptional. True, if the administrator can manage direct messages of the channel and decline suggested posts; for channels only
can_manage_tagsBooleanOptional. True, if the administrator can edit the tags of regular members; for groups and supergroups only
can_send_welcome_messagesBooleanTrue, if the administrator can manage chat welcome messages or directly send them in the case of bots
custom_titleStringOptional. Custom title for this user
+

ChatMemberMember

+

Represents a chat member that has no additional privileges or restrictions.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
statusStringThe member's status in the chat, always “member”
tagStringOptional. Tag of the member
userUserInformation about the user
until_dateIntegerOptional. Date when the user's subscription will expire; Unix time
+

ChatMemberRestricted

+

Represents a chat member that is under certain restrictions in the chat. Supergroups only.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
statusStringThe member's status in the chat, always “restricted”
tagStringOptional. Tag of the member
userUserInformation about the user
is_memberBooleanTrue, if the user is a member of the chat at the moment of the request
can_send_messagesBooleanTrue, if the user is allowed to send text messages, rich messages, contacts, giveaways, giveaway winners, invoices, locations and venues
can_send_audiosBooleanTrue, if the user is allowed to send audios
can_send_documentsBooleanTrue, if the user is allowed to send documents
can_send_photosBooleanTrue, if the user is allowed to send photos
can_send_videosBooleanTrue, if the user is allowed to send videos
can_send_video_notesBooleanTrue, if the user is allowed to send video notes
can_send_voice_notesBooleanTrue, if the user is allowed to send voice notes
can_send_pollsBooleanTrue, if the user is allowed to send polls and checklists
can_send_other_messagesBooleanTrue, if the user is allowed to send animations, games, stickers, widgets and use inline bots
can_add_web_page_previewsBooleanTrue, if the user is allowed to add web page previews to their messages
can_react_to_messagesBooleanTrue, if the user is allowed to react to messages
can_edit_tagBooleanTrue, if the user is allowed to edit their own tag
can_change_infoBooleanTrue, if the user is allowed to change the chat title, photo and other settings
can_invite_usersBooleanTrue, if the user is allowed to invite new users to the chat
can_pin_messagesBooleanTrue, if the user is allowed to pin messages
can_manage_topicsBooleanTrue, if the user is allowed to create forum topics
until_dateIntegerDate when restrictions will be lifted for this user; Unix time. If 0, then the user is restricted forever.
+

ChatMemberLeft

+

Represents a chat member that isn't currently a member of the chat, but may join it themselves.

+ + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
statusStringThe member's status in the chat, always “left”
userUserInformation about the user
+

ChatMemberBanned

+

Represents a chat member that was banned in the chat and can't return to the chat or view chat messages.

+ + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
statusStringThe member's status in the chat, always “kicked”
userUserInformation about the user
until_dateIntegerDate when restrictions will be lifted for this user; Unix time. If 0, then the user is banned forever.
+

ChatJoinRequest

+

Represents a join request sent to a chat.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
chatChatChat to which the request was sent
fromUserUser that sent the join request
user_chat_idIntegerIdentifier of a private chat with the user who sent the join request. This number may have more than 32 significant bits and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a 64-bit integer or double-precision float type is safe for storing this identifier. The bot can use this identifier for 5 minutes to send messages until the join request is processed, assuming no other administrator contacted the user.
dateIntegerDate the request was sent in Unix time
bioStringOptional. Bio of the user
invite_linkChatInviteLinkOptional. Chat invite link that was used by the user to send the join request
query_idStringOptional. Identifier of the join request query; for bots assigned to process join requests only. If present, then the bot must call sendChatJoinRequestWebApp or directly call answerChatJoinRequestQuery within 10 seconds.
+

ChatPermissions

+

Describes actions that a non-administrator user is allowed to take in a chat.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
can_send_messagesBooleanOptional. True, if the user is allowed to send text messages, rich messages, contacts, giveaways, giveaway winners, invoices, locations and venues
can_send_audiosBooleanOptional. True, if the user is allowed to send audios
can_send_documentsBooleanOptional. True, if the user is allowed to send documents
can_send_photosBooleanOptional. True, if the user is allowed to send photos
can_send_videosBooleanOptional. True, if the user is allowed to send videos
can_send_video_notesBooleanOptional. True, if the user is allowed to send video notes
can_send_voice_notesBooleanOptional. True, if the user is allowed to send voice notes
can_send_pollsBooleanOptional. True, if the user is allowed to send polls and checklists
can_send_other_messagesBooleanOptional. True, if the user is allowed to send animations, games, stickers, widgets and use inline bots
can_add_web_page_previewsBooleanOptional. True, if the user is allowed to add web page previews to their messages
can_react_to_messagesBooleanOptional. True, if the user is allowed to react to messages. If omitted, defaults to the value of can_send_messages.
can_edit_tagBooleanOptional. True, if the user is allowed to edit their own tag. If omitted, defaults to the value of can_pin_messages.
can_change_infoBooleanOptional. True, if the user is allowed to change the chat title, photo and other settings. Ignored in public supergroups.
can_invite_usersBooleanOptional. True, if the user is allowed to invite new users to the chat
can_pin_messagesBooleanOptional. True, if the user is allowed to pin messages. Ignored in public supergroups.
can_manage_topicsBooleanOptional. True, if the user is allowed to create forum topics. If omitted, defaults to the value of can_pin_messages.
+

Birthdate

+

Describes the birthdate of a user.

+ + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
dayIntegerDay of the user's birth; 1-31
monthIntegerMonth of the user's birth; 1-12
yearIntegerOptional. Year of the user's birth
+

BusinessIntro

+

Contains information about the start page settings of a Telegram Business account.

+ + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
titleStringOptional. Title text of the business intro
messageStringOptional. Message text of the business intro
stickerStickerOptional. Sticker of the business intro
+

BusinessLocation

+

Contains information about the location of a Telegram Business account.

+ + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
addressStringAddress of the business
locationLocationOptional. Location of the business
+

BusinessOpeningHoursInterval

+

Describes an interval of time during which a business is open.

+ + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
opening_minuteIntegerThe minute's sequence number in a week, starting on Monday, marking the start of the time interval during which the business is open; 0 - 7 * 24 * 60
closing_minuteIntegerThe minute's sequence number in a week, starting on Monday, marking the end of the time interval during which the business is open; 0 - 8 * 24 * 60
+

BusinessOpeningHours

+

Describes the opening hours of a business.

+ + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
time_zone_nameStringUnique name of the time zone for which the opening hours are defined
opening_hoursArray of BusinessOpeningHoursIntervalList of time intervals describing business opening hours
+

UserRating

+

This object describes the rating of a user based on their Telegram Star spending.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
levelIntegerCurrent level of the user, indicating their reliability when purchasing digital goods and services. A higher level suggests a more trustworthy customer; a negative level is likely a reason for concern.
ratingIntegerNumerical value of the user's rating; the higher the rating, the better
current_level_ratingIntegerThe rating value required to get the current level
next_level_ratingIntegerOptional. The rating value required to get to the next level; omitted if the maximum level was reached
+

AreaPosition

+

Describes the position of a rectangle area on a story media or a TON wallet card.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
x_percentageFloatThe abscissa of the area's center, as a percentage of the media or the card width
y_percentageFloatThe ordinate of the area's center, as a percentage of the media or the card height
width_percentageFloatThe width of the area's rectangle, as a percentage of the media or the card width
height_percentageFloatThe height of the area's rectangle, as a percentage of the media or the card height
rotation_angleFloatThe clockwise rotation angle of the rectangle, in degrees; 0-360
corner_radius_percentageFloatThe radius of the rectangle corner rounding, as a percentage of the media or the card width
+

TonNft

+

This object represents an NFT in the TON blockchain.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
addressStringAddress of the NFT
collection_addressStringOptional. Address of the collection to which the NFT belongs; omitted if unknown
indexStringIndex of the NFT among all NFTs from the collection as a decimal number
nameStringName of the NFT
descriptionStringDescription of the NFT
attributesArray of TonNftAttributeOptional. Attributes of the NFT
giftUniqueGiftOptional. The unique gift corresponding to the NFT
+

TonNftAttribute

+

This object represents an attribute of an NFT in the TON blockchain.

+ + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
trait_typeStringTrait type of the attribute
valueStringValue of the attribute
+

TonWalletCardSticker

+

This object describes a sticker on a TON wallet card.

+ + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
positionAreaPositionPosition of the sticker on the card
nftTonNftThe NFT shown as the sticker
+

TonWalletCard

+

This object describes a TON wallet card, which is shown on the profile page of a user to everyone.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
addressStringAddress of the wallet
amountStringBalance of the wallet, in the smallest units of the cryptocurrency, as a decimal number
stickersArray of TonWalletCardStickerStickers placed on the card
background_nft_addressStringOptional. Address of the NFT of one of the stickers, whose colors must be used for the card background; omitted if the default background must be used
+

EmojiType

+

This object describes an emoji. Currently, it can be one of

+ +

EmojiTypeEmoji

+

A regular emoji.

+ + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
typeStringType of the emoji, always “emoji”
emojiStringThe emoji
+

EmojiTypeCustomEmoji

+

A custom emoji.

+ + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
typeStringType of the emoji, always “custom_emoji”
custom_emoji_idStringIdentifier of the custom emoji. Use getCustomEmojiStickers to get full information about the sticker.
+

ChatShareTheme

+

This object describes the theme of the screen for sharing a link to a user or a chat. Currently, it can be one of

+ +

ChatShareThemeEmoji

+

The theme with emoji placed on a background.

+ + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
typeStringType of the theme, always “emoji”
emojisArray of EmojiTypeThe emoji; 0-6 regular or custom emoji
background_backdrop_idIntegerOptional. Identifier of the backdrop used as the background; omitted if the default background is used. Use getChatShareThemeBackdrops to get details about the backdrop.
+

ChatShareThemeUniqueGift

+

The theme based on a unique gift owned by the user or the chat.

+ + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
typeStringType of the theme, always “unique_gift”
giftUniqueGiftThe gift
+

ChatShareThemeBackdrops

+

This 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.

+ + + + + + + + + + + + + + + +
FieldTypeDescription
backdropsArray of ChatShareThemeBackdropThe list of backdrops
+

ChatShareThemeBackdrop

+

This 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.

+ + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
idIntegerUnique identifier of the backdrop
nameStringName of the backdrop
colorsUniqueGiftBackdropColorsColors of the backdrop
+

LocationAddress

+

Describes the physical address of a location.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
country_codeStringThe two-letter ISO 3166-1 alpha-2 country code of the country where the location is located
stateStringOptional. State of the location
cityStringOptional. City of the location
streetStringOptional. Street address of the location
+

StoryAreaType

+

Describes the type of a clickable area on a story. Currently, it can be one of

+ +

StoryAreaTypeLocation

+

Describes a story area pointing to a location. Currently, a story can have up to 10 location areas.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
typeStringType of the area, always “location”
latitudeFloatLocation latitude in degrees
longitudeFloatLocation longitude in degrees
addressLocationAddressOptional. Address of the location
+

StoryAreaTypeSuggestedReaction

+

Describes a story area pointing to a suggested reaction. Currently, a story can have up to 5 suggested reaction areas.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
typeStringType of the area, always “suggested_reaction”
reaction_typeReactionTypeType of the reaction
is_darkBooleanOptional. Pass True if the reaction area has a dark background
is_flippedBooleanOptional. Pass True if the reaction area corner is flipped
+

StoryAreaTypeLink

+

Describes a story area pointing to an HTTP or tg:// link. Currently, a story can have up to 3 link areas.

+ + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
typeStringType of the area, always “link”
urlStringHTTP or tg:// URL to be opened when the area is clicked
+

StoryAreaTypeWeather

+

Describes a story area containing weather information. Currently, a story can have up to 3 weather areas.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
typeStringType of the area, always “weather”
temperatureFloatTemperature, in degrees Celsius
emojiStringEmoji representing the weather
background_colorIntegerA color of the area background in the ARGB format
+

StoryAreaTypeUniqueGift

+

Describes a story area pointing to a unique gift. Currently, a story can have at most 1 unique gift area.

+ + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
typeStringType of the area, always “unique_gift”
nameStringUnique name of the gift
+

StoryArea

+

Describes a clickable area on a story media.

+ + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
positionAreaPositionPosition of the area
typeStoryAreaTypeType of the area
+

ChatLocation

+

Represents a location to which a chat is connected.

+ + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
locationLocationThe location to which the supergroup is connected. Can't be a live location.
addressStringLocation address; 1-64 characters, as defined by the chat owner
+

ReactionType

+

This object describes the type of a reaction. Currently, it can be one of

+ +

ReactionTypeEmoji

+

The reaction is based on an emoji.

+ + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
typeStringType of the reaction, always “emoji”
emojiStringReaction emoji. Currently, it can be one of "❤", "👍", "👎", "🔥", "🥰", "👏", "😁", "🤔", "🤯", "😱", "🤬", "😢", "🎉", "🤩", "🤮", "💩", "🙏", "👌", "🕊", "🤡", "🥱", "🥴", "😍", "🐳", "❤‍🔥", "🌚", "🌭", "💯", "🤣", "⚡", "🍌", "🏆", "💔", "🤨", "😐", "🍓", "🍾", "💋", "🖕", "😈", "😴", "😭", "🤓", "👻", "👨‍💻", "👀", "🎃", "🙈", "😇", "😨", "🤝", "✍", "🤗", "🫡", "🎅", "🎄", "☃", "💅", "🤪", "🗿", "🆒", "💘", "🙉", "🦄", "😘", "💊", "🙊", "😎", "👾", "🤷‍♂", "🤷", "🤷‍♀", "😡".
+

ReactionTypeCustomEmoji

+

The reaction is based on a custom emoji.

+ + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
typeStringType of the reaction, always “custom_emoji”
custom_emoji_idStringCustom emoji identifier
+

ReactionTypePaid

+

The reaction is paid.

+ + + + + + + + + + + + + + + +
FieldTypeDescription
typeStringType of the reaction, always “paid”
+

ReactionCount

+

Represents a reaction added to a message along with the number of times it was added.

+ + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
typeReactionTypeType of the reaction
total_countIntegerNumber of times the reaction was added
+

MessageReactionUpdated

+

This object represents a change of a reaction on a message performed by a user.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
chatChatThe chat containing the message the user reacted to
message_idIntegerUnique identifier of the message inside the chat
userUserOptional. The user that changed the reaction, if the user isn't anonymous
actor_chatChatOptional. The chat on behalf of which the reaction was changed, if the user is anonymous
dateIntegerDate of the change in Unix time
old_reactionArray of ReactionTypePrevious list of reaction types that were set by the user
new_reactionArray of ReactionTypeNew list of reaction types that have been set by the user
+

MessageReactionCountUpdated

+

This object represents reaction changes on a message with anonymous reactions.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
chatChatThe chat containing the message
message_idIntegerUnique message identifier inside the chat
dateIntegerDate of the change in Unix time
reactionsArray of ReactionCountList of reactions that are present on the message
+

ForumTopic

+

This object represents a forum topic.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
message_thread_idIntegerUnique identifier of the forum topic
nameStringName of the topic
icon_colorIntegerColor of the topic icon in RGB format
icon_custom_emoji_idStringOptional. Unique identifier of the custom emoji shown as the topic icon
is_name_implicitTrueOptional. True, if the name of the topic wasn't specified explicitly by its creator and likely needs to be changed by the bot
+

GiftBackground

+

This object describes the background of a gift.

+ + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
center_colorIntegerCenter color of the background in RGB format
edge_colorIntegerEdge color of the background in RGB format
text_colorIntegerText color of the background in RGB format
+

Gift

+

This object represents a gift that can be sent by the bot.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
idStringUnique identifier of the gift
stickerStickerThe sticker that represents the gift
star_countIntegerThe number of Telegram Stars that must be paid to send the sticker
upgrade_star_countIntegerOptional. The number of Telegram Stars that must be paid to upgrade the gift to a unique one
is_premiumTrueOptional. True, if the gift can only be purchased by Telegram Premium subscribers
has_colorsTrueOptional. True, if the gift can be used (after being upgraded) to customize a user's appearance
total_countIntegerOptional. The total number of gifts of this type that can be sent by all users; for limited gifts only
remaining_countIntegerOptional. The number of remaining gifts of this type that can be sent by all users; for limited gifts only
personal_total_countIntegerOptional. The total number of gifts of this type that can be sent by the bot; for limited gifts only
personal_remaining_countIntegerOptional. The number of remaining gifts of this type that can be sent by the bot; for limited gifts only
backgroundGiftBackgroundOptional. Background of the gift
unique_gift_variant_countIntegerOptional. The total number of different unique gifts that can be obtained by upgrading the gift
publisher_chatChatOptional. Information about the chat that published the gift
+

Gifts

+

This object represents a list of gifts.

+ + + + + + + + + + + + + + + +
FieldTypeDescription
giftsArray of GiftThe list of gifts
+

UniqueGiftModel

+

This object describes the model of a unique gift.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
nameStringName of the model
stickerStickerThe sticker that represents the unique gift
rarity_per_milleIntegerThe number of unique gifts that receive this model for every 1000 gift upgrades. Always 0 for crafted gifts.
rarityStringOptional. Rarity of the model if it is a crafted model. Currently, can be “uncommon”, “rare”, “epic”, or “legendary”.
+

UniqueGiftSymbol

+

This object describes the symbol shown on the pattern of a unique gift.

+ + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
nameStringName of the symbol
stickerStickerThe sticker that represents the unique gift
rarity_per_milleIntegerThe number of unique gifts that receive this symbol for every 1000 gifts upgraded
+

UniqueGiftBackdropColors

+

This object describes the colors of the backdrop of a unique gift.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
center_colorIntegerThe color in the center of the backdrop in RGB format
edge_colorIntegerThe color on the edges of the backdrop in RGB format
symbol_colorIntegerThe color to be applied to the symbol in RGB format
text_colorIntegerThe color for the text on the backdrop in RGB format
+

UniqueGiftBackdrop

+

This object describes the backdrop of a unique gift.

+ + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
nameStringName of the backdrop
colorsUniqueGiftBackdropColorsColors of the backdrop
rarity_per_milleIntegerThe number of unique gifts that receive this backdrop for every 1000 gifts upgraded
+

UniqueGiftColors

+

This object contains information about the color scheme for a user's name, message replies and link previews based on a unique gift.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
model_custom_emoji_idStringCustom emoji identifier of the unique gift's model
symbol_custom_emoji_idStringCustom emoji identifier of the unique gift's symbol
light_theme_main_colorIntegerMain color used in light themes; RGB format
light_theme_other_colorsArray of IntegerList of 1-3 additional colors used in light themes; RGB format
dark_theme_main_colorIntegerMain color used in dark themes; RGB format
dark_theme_other_colorsArray of IntegerList of 1-3 additional colors used in dark themes; RGB format
+

UniqueGift

+

This object describes a unique gift that was upgraded from a regular gift.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
gift_idStringIdentifier of the regular gift from which the gift was upgraded
base_nameStringHuman-readable name of the regular gift from which this unique gift was upgraded
nameStringUnique name of the gift. This name can be used in https://t.me/nft/... links and story areas.
numberIntegerUnique number of the upgraded gift among gifts upgraded from the same regular gift
modelUniqueGiftModelModel of the gift
symbolUniqueGiftSymbolSymbol of the gift
backdropUniqueGiftBackdropBackdrop of the gift
is_premiumTrueOptional. True, if the original regular gift was exclusively purchasable by Telegram Premium subscribers
is_burnedTrueOptional. True, if the gift was used to craft another gift and isn't available anymore
is_from_blockchainTrueOptional. True, if the gift is assigned from the TON blockchain and can't be resold or transferred in Telegram
colorsUniqueGiftColorsOptional. The color scheme that can be used by the gift's owner for the chat's name, replies to messages and link previews; for business account gifts and gifts that are currently on sale only
publisher_chatChatOptional. Information about the chat that published the gift
+

GiftInfo

+

Describes a service message about a regular gift that was sent or received.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
giftGiftInformation about the gift
owned_gift_idStringOptional. Unique identifier of the received gift for the bot; only present for gifts received on behalf of business accounts
convert_star_countIntegerOptional. Number of Telegram Stars that can be claimed by the receiver by converting the gift; omitted if conversion to Telegram Stars is impossible
prepaid_upgrade_star_countIntegerOptional. Number of Telegram Stars that were prepaid for the ability to upgrade the gift
is_upgrade_separateTrueOptional. True, if the gift's upgrade was purchased after the gift was sent
can_be_upgradedTrueOptional. True, if the gift can be upgraded to a unique gift
textStringOptional. Text of the message that was added to the gift
entitiesArray of MessageEntityOptional. Special entities that appear in the text
is_privateTrueOptional. True, if the sender and gift text are shown only to the gift receiver; otherwise, everyone will be able to see them
unique_gift_numberIntegerOptional. Unique number reserved for this gift when upgraded. See the number field in UniqueGift.
+

UniqueGiftInfo

+

Describes a service message about a unique gift that was sent or received.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
giftUniqueGiftInformation about the gift
originStringOrigin of the gift. Currently, either “upgrade” for gifts upgraded from regular gifts, “transfer” for gifts transferred from other users or channels, “resale” for gifts bought from other users, “gifted_upgrade” for upgrades purchased after the gift was sent, or “offer” for gifts bought or sold through gift purchase offers.
textStringOptional. Text of the message that was added to the gift
entitiesArray of MessageEntityOptional. Special entities that appear in the text
is_privateTrueOptional. True, if the sender and gift text are shown only to the gift receiver; otherwise, everyone will be able to see them
last_resale_currencyStringOptional. For gifts bought from other users, the currency in which the payment for the gift was done. Currently, one of “XTR” for Telegram Stars or “TON” for TON grams.
last_resale_amountIntegerOptional. For gifts bought from other users, the price paid for the gift in either Telegram Stars or nanograms
owned_gift_idStringOptional. Unique identifier of the received gift for the bot; only present for gifts received on behalf of business accounts
transfer_star_countIntegerOptional. Number of Telegram Stars that must be paid to transfer the gift; omitted if the bot cannot transfer the gift
next_transfer_dateIntegerOptional. Point in time (Unix timestamp) when the gift can be transferred. If it is in the past, then the gift can be transferred now.
+

OwnedGift

+

This object describes a gift received and owned by a user or a chat. Currently, it can be one of

+ +

OwnedGiftRegular

+

Describes a regular gift owned by a user or a chat.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
typeStringType of the gift, always “regular”
giftGiftInformation about the regular gift
owned_gift_idStringOptional. Unique identifier of the gift for the bot; for gifts received on behalf of business accounts only
sender_userUserOptional. Sender of the gift if it is a known user
send_dateIntegerDate the gift was sent in Unix time
textStringOptional. Text of the message that was added to the gift
entitiesArray of MessageEntityOptional. Special entities that appear in the text
is_privateTrueOptional. True, if the sender and gift text are shown only to the gift receiver; otherwise, everyone will be able to see them
is_savedTrueOptional. True, if the gift is displayed on the account's profile page; for gifts received on behalf of business accounts only
can_be_upgradedTrueOptional. True, if the gift can be upgraded to a unique gift; for gifts received on behalf of business accounts only
was_refundedTrueOptional. True, if the gift was refunded and isn't available anymore
convert_star_countIntegerOptional. Number of Telegram Stars that can be claimed by the receiver instead of the gift; omitted if the gift cannot be converted to Telegram Stars; for gifts received on behalf of business accounts only
prepaid_upgrade_star_countIntegerOptional. Number of Telegram Stars that were paid for the ability to upgrade the gift
is_upgrade_separateTrueOptional. True, if the gift's upgrade was purchased after the gift was sent; for gifts received on behalf of business accounts only
unique_gift_numberIntegerOptional. Unique number reserved for this gift when upgraded. See the number field in UniqueGift.
+

OwnedGiftUnique

+

Describes a unique gift received and owned by a user or a chat.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
typeStringType of the gift, always “unique”
giftUniqueGiftInformation about the unique gift
owned_gift_idStringOptional. Unique identifier of the received gift for the bot; for gifts received on behalf of business accounts only
sender_userUserOptional. Sender of the gift if it is a known user
send_dateIntegerDate the gift was sent in Unix time
is_savedTrueOptional. True, if the gift is displayed on the account's profile page; for gifts received on behalf of business accounts only
can_be_transferredTrueOptional. True, if the gift can be transferred to another owner; for gifts received on behalf of business accounts only
transfer_star_countIntegerOptional. Number of Telegram Stars that must be paid to transfer the gift; omitted if the bot cannot transfer the gift
next_transfer_dateIntegerOptional. Point in time (Unix timestamp) when the gift can be transferred. If it is in the past, then the gift can be transferred now.
+

OwnedGifts

+

Contains the list of gifts received and owned by a user or a chat.

+ + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
total_countIntegerThe total number of gifts owned by the user or the chat
giftsArray of OwnedGiftThe list of gifts
next_offsetStringOptional. Offset for the next request. If empty, then there are no more results.
+

BotAccessSettings

+

This object describes the access settings of a bot.

+ + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
is_access_restrictedBooleanTrue, if only selected users can access the bot. The bot's owner can always access it.
added_usersArray of UserOptional. The list of other users who have access to the bot if the access is restricted
+

AcceptedGiftTypes

+

This object describes the types of gifts that can be gifted to a user or a chat.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
unlimited_giftsBooleanTrue, if unlimited regular gifts are accepted
limited_giftsBooleanTrue, if limited regular gifts are accepted
unique_giftsBooleanTrue, if unique gifts or gifts that can be upgraded to unique for free are accepted
premium_subscriptionBooleanTrue, if a Telegram Premium subscription is accepted
gifts_from_channelsBooleanTrue, if transfers of unique gifts from channels are accepted
+

StarAmount

+

Describes an amount of Telegram Stars.

+ + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
amountIntegerInteger amount of Telegram Stars, rounded to 0; can be negative
nanostar_amountIntegerOptional. The number of 1/1000000000 shares of Telegram Stars; from -999999999 to 999999999; can be negative if and only if amount is non-positive
+

BotCommand

+

This object represents a bot command.

+ + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
commandStringText of the command; 1-32 characters. Can contain only lowercase English letters, digits and underscores.
descriptionStringDescription of the command; 1-256 characters
is_ephemeralBooleanOptional. True, if the command sends an ephemeral message, which can be seen only by the sender of the message and the bot
+

BotCommandScope

+

This object represents the scope to which bot commands are applied. Currently, the following 7 scopes are supported:

+ +

Determining list of commands

+

The 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:

+

Commands in the chat with the bot

+
    +
  • botCommandScopeChat + language_code
  • +
  • botCommandScopeChat
  • +
  • botCommandScopeAllPrivateChats + language_code
  • +
  • botCommandScopeAllPrivateChats
  • +
  • botCommandScopeDefault + language_code
  • +
  • botCommandScopeDefault
  • +
+

Commands in group and supergroup chats

+
    +
  • botCommandScopeChatMember + language_code
  • +
  • botCommandScopeChatMember
  • +
  • botCommandScopeChatAdministrators + language_code (administrators only)
  • +
  • botCommandScopeChatAdministrators (administrators only)
  • +
  • botCommandScopeChat + language_code
  • +
  • botCommandScopeChat
  • +
  • botCommandScopeAllChatAdministrators + language_code (administrators only)
  • +
  • botCommandScopeAllChatAdministrators (administrators only)
  • +
  • botCommandScopeAllGroupChats + language_code
  • +
  • botCommandScopeAllGroupChats
  • +
  • botCommandScopeDefault + language_code
  • +
  • botCommandScopeDefault
  • +
+

BotCommandScopeDefault

+

Represents the default scope of bot commands. Default commands are used if no commands with a narrower scope are specified for the user.

+ + + + + + + + + + + + + + + +
FieldTypeDescription
typeStringScope type, must be default
+

BotCommandScopeAllPrivateChats

+

Represents the scope of bot commands, covering all private chats.

+ + + + + + + + + + + + + + + +
FieldTypeDescription
typeStringScope type, must be all_private_chats
+

BotCommandScopeAllGroupChats

+

Represents the scope of bot commands, covering all group and supergroup chats.

+ + + + + + + + + + + + + + + +
FieldTypeDescription
typeStringScope type, must be all_group_chats
+

BotCommandScopeAllChatAdministrators

+

Represents the scope of bot commands, covering all group and supergroup chat administrators.

+ + + + + + + + + + + + + + + +
FieldTypeDescription
typeStringScope type, must be all_chat_administrators
+

BotCommandScopeChat

+

Represents the scope of bot commands, covering a specific chat.

+ + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
typeStringScope type, must be chat
chat_idInteger or StringUnique identifier for the target chat or username of the target supergroup in the format @username. Channel direct messages chats and channel chats aren't supported.
+

BotCommandScopeChatAdministrators

+

Represents the scope of bot commands, covering all administrators of a specific group or supergroup chat.

+ + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
typeStringScope type, must be chat_administrators
chat_idInteger or StringUnique identifier for the target chat or username of the target supergroup in the format @username. Channel direct messages chats and channel chats aren't supported.
+

BotCommandScopeChatMember

+

Represents the scope of bot commands, covering a specific member of a group or supergroup chat.

+ + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
typeStringScope type, must be chat_member
chat_idInteger or StringUnique identifier for the target chat or username of the target supergroup in the format @username. Channel direct messages chats and channel chats aren't supported.
user_idIntegerUnique identifier of the target user
+

BotName

+

This object represents the bot's name.

+ + + + + + + + + + + + + + + +
FieldTypeDescription
nameStringThe bot's name
+

BotDescription

+

This object represents the bot's description.

+ + + + + + + + + + + + + + + +
FieldTypeDescription
descriptionStringThe bot's description
+

BotShortDescription

+

This object represents the bot's short description.

+ + + + + + + + + + + + + + + +
FieldTypeDescription
short_descriptionStringThe bot's short description
+

MenuButton

+

This object describes the bot's menu button in a private chat. It should be one of

+ +

If a menu button other than MenuButtonDefault is set for a private chat, then it is applied in the chat. Otherwise the default menu button is applied. By default, the menu button opens the list of bot commands.

+

MenuButtonCommands

+

Represents a menu button, which opens the bot's list of commands.

+ + + + + + + + + + + + + + + +
FieldTypeDescription
typeStringType of the button, must be commands
+

MenuButtonWebApp

+

Represents a menu button, which launches a Web App.

+ + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
typeStringType of the button, must be web_app
textStringText on the button
web_appWebAppInfoDescription of the Web App that will be launched when the user presses the button. The Web App will be able to send an arbitrary message on behalf of the user using the method answerWebAppQuery. Alternatively, a t.me link to a Web App of the bot can be specified in the object instead of the Web App's URL, in which case the Web App will be opened as if the user pressed the link.
+

MenuButtonDefault

+

Describes that no specific value for the menu button was set.

+ + + + + + + + + + + + + + + +
FieldTypeDescription
typeStringType of the button, must be default
+

ChatBoostSource

+

This object describes the source of a chat boost. It can be one of

+ +

ChatBoostSourcePremium

+

The boost was obtained by subscribing to Telegram Premium or by gifting a Telegram Premium subscription to another user.

+ + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
sourceStringSource of the boost, always “premium”
userUserUser that boosted the chat
+

ChatBoostSourceGiftCode

+

The 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.

+ + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
sourceStringSource of the boost, always “gift_code”
userUserUser for whom the gift code was created
+

ChatBoostSourceGiveaway

+

The 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 and prize_star_count / 500 times for one year for Telegram Star giveaways.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
sourceStringSource of the boost, always “giveaway”
giveaway_message_idIntegerIdentifier of a message in the chat with the giveaway; the message could have been deleted already. May be 0 if the message isn't sent yet.
userUserOptional. User that won the prize in the giveaway if any; for Telegram Premium giveaways only
prize_star_countIntegerOptional. The number of Telegram Stars to be split between giveaway winners; for Telegram Star giveaways only
is_unclaimedTrueOptional. True, if the giveaway was completed, but there was no user to win the prize
+

ChatBoost

+

This object contains information about a chat boost.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
boost_idStringUnique identifier of the boost
add_dateIntegerPoint in time (Unix timestamp) when the chat was boosted
expiration_dateIntegerPoint in time (Unix timestamp) when the boost will automatically expire, unless the booster's Telegram Premium subscription is prolonged
sourceChatBoostSourceSource of the added boost
+

ChatBoostUpdated

+

This object represents a boost added to a chat or changed.

+ + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
chatChatChat which was boosted
boostChatBoostInformation about the chat boost
+

ChatBoostRemoved

+

This object represents a boost removed from a chat.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
chatChatChat which was boosted
boost_idStringUnique identifier of the boost
remove_dateIntegerPoint in time (Unix timestamp) when the boost was removed
sourceChatBoostSourceSource of the removed boost
+

ChatOwnerLeft

+

Describes a service message about the chat owner leaving the chat.

+ + + + + + + + + + + + + + + +
FieldTypeDescription
new_ownerUserOptional. The user who will become the new owner of the chat if the previous owner does not return to the chat
+

ChatOwnerChanged

+

Describes a service message about an ownership change in the chat.

+ + + + + + + + + + + + + + + +
FieldTypeDescription
new_ownerUserThe new owner of the chat
+

UserChatBoosts

+

This object represents a list of boosts added to a chat by a user.

+ + + + + + + + + + + + + + + +
FieldTypeDescription
boostsArray of ChatBoostThe list of boosts added to the chat by the user
+

BusinessBotRights

+

Represents the rights of a business bot.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
can_replyTrueOptional. True, if the bot can send and edit messages in the private chats that had incoming messages in the last 24 hours
can_read_messagesTrueOptional. True, if the bot can mark incoming private messages as read
can_delete_sent_messagesTrueOptional. True, if the bot can delete messages sent by the bot
can_delete_all_messagesTrueOptional. True, if the bot can delete all private messages in managed chats
can_edit_nameTrueOptional. True, if the bot can edit the first and last name of the business account
can_edit_bioTrueOptional. True, if the bot can edit the bio of the business account
can_edit_profile_photoTrueOptional. True, if the bot can edit the profile photo of the business account
can_edit_usernameTrueOptional. True, if the bot can edit the username of the business account
can_change_gift_settingsTrueOptional. True, if the bot can change the privacy settings pertaining to gifts for the business account
can_view_gifts_and_starsTrueOptional. True, if the bot can view gifts and the amount of Telegram Stars owned by the business account
can_convert_gifts_to_starsTrueOptional. True, if the bot can convert regular gifts owned by the business account to Telegram Stars
can_transfer_and_upgrade_giftsTrueOptional. True, if the bot can transfer and upgrade gifts owned by the business account
can_transfer_starsTrueOptional. True, if the bot can transfer Telegram Stars received by the business account to its own account, or use them to upgrade and transfer gifts
can_manage_storiesTrueOptional. True, if the bot can post, edit and delete stories on behalf of the business account
+

BusinessConnection

+

Describes the connection of the bot with a business account.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
idStringUnique identifier of the business connection
userUserBusiness account user that created the business connection
user_chat_idIntegerIdentifier of a private chat with the user who created the business connection. This number may have more than 32 significant bits and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a 64-bit integer or double-precision float type is safe for storing this identifier.
dateIntegerDate the connection was established in Unix time
rightsBusinessBotRightsOptional. Rights of the business bot
is_enabledBooleanTrue, if the connection is active
+

BusinessMessagesDeleted

+

This object is received when messages are deleted from a connected business account.

+ + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
business_connection_idStringUnique identifier of the business connection
chatChatInformation about a chat in the business account. The bot may not have access to the chat or the corresponding user.
message_idsArray of IntegerThe list of identifiers of deleted messages in the chat of the business account
+

SentWebAppMessage

+

Describes an inline message sent by a Web App on behalf of a user.

+ + + + + + + + + + + + + + + +
FieldTypeDescription
inline_message_idStringOptional. Identifier of the sent inline message. Available only if there is an inline keyboard attached to the message.
+

SentGuestMessage

+

Describes an inline message sent by a guest bot.

+ + + + + + + + + + + + + + + +
FieldTypeDescription
inline_message_idStringIdentifier of the sent inline message
+

PreparedInlineMessage

+

Describes an inline message to be sent by a user of a Mini App.

+ + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
idStringUnique identifier of the prepared message
expiration_dateIntegerExpiration date of the prepared message, in Unix time. Expired prepared messages can no longer be used.
+

PreparedKeyboardButton

+

Describes a keyboard button to be used by a user of a Mini App.

+ + + + + + + + + + + + + + + +
FieldTypeDescription
idStringUnique identifier of the keyboard button
+

ResponseParameters

+

Describes why a request was unsuccessful.

+ + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
migrate_to_chat_idIntegerOptional. The group has been migrated to a supergroup with the specified identifier. This number may have more than 32 significant bits and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a signed 64-bit integer or double-precision float type is safe for storing this identifier.
retry_afterIntegerOptional. In case of exceeding flood control, the number of seconds left to wait before the request can be repeated
+

InputMedia

+

This object represents the content of a media message to be sent. It should be one of

+ +

InputMediaAnimation

+

Represents an animation file (GIF or H.264/MPEG-4 AVC video without sound) to be sent.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
typeStringType of the media, must be animation
mediaStringFile to send. Pass a file_id to send a file that exists on the Telegram servers (recommended), pass an HTTP URL for Telegram to get a file from the Internet, or pass “attach://<file_attach_name>” to upload a new one using multipart/form-data under <file_attach_name> name. More information on Sending Files »
thumbnailStringOptional. Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can only be uploaded as a new file, so you can pass “attach://<file_attach_name>” if the thumbnail was uploaded using multipart/form-data under <file_attach_name>. More information on Sending Files »
captionStringOptional. Caption of the animation to be sent, 0-1024 characters after entities parsing
parse_modeStringOptional. Mode for parsing entities in the animation caption. See formatting options for more details.
caption_entitiesArray of MessageEntityOptional. List of special entities that appear in the caption, which can be specified instead of parse_mode
show_caption_above_mediaBooleanOptional. Pass True if the caption must be shown above the message media
widthIntegerOptional. Animation width
heightIntegerOptional. Animation height
durationIntegerOptional. Animation duration in seconds
has_spoilerBooleanOptional. Pass True if the animation needs to be covered with a spoiler animation
+

InputMediaAudio

+

Represents an audio file to be treated as music to be sent.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
typeStringType of the media, must be audio
mediaStringFile to send. Pass a file_id to send a file that exists on the Telegram servers (recommended), pass an HTTP URL for Telegram to get a file from the Internet, or pass “attach://<file_attach_name>” to upload a new one using multipart/form-data under <file_attach_name> name. More information on Sending Files »
thumbnailStringOptional. Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can only be uploaded as a new file, so you can pass “attach://<file_attach_name>” if the thumbnail was uploaded using multipart/form-data under <file_attach_name>. More information on Sending Files »
captionStringOptional. Caption of the audio to be sent, 0-1024 characters after entities parsing
parse_modeStringOptional. Mode for parsing entities in the audio caption. See formatting options for more details.
caption_entitiesArray of MessageEntityOptional. List of special entities that appear in the caption, which can be specified instead of parse_mode
durationIntegerOptional. Duration of the audio in seconds
performerStringOptional. Performer of the audio
titleStringOptional. Title of the audio
+

InputMediaDocument

+

Represents a general file to be sent.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
typeStringType of the media, must be document
mediaStringFile to send. Pass a file_id to send a file that exists on the Telegram servers (recommended), pass an HTTP URL for Telegram to get a file from the Internet, or pass “attach://<file_attach_name>” to upload a new one using multipart/form-data under <file_attach_name> name. More information on Sending Files »
thumbnailStringOptional. Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can only be uploaded as a new file, so you can pass “attach://<file_attach_name>” if the thumbnail was uploaded using multipart/form-data under <file_attach_name>. More information on Sending Files »
captionStringOptional. Caption of the document to be sent, 0-1024 characters after entities parsing
parse_modeStringOptional. Mode for parsing entities in the document caption. See formatting options for more details.
caption_entitiesArray of MessageEntityOptional. List of special entities that appear in the caption, which can be specified instead of parse_mode
disable_content_type_detectionBooleanOptional. Disables automatic server-side content type detection for files uploaded using multipart/form-data. Always True, if the document is sent as part of an album.
+

InputMediaLink

+

Represents an HTTP link to be sent.

+ + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
typeStringType of the media, must be link
urlStringHTTP URL of the link
+

InputMediaLivePhoto

+

Represents a live photo to be sent.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
typeStringType of the media, must be live_photo
mediaStringVideo of the live photo to send. Pass a file_id to send a file that exists on the Telegram servers (recommended) or pass “attach://<file_attach_name>” to upload a new one using multipart/form-data under <file_attach_name> name. More information on Sending Files ». Sending live photos by a URL is currently unsupported.
photoStringThe static photo to send. Pass a file_id to send a file that exists on the Telegram servers (recommended) or pass “attach://<file_attach_name>” to upload a new one using multipart/form-data under <file_attach_name> name. More information on Sending Files ». Sending live photos by a URL is currently unsupported.
captionStringOptional. Caption of the live photo to be sent, 0-1024 characters after entities parsing
parse_modeStringOptional. Mode for parsing entities in the live photo caption. See formatting options for more details.
caption_entitiesArray of MessageEntityOptional. List of special entities that appear in the caption, which can be specified instead of parse_mode
show_caption_above_mediaBooleanOptional. Pass True if the caption must be shown above the message media
has_spoilerBooleanOptional. Pass True if the live photo needs to be covered with a spoiler animation
+

InputMediaLocation

+

Represents a location to be sent.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
typeStringType of the media, must be location
latitudeFloatLatitude of the location
longitudeFloatLongitude of the location
horizontal_accuracyFloatOptional. The radius of uncertainty for the location, measured in meters; 0-1500
+

InputMediaPhoto

+

Represents a photo to be sent.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
typeStringType of the media, must be photo
mediaStringFile to send. Pass a file_id to send a file that exists on the Telegram servers (recommended), pass an HTTP URL for Telegram to get a file from the Internet, or pass “attach://<file_attach_name>” to upload a new one using multipart/form-data under <file_attach_name> name. More information on Sending Files »
captionStringOptional. Caption of the photo to be sent, 0-1024 characters after entities parsing
parse_modeStringOptional. Mode for parsing entities in the photo caption. See formatting options for more details.
caption_entitiesArray of MessageEntityOptional. List of special entities that appear in the caption, which can be specified instead of parse_mode
show_caption_above_mediaBooleanOptional. Pass True if the caption must be shown above the message media
has_spoilerBooleanOptional. Pass True if the photo needs to be covered with a spoiler animation
+

InputMediaSticker

+

Represents a sticker file to be sent.

+ + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
typeStringType of the media, must be sticker
mediaStringFile to send. Pass a file_id to send a file that exists on the Telegram servers (recommended), pass an HTTP URL for Telegram to get a .WEBP sticker from the Internet, or pass “attach://<file_attach_name>” to upload a new .WEBP, .TGS, or .WEBM sticker using multipart/form-data under <file_attach_name> name. More information on Sending Files »
emojiStringOptional. Emoji associated with the sticker; only for just uploaded stickers
+

InputMediaVenue

+

Represents a venue to be sent.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
typeStringType of the media, must be venue
latitudeFloatLatitude of the location
longitudeFloatLongitude of the location
titleStringName of the venue
addressStringAddress of the venue
foursquare_idStringOptional. Foursquare identifier of the venue
foursquare_typeStringOptional. Foursquare type of the venue, if known. (For example, “arts_entertainment/default”, “arts_entertainment/aquarium” or “food/icecream”.)
google_place_idStringOptional. Google Places identifier of the venue
google_place_typeStringOptional. Google Places type of the venue. (See supported types.)
+

InputMediaVideo

+

Represents a video to be sent.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
typeStringType of the media, must be video
mediaStringFile to send. Pass a file_id to send a file that exists on the Telegram servers (recommended), pass an HTTP URL for Telegram to get a file from the Internet, or pass “attach://<file_attach_name>” to upload a new one using multipart/form-data under <file_attach_name> name. More information on Sending Files »
thumbnailStringOptional. Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can only be uploaded as a new file, so you can pass “attach://<file_attach_name>” if the thumbnail was uploaded using multipart/form-data under <file_attach_name>. More information on Sending Files »
coverStringOptional. Cover for the video in the message. Pass a file_id to send a file that exists on the Telegram servers (recommended), pass an HTTP URL for Telegram to get a file from the Internet, or pass “attach://<file_attach_name>” to upload a new one using multipart/form-data under <file_attach_name> name. More information on Sending Files »
start_timestampIntegerOptional. Start timestamp for the video in the message
captionStringOptional. Caption of the video to be sent, 0-1024 characters after entities parsing
parse_modeStringOptional. Mode for parsing entities in the video caption. See formatting options for more details.
caption_entitiesArray of MessageEntityOptional. List of special entities that appear in the caption, which can be specified instead of parse_mode
show_caption_above_mediaBooleanOptional. Pass True if the caption must be shown above the message media
widthIntegerOptional. Video width
heightIntegerOptional. Video height
durationIntegerOptional. Video duration in seconds
supports_streamingBooleanOptional. Pass True if the uploaded video is suitable for streaming
has_spoilerBooleanOptional. Pass True if the video needs to be covered with a spoiler animation
+

InputMediaVoiceNote

+

Represents a voice message file to be sent.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
typeStringType of the media, must be voice_note
mediaStringFile to send. Pass a file_id to send a file that exists on the Telegram servers (recommended), pass an HTTP URL for Telegram to get a file from the Internet, or pass “attach://<file_attach_name>” to upload a new one using multipart/form-data under <file_attach_name> name. More information on Sending Files »
captionStringOptional. Caption of the voice message to be sent, 0-1024 characters after entities parsing
parse_modeStringOptional. Mode for parsing entities in the voice message caption. See formatting options for more details.
caption_entitiesArray of MessageEntityOptional. List of special entities that appear in the caption, which can be specified instead of parse_mode
durationIntegerOptional. Duration of the voice message in seconds
+

InputFile

+

This 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.

+

InputPaidMedia

+

This object describes the paid media to be sent. Currently, it can be one of

+ +

InputPaidMediaLivePhoto

+

The paid media to send is a live photo.

+ + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
typeStringType of the media, must be live_photo
mediaStringVideo of the live photo to send. Pass a file_id to send a file that exists on the Telegram servers (recommended) or pass “attach://<file_attach_name>” to upload a new one using multipart/form-data under <file_attach_name> name. More information on Sending Files ». Sending live photos by a URL is currently unsupported.
photoStringThe static photo to send. Pass a file_id to send a file that exists on the Telegram servers (recommended) or pass “attach://<file_attach_name>” to upload a new one using multipart/form-data under <file_attach_name> name. More information on Sending Files ». Sending live photos by a URL is currently unsupported.
+

InputPaidMediaPhoto

+

The paid media to send is a photo.

+ + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
typeStringType of the media, must be photo
mediaStringFile to send. Pass a file_id to send a file that exists on the Telegram servers (recommended), pass an HTTP URL for Telegram to get a file from the Internet, or pass “attach://<file_attach_name>” to upload a new one using multipart/form-data under <file_attach_name> name. More information on Sending Files »
+

InputPaidMediaVideo

+

The paid media to send is a video.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
typeStringType of the media, must be video
mediaStringFile to send. Pass a file_id to send a file that exists on the Telegram servers (recommended), pass an HTTP URL for Telegram to get a file from the Internet, or pass “attach://<file_attach_name>” to upload a new one using multipart/form-data under <file_attach_name> name. More information on Sending Files »
thumbnailStringOptional. Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can only be uploaded as a new file, so you can pass “attach://<file_attach_name>” if the thumbnail was uploaded using multipart/form-data under <file_attach_name>. More information on Sending Files »
coverStringOptional. Cover for the video in the message. Pass a file_id to send a file that exists on the Telegram servers (recommended), pass an HTTP URL for Telegram to get a file from the Internet, or pass “attach://<file_attach_name>” to upload a new one using multipart/form-data under <file_attach_name> name. More information on Sending Files »
start_timestampIntegerOptional. Start timestamp for the video in the message
widthIntegerOptional. Video width
heightIntegerOptional. Video height
durationIntegerOptional. Video duration in seconds
supports_streamingBooleanOptional. Pass True if the uploaded video is suitable for streaming
+

InputProfilePhoto

+

This object describes a profile photo to set. Currently, it can be one of

+ +

InputProfilePhotoStatic

+

A static profile photo in the .JPG format.

+ + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
typeStringType of the profile photo, must be static
photoStringThe static profile photo. Profile photos can't be reused and can only be uploaded as a new file, so you can pass “attach://<file_attach_name>” if the photo was uploaded using multipart/form-data under <file_attach_name>. More information on Sending Files »
+

InputProfilePhotoAnimated

+

An animated profile photo in the MPEG4 format.

+ + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
typeStringType of the profile photo, must be animated
animationStringThe animated profile photo. Profile photos can't be reused and can only be uploaded as a new file, so you can pass “attach://<file_attach_name>” if the photo was uploaded using multipart/form-data under <file_attach_name>. More information on Sending Files »
main_frame_timestampFloatOptional. Timestamp in seconds of the frame that will be used as the static profile photo. Defaults to 0.0.
+

InputStoryContent

+

This object describes the content of a story to post. Currently, it can be one of

+ +

InputStoryContentPhoto

+

Describes a photo to post as a story.

+ + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
typeStringType of the content, must be photo
photoStringThe photo to post as a story. The photo must be of the size 1080x1920 and must not exceed 10 MB. The photo can't be reused and can only be uploaded as a new file, so you can pass “attach://<file_attach_name>” if the photo was uploaded using multipart/form-data under <file_attach_name>. More information on Sending Files »
+

InputStoryContentVideo

+

Describes a video to post as a story.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
typeStringType of the content, must be video
videoStringThe video to post as a story. The video must be of the size 720x1280, streamable, encoded with H.265 codec, with key frames added each second in the MPEG4 format, and must not exceed 30 MB. The video can't be reused and can only be uploaded as a new file, so you can pass “attach://<file_attach_name>” if the video was uploaded using multipart/form-data under <file_attach_name>. More information on Sending Files »
durationFloatOptional. Precise duration of the video in seconds; 0-60
cover_frame_timestampFloatOptional. Timestamp in seconds of the frame that will be used as the static cover for the story. Defaults to 0.0.
is_animationBooleanOptional. Pass True if the video has no sound
+

Sending files

+

There are three ways to send files (photos, stickers, audio, media, etc.):

+
    +
  1. If the file is already stored somewhere on the Telegram servers, you don't need to reupload it: each file object has a file_id field; simply pass this file_id as a parameter instead of uploading. There are no limits for files sent this way.
  2. +
  3. Provide Telegram with an HTTP URL for the file to be sent. Telegram will download and send the file. 5 MB max size for photos and 20 MB max for other types of content.
  4. +
  5. Post the file using multipart/form-data in the usual way that files are uploaded via the browser. 10 MB max size for photos, 50 MB for other files.
  6. +
+

Sending by file_id

+
    +
  • It is not possible to change the file type when resending by file_id. I.e. a video can't be sent as a photo, a photo can't be sent as a document, etc.
  • +
  • It is not possible to resend thumbnails.
  • +
  • Resending a photo by file_id will send all of its sizes.
  • +
  • file_id is unique for each individual bot and can't be transferred from one bot to another.
  • +
  • file_id uniquely identifies a file, but a file can have different valid file_ids even for the same bot.
  • +
+

Sending by URL

+
    +
  • When sending by URL the target file must have the correct MIME type (e.g., audio/mpeg for sendAudio, etc.).
  • +
  • In sendDocument, sending by URL will currently only work for .PDF and .ZIP files.
  • +
  • To use sendVoice, the file must have the type audio/ogg and be no more than 1MB in size. 1-20MB voice notes will be sent as files.
  • +
  • Other configurations may work but we can't guarantee that they will.
  • +
+

Accent colors

+

Colors 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.

+

+ + + + + + + + + + + + + + + + + + + +
Color identifierLight colorsDark colors
7E15052 F9AE63FF9380 992F37
8E0802B FAC534ECB04E C35714
9A05FF3 F48FFFC697FF 5E31C8
1027A910 A7DC57A7EB6E 167E2D
1127ACCE 82E8D640D8D0 045C7F
123391D4 7DD3F052BFFF 0B5494
13DD4371 FFBE9FFF86A6 8E366E
14247BED F04856 FFFFFF3FA2FE E5424F FFFFFF
15D67722 1EA011 FFFFFFFF905E 32A527 FFFFFF
16179E42 E84A3F FFFFFF66D364 D5444F FFFFFF
172894AF 6FC456 FFFFFF22BCE2 3DA240 FFFFFF
180C9AB3 FFAD95 FFE6B522BCE2 FF9778 FFDA6B
197757D6 F79610 FFDE8E9791FF F2731D FFDB59
201585CF F2AB1D FFFFFF3DA6EB EEA51D FFFFFF

+

Profile accent colors

+

Currently, the following colors in RGB format are in use for profile backgrounds.

+

+ + + + + + + + + + + + + + + + + + + + + +
Color identifierLight colorsDark colors
0BA56509C4540
1C27C3E945E2C
2956AC8715099
349A35533713B
43E97AD387E87
55A8FBB477194
6B85378944763
77F8B95435261
8C9565D D97C57994343 AC583E
9CF7244 CC94338F552F A17232
109662D4 B966B6634691 9250A2
113D9755 89A650296A43 5F8F44
123D95BA 50AD98306C7C 3E987E
13538BC2 4DA8BD38618C 458BA1
14B04F74 D1666D884160 A65259
15637482 7B8A9753606E 384654

+

Inline mode objects

+

Objects and methods used in the inline mode are described in the Inline mode section.

+

Available methods

+
+

All methods in the Bot API are case-insensitive. We support GET and POST HTTP methods. Use either URL query string or application/json or application/x-www-form-urlencoded or multipart/form-data for passing parameters in Bot API requests.
On a successful call, a JSON object containing the result will be returned.

+
+

getMe

+

A simple method for testing your bot's authentication token. Requires no parameters. Returns information about the bot in the form of a BotFullInfo object.

+

logOut

+

Use 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 successful call, you can immediately log in on a local server, but will not be able to log back in to the cloud Bot API server for 10 minutes. Returns True on success. Requires no parameters.

+

close

+

Use 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. The method will return error 429 in the first 10 minutes after the bot is launched. Returns True on success. Requires no parameters.

+

sendMessage

+

Use this method to send text messages. On success, the sent Message is returned.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ParameterTypeRequiredDescription
business_connection_idStringOptionalUnique identifier of the business connection on behalf of which the message will be sent
chat_idInteger or StringOptionalUnique identifier for the target chat or username of the target bot, supergroup, or channel in the format @username; required unless the message is sent as an ephemeral reply to a callback query
message_thread_idIntegerOptionalUnique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only
direct_messages_topic_idIntegerOptionalIdentifier of the direct messages topic to which the message will be sent; required if the message is sent to a direct messages chat
ephemeral_message_parametersEphemeralMessageParametersOptionalA JSON-serialized object containing the parameters of the ephemeral message to send
textStringYesText of the message to be sent, 1-4096 characters after entities parsing
parse_modeStringOptionalMode for parsing entities in the message text. See formatting options for more details.
entitiesArray of MessageEntityOptionalA JSON-serialized list of special entities that appear in message text, which can be specified instead of parse_mode
link_preview_optionsLinkPreviewOptionsOptionalLink preview generation options for the message
disable_notificationBooleanOptionalSends the message silently. Users will receive a notification with no sound.
protect_contentBooleanOptionalProtects the contents of the sent message from forwarding and saving
allow_paid_broadcastBooleanOptionalPass True to allow up to 1000 messages per second, ignoring broadcasting limits for a fee of 0.1 Telegram Stars per message. The relevant Stars will be withdrawn from the bot's balance.
message_effect_idStringOptionalUnique identifier of the message effect to be added to the message; for private chats only
suggested_post_parametersSuggestedPostParametersOptionalA JSON-serialized object containing the parameters of the suggested post to send; for direct messages chats only. If the message is sent as a reply to another suggested post, then that suggested post is automatically declined.
reply_parametersReplyParametersOptionalDescription of the message to reply to
reply_markupInlineKeyboardMarkup or ReplyKeyboardMarkup or ReplyKeyboardRemove or ForceReplyOptionalAdditional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove a reply keyboard or to force a reply from the user.
+

Formatting options

+

The 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 clients will render them accordingly. You can specify text entities directly, or use markdown-style or HTML-style formatting.

+

Note that Telegram clients will display an alert to the user before opening an inline link ('Open this link?' together with the full URL).

+

Message entities can be nested, providing the following restrictions are met:
- If two entities have common characters, then one of them is fully contained inside another.
- bold, italic, underline, strikethrough, and spoiler entities can contain and can be part of any other entities, except pre and code.
- blockquote and expandable_blockquote entities can't be nested.
- All other entities can't contain each other.

+

Links tg://user?id=<user_id> can be used to mention a user by their identifier without using a username. Please note:

+
    +
  • These links will work only if they are used inside an inline link or in an inline keyboard button. For example, they will not work when used in a message text.
  • +
  • Unless the user is a member of the chat where they were mentioned, these mentions are only guaranteed to work if the user has contacted the bot in private in the past or has sent a callback query to the bot via an inline button and doesn't have Forwarded Messages privacy enabled for the bot.
  • +
+

You can find the list of programming and markup languages for which syntax highlighting is supported at libprisma#supported-languages.

+
Date-time entity formatting
+

Date-time entity formatting is specified by a format string, which must adhere to the following regular expression: r|w?[dD]?[tT]?.

+

If the format string is empty, the underlying text is displayed as-is; however, the user can still receive the underlying date in their local format. When populated, the format string determines the output based on the presence of the following control characters:

+
    +
  • r: Displays the time relative to the current time. Cannot be combined with any other control characters.
  • +
  • w: Displays the day of the week in the user's localized language.
  • +
  • d: Displays the date in short form (e.g., “17.03.22”).
  • +
  • D: Displays the date in long form (e.g., “March 17, 2022”).
  • +
  • t: Displays the time in short form (e.g., “22:45”).
  • +
  • T: Displays the time in long form (e.g., “22:45:00”).
  • +
+
MarkdownV2 style
+

To use this mode, pass MarkdownV2 in the parse_mode field. Use the following syntax in your message:

+
*bold \*text*
+_italic \*text_
+__underline__
+~strikethrough~
+||spoiler||
+*bold _italic bold ~italic bold strikethrough ||italic bold strikethrough spoiler||~ __underline italic bold___ bold*
+[inline URL](http://www.example.com/)
+[inline mention of a user](tg://user?id=123456789)
+![👍](tg://emoji?id=5368324170671202286)
+![22:45 tomorrow](tg://time?unix=1647531900&format=wDT)
+![22:45 tomorrow](tg://time?unix=1647531900&format=t)
+![22:45 tomorrow](tg://time?unix=1647531900&format=r)
+![22:45 tomorrow](tg://time?unix=1647531900)
+`inline fixed-width code`
+```
+pre-formatted fixed-width code block
+```
+```python
+pre-formatted fixed-width code block written in the Python programming language
+```
+>Block quotation started
+>Block quotation continued
+>Block quotation continued
+>Block quotation continued
+>The last line of the block quotation
+**>The expandable block quotation started right after the previous block quotation
+>It is separated from the previous block quotation by an empty bold entity
+>Expandable block quotation continued
+>Hidden by default part of the expandable block quotation started
+>Expandable block quotation continued
+>The last line of the expandable block quotation with the expandability mark||
+

Please note:

+
    +
  • Any character with code between 1 and 126 inclusively can be escaped anywhere with a preceding '\' character, in which case it is treated as an ordinary character and not a part of the markup. This implies that '\' character usually must be escaped with a preceding '\' character.
  • +
  • Inside pre and code entities, all '`' and '\' characters must be escaped with a preceding '\' character.
  • +
  • Inside the (...) part of the inline link and custom emoji definition, all ')' and '\' must be escaped with a preceding '\' character.
  • +
  • In all other places characters '_', '*', '[', ']', '(', ')', '~', '`', '>', '#', '+', '-', '=', '|', '{', '}', '.', '!' must be escaped with the preceding character '\'.
  • +
  • In case of ambiguity between italic and underline entities __ is always greedily treated from left to right as beginning or end of an underline entity, so instead of ___italic underline___ use ___italic underline_**__, adding an empty bold entity as a separator.
  • +
  • A valid emoji must be provided as an alternative value for the custom emoji. The emoji will be shown instead of the custom emoji in places where a custom emoji cannot be displayed (e.g., system notifications) or if the message is forwarded by a non-premium user. It is recommended to use the emoji from the emoji field of the custom emoji sticker.
  • +
  • Custom emoji entities can only be used by bots that purchased additional usernames on Fragment or in the messages directly sent by the bot to private, group and supergroup chats if the owner of the bot has a Telegram Premium subscription.
  • +
  • See date-time entity formatting for more details about supported date-time formats.
  • +
+
HTML style
+

To use this mode, pass HTML in the parse_mode field. The following tags are currently supported:

+
<b>bold</b>, <strong>bold</strong>
+<i>italic</i>, <em>italic</em>
+<u>underline</u>, <ins>underline</ins>
+<s>strikethrough</s>, <strike>strikethrough</strike>, <del>strikethrough</del>
+<span class="tg-spoiler">spoiler</span>, <tg-spoiler>spoiler</tg-spoiler>
+<b>bold <i>italic bold <s>italic bold strikethrough <span class="tg-spoiler">italic bold strikethrough spoiler</span></s> <u>underline italic bold</u></i> bold</b>
+<a href="http://www.example.com/">inline URL</a>
+<a href="tg://user?id=123456789">inline mention of a user</a>
+<tg-emoji emoji-id="5368324170671202286">👍</tg-emoji>
+<tg-time unix="1647531900" format="wDT">22:45 tomorrow</tg-time>
+<tg-time unix="1647531900" format="t">22:45 tomorrow</tg-time>
+<tg-time unix="1647531900" format="r">22:45 tomorrow</tg-time>
+<tg-time unix="1647531900">22:45 tomorrow</tg-time>
+<code>inline fixed-width code</code>
+<pre>pre-formatted fixed-width code block</pre>
+<pre><code class="language-python">pre-formatted fixed-width code block written in the Python programming language</code></pre>
+<blockquote>Block quotation started
+Block quotation continued
+The last line of the block quotation</blockquote>
+<blockquote expandable>Expandable block quotation started
+Expandable block quotation continued
+Expandable block quotation continued
+Hidden by default part of the block quotation started
+Expandable block quotation continued
+The last line of the block quotation</blockquote>
+

Please note:

+
    +
  • Only the tags mentioned above are currently supported.
  • +
  • All <, > and & symbols that are not a part of a tag or an HTML entity must be replaced with the corresponding HTML entities (< with &lt;, > with &gt; and & with &amp;).
  • +
  • All numerical HTML entities are supported.
  • +
  • The API currently supports only the following named HTML entities: &lt;, &gt;, &amp; and &quot;.
  • +
  • Use nested pre and code tags to define the programming language for a pre entity.
  • +
  • Programming language can't be specified for standalone code tags.
  • +
  • A valid emoji must be used as the content of the tg-emoji tag. The emoji will be shown instead of the custom emoji in places where a custom emoji cannot be displayed (e.g., system notifications) or if the message is forwarded by a non-premium user. It is recommended to use the emoji from the emoji field of the custom emoji sticker.
  • +
  • Custom emoji entities can only be used by bots that purchased additional usernames on Fragment or in the messages directly sent by the bot to private, group and supergroup chats if the owner of the bot has a Telegram Premium subscription.
  • +
  • See date-time entity formatting for more details about supported date-time formats.
  • +
+
Markdown style
+

This is a legacy mode, retained for backward compatibility. To use this mode, pass Markdown in the parse_mode field. Use the following syntax in your message:

+
*bold text*
+_italic text_
+[inline URL](http://www.example.com/)
+[inline mention of a user](tg://user?id=123456789)
+`inline fixed-width code`
+```
+pre-formatted fixed-width code block
+```
+```python
+pre-formatted fixed-width code block written in the Python programming language
+```
+

Please note:

+
    +
  • Entities must not be nested; use parse mode MarkdownV2 instead.
  • +
  • There is no way to specify “underline”, “strikethrough”, “spoiler”, “blockquote”, “expandable_blockquote”, “custom_emoji”, and “date_time” entities; use parse mode MarkdownV2 instead.
  • +
  • To escape characters '_', '*', '`', '[' outside of an entity, prepend the character '\' before them.
  • +
  • Escaping inside entities is not allowed, so the entity must be closed first and reopened again: use _snake_\__case_ for italic snake_case and *2*\**2=4* for bold 2*2=4.
  • +
+

Ephemeral Messages and Commands

+

Ephemeral interactions allow a bot and an individual member of a chat to communicate privately on the public timeline without cluttering the chat for other members. They may disappear automatically after some time, or if the app is restarted.

+

Ephemeral Commands (User to Bot)
Bots can declare ephemeral commands by setting the is_ephemeral field to True in the BotCommand class. A user can then send an ephemeral command that is received by the target bot but remains invisible to all members of the chat, including both users and other bots.

+

Ephemeral Messages
Bots can send an ephemeral message response back to a specific user designated by the field receiver_user_id in the parameter ephemeral_message_parameters. Other members of the chat will not see the message. If callback_query_id is specified and receiver_user_id is omitted, then the message is sent as an ephemeral reply to the callback query and is shown only to the user who pressed the button. Such replies can be sent in any chat except channel direct messages chats.

+
+

It is not guaranteed that the ephemeral message will be received, especially if the user is offline.

+
+

Reply Targets and Conditions

+
    +
  • Any bot can send an ephemeral message to a user within 15 seconds of the incoming eligible action. The message will be sent to the exact client application that triggered the action. For this the bot must provide either:

    +
      +
    • The ephemeral_message_parameters.callback_query_id from a received callback query, or
    • +
    • The reply_parameters.ephemeral_message_id from an incoming ephemeral message.
    • +
    +
  • +
  • If the bot is a chat administrator, it can send an ephemeral message to any non-bot member of the chat at any time without needing to specify ephemeral_message_parameters.callback_query_id or reply_parameters.ephemeral_message_id. In this case, the message may be delivered across multiple active client applications of the user, but is regardless not guaranteed to be delivered to any of them.

    +
  • +
+

Paid Broadcasts

+

By 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 per second.

+

Each message broadcasted over the free amount of 30 messages per second incurs a cost of 0.1 Stars per message, paid with Telegram Stars from the bot's balance. In order to use this feature, a bot must have at least 10,000 Stars on its balance.

+
+

Bots with increased limits are only charged for messages that are broadcasted successfully.

+
+

forwardMessage

+

Use 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.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ParameterTypeRequiredDescription
chat_idInteger or StringYesUnique identifier for the target chat or username of the target bot, supergroup, or channel in the format @username
message_thread_idIntegerOptionalUnique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only
direct_messages_topic_idIntegerOptionalIdentifier of the direct messages topic to which the message will be forwarded; required if the message is forwarded to a direct messages chat
from_chat_idInteger or StringYesUnique identifier for the chat where the original message was sent (or username of the target bot, supergroup, or channel in the format @username)
video_start_timestampIntegerOptionalNew start timestamp for the forwarded video in the message
disable_notificationBooleanOptionalSends the message silently. Users will receive a notification with no sound.
protect_contentBooleanOptionalProtects the contents of the forwarded message from forwarding and saving
message_effect_idStringOptionalUnique identifier of the message effect to be added to the message; only available when forwarding to private chats
suggested_post_parametersSuggestedPostParametersOptionalA JSON-serialized object containing the parameters of the suggested post to send; for direct messages chats only
message_idIntegerYesMessage identifier in the chat specified in from_chat_id
+

forwardMessages

+

Use 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 grouping is kept for forwarded messages. On success, an Array of MessageId of the sent messages is returned.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ParameterTypeRequiredDescription
chat_idInteger or StringYesUnique identifier for the target chat or username of the target bot, supergroup, or channel in the format @username
message_thread_idIntegerOptionalUnique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only
direct_messages_topic_idIntegerOptionalIdentifier of the direct messages topic to which the messages will be forwarded; required if the messages are forwarded to a direct messages chat
from_chat_idInteger or StringYesUnique identifier for the chat where the original messages were sent (or username of the target bot, supergroup, or channel in the format @username)
message_idsArray of IntegerYesA JSON-serialized list of 1-100 identifiers of messages in the chat from_chat_id to forward. The identifiers must be specified in a strictly increasing order.
disable_notificationBooleanOptionalSends the messages silently. Users will receive a notification with no sound.
protect_contentBooleanOptionalProtects the contents of the forwarded messages from forwarding and saving
+

copyMessage

+

Use 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 the value of the field correct_option_ids is known to the bot. The method is analogous to the method forwardMessage, but the copied message doesn't have a link to the original message. Returns the MessageId of the sent message on success.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ParameterTypeRequiredDescription
chat_idInteger or StringYesUnique identifier for the target chat or username of the target bot, supergroup, or channel in the format @username
message_thread_idIntegerOptionalUnique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only
direct_messages_topic_idIntegerOptionalIdentifier of the direct messages topic to which the message will be sent; required if the message is sent to a direct messages chat
from_chat_idInteger or StringYesUnique identifier for the chat where the original message was sent (or username of the target bot, supergroup, or channel in the format @username)
message_idIntegerYesMessage identifier in the chat specified in from_chat_id
video_start_timestampIntegerOptionalNew start timestamp for the copied video in the message
captionStringOptionalNew caption for media, 0-1024 characters after entities parsing. If not specified, the original caption is kept.
parse_modeStringOptionalMode for parsing entities in the new caption. See formatting options for more details.
caption_entitiesArray of MessageEntityOptionalA JSON-serialized list of special entities that appear in the new caption, which can be specified instead of parse_mode
show_caption_above_mediaBooleanOptionalPass True if the caption must be shown above the message media. Ignored if a new caption isn't specified.
disable_notificationBooleanOptionalSends the message silently. Users will receive a notification with no sound.
protect_contentBooleanOptionalProtects the contents of the sent message from forwarding and saving
allow_paid_broadcastBooleanOptionalPass True to allow up to 1000 messages per second, ignoring broadcasting limits for a fee of 0.1 Telegram Stars per message. The relevant Stars will be withdrawn from the bot's balance.
message_effect_idStringOptionalUnique identifier of the message effect to be added to the message; only available when copying to private chats
suggested_post_parametersSuggestedPostParametersOptionalA JSON-serialized object containing the parameters of the suggested post to send; for direct messages chats only. If the message is sent as a reply to another suggested post, then that suggested post is automatically declined.
reply_parametersReplyParametersOptionalDescription of the message to reply to
reply_markupInlineKeyboardMarkup or ReplyKeyboardMarkup or ReplyKeyboardRemove or ForceReplyOptionalAdditional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove a reply keyboard or to force a reply from the user.
+

copyMessages

+

Use 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 messages, and widget messages can't be copied. A quiz poll can be copied only if the value of the field correct_option_ids is known to the bot. The method is analogous to the method forwardMessages, but the copied messages don't have a link to the original message. Album grouping is kept for copied messages. On success, an Array of MessageId of the sent messages is returned.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ParameterTypeRequiredDescription
chat_idInteger or StringYesUnique identifier for the target chat or username of the target bot, supergroup, or channel in the format @username
message_thread_idIntegerOptionalUnique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only
direct_messages_topic_idIntegerOptionalIdentifier of the direct messages topic to which the messages will be sent; required if the messages are sent to a direct messages chat
from_chat_idInteger or StringYesUnique identifier for the chat where the original messages were sent (or username of the target bot, supergroup, or channel in the format @username)
message_idsArray of IntegerYesA JSON-serialized list of 1-100 identifiers of messages in the chat from_chat_id to copy. The identifiers must be specified in a strictly increasing order.
disable_notificationBooleanOptionalSends the messages silently. Users will receive a notification with no sound.
protect_contentBooleanOptionalProtects the contents of the sent messages from forwarding and saving
remove_captionBooleanOptionalPass True to copy the messages without their captions
+

sendPhoto

+

Use this method to send photos. On success, the sent Message is returned.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ParameterTypeRequiredDescription
business_connection_idStringOptionalUnique identifier of the business connection on behalf of which the message will be sent
chat_idInteger or StringOptionalUnique identifier for the target chat or username of the target bot, supergroup, or channel in the format @username; required unless the message is sent as an ephemeral reply to a callback query
message_thread_idIntegerOptionalUnique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only
direct_messages_topic_idIntegerOptionalIdentifier of the direct messages topic to which the message will be sent; required if the message is sent to a direct messages chat
ephemeral_message_parametersEphemeralMessageParametersOptionalA JSON-serialized object containing the parameters of the ephemeral message to send
photoInputFile or StringYesPhoto to send. Pass a file_id as String to send a photo that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get a photo from the Internet, or upload a new photo using multipart/form-data. The photo must be at most 10 MB in size. The photo's width and height must not exceed 10000 in total. Width and height ratio must be at most 20. More information on Sending Files »
captionStringOptionalPhoto caption (may also be used when resending photos by file_id), 0-1024 characters after entities parsing
parse_modeStringOptionalMode for parsing entities in the photo caption. See formatting options for more details.
caption_entitiesArray of MessageEntityOptionalA JSON-serialized list of special entities that appear in the caption, which can be specified instead of parse_mode
show_caption_above_mediaBooleanOptionalPass True if the caption must be shown above the message media
has_spoilerBooleanOptionalPass True if the photo needs to be covered with a spoiler animation
disable_notificationBooleanOptionalSends the message silently. Users will receive a notification with no sound.
protect_contentBooleanOptionalProtects the contents of the sent message from forwarding and saving
allow_paid_broadcastBooleanOptionalPass True to allow up to 1000 messages per second, ignoring broadcasting limits for a fee of 0.1 Telegram Stars per message. The relevant Stars will be withdrawn from the bot's balance.
message_effect_idStringOptionalUnique identifier of the message effect to be added to the message; for private chats only
suggested_post_parametersSuggestedPostParametersOptionalA JSON-serialized object containing the parameters of the suggested post to send; for direct messages chats only. If the message is sent as a reply to another suggested post, then that suggested post is automatically declined.
reply_parametersReplyParametersOptionalDescription of the message to reply to
reply_markupInlineKeyboardMarkup or ReplyKeyboardMarkup or ReplyKeyboardRemove or ForceReplyOptionalAdditional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove a reply keyboard or to force a reply from the user.
+

sendLivePhoto

+

Use this method to send live photos. On success, the sent Message is returned.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ParameterTypeRequiredDescription
business_connection_idStringOptionalUnique identifier of the business connection on behalf of which the message will be sent
chat_idInteger or StringOptionalUnique identifier for the target chat or username of the target bot, supergroup, or channel in the format @username; required unless the message is sent as an ephemeral reply to a callback query
message_thread_idIntegerOptionalUnique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only
direct_messages_topic_idIntegerOptionalIdentifier of the direct messages topic to which the message will be sent; required if the message is sent to a direct messages chat
ephemeral_message_parametersEphemeralMessageParametersOptionalA JSON-serialized object containing the parameters of the ephemeral message to send
live_photoInputFile or StringYesLive photo video to send. The video must be no longer than 10 seconds and must not exceed 10 MB in size. Pass a file_id as String to send a video that exists on the Telegram servers (recommended) or upload a new video using multipart/form-data. More information on Sending Files ». Sending live photos by a URL is currently unsupported.
photoInputFile or StringYesThe static photo to send. Pass a file_id as String to send a photo that exists on the Telegram servers (recommended) or upload a new photo using multipart/form-data. More information on Sending Files ». Sending live photos by a URL is currently unsupported.
captionStringOptionalLive photo caption (may also be used when resending live photos by file_id), 0-1024 characters after entities parsing
parse_modeStringOptionalMode for parsing entities in the live photo caption. See formatting options for more details.
caption_entitiesArray of MessageEntityOptionalA JSON-serialized list of special entities that appear in the caption, which can be specified instead of parse_mode
show_caption_above_mediaBooleanOptionalPass True if the caption must be shown above the message media
has_spoilerBooleanOptionalPass True if the live photo needs to be covered with a spoiler animation
disable_notificationBooleanOptionalSends the message silently. Users will receive a notification with no sound.
protect_contentBooleanOptionalProtects the contents of the sent message from forwarding and saving
allow_paid_broadcastBooleanOptionalPass True to allow up to 1000 messages per second, ignoring broadcasting limits for a fee of 0.1 Telegram Stars per message. The relevant Stars will be withdrawn from the bot's balance.
message_effect_idStringOptionalUnique identifier of the message effect to be added to the message; for private chats only
suggested_post_parametersSuggestedPostParametersOptionalA JSON-serialized object containing the parameters of the suggested post to send; for direct messages chats only. If the message is sent as a reply to another suggested post, then that suggested post is automatically declined.
reply_parametersReplyParametersOptionalDescription of the message to reply to
reply_markupInlineKeyboardMarkup or ReplyKeyboardMarkup or ReplyKeyboardRemove or ForceReplyOptionalAdditional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove a reply keyboard or to force a reply from the user.
+

sendAudio

+

Use 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 audio files of up to 50 MB in size; this limit may be changed in the future.

+

For sending voice messages, use the sendVoice method instead.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ParameterTypeRequiredDescription
business_connection_idStringOptionalUnique identifier of the business connection on behalf of which the message will be sent
chat_idInteger or StringOptionalUnique identifier for the target chat or username of the target bot, supergroup, or channel in the format @username; required unless the message is sent as an ephemeral reply to a callback query
message_thread_idIntegerOptionalUnique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only
direct_messages_topic_idIntegerOptionalIdentifier of the direct messages topic to which the message will be sent; required if the message is sent to a direct messages chat
ephemeral_message_parametersEphemeralMessageParametersOptionalA JSON-serialized object containing the parameters of the ephemeral message to send
audioInputFile or StringYesAudio file to send. Pass a file_id as String to send an audio file that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get an audio file from the Internet, or upload a new one using multipart/form-data. More information on Sending Files »
captionStringOptionalAudio caption, 0-1024 characters after entities parsing
parse_modeStringOptionalMode for parsing entities in the audio caption. See formatting options for more details.
caption_entitiesArray of MessageEntityOptionalA JSON-serialized list of special entities that appear in the caption, which can be specified instead of parse_mode
durationIntegerOptionalDuration of the audio in seconds
performerStringOptionalPerformer
titleStringOptionalTrack name
thumbnailInputFile or StringOptionalThumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can only be uploaded as a new file, so you can pass “attach://<file_attach_name>” if the thumbnail was uploaded using multipart/form-data under <file_attach_name>. More information on Sending Files »
disable_notificationBooleanOptionalSends the message silently. Users will receive a notification with no sound.
protect_contentBooleanOptionalProtects the contents of the sent message from forwarding and saving
allow_paid_broadcastBooleanOptionalPass True to allow up to 1000 messages per second, ignoring broadcasting limits for a fee of 0.1 Telegram Stars per message. The relevant Stars will be withdrawn from the bot's balance.
message_effect_idStringOptionalUnique identifier of the message effect to be added to the message; for private chats only
suggested_post_parametersSuggestedPostParametersOptionalA JSON-serialized object containing the parameters of the suggested post to send; for direct messages chats only. If the message is sent as a reply to another suggested post, then that suggested post is automatically declined.
reply_parametersReplyParametersOptionalDescription of the message to reply to
reply_markupInlineKeyboardMarkup or ReplyKeyboardMarkup or ReplyKeyboardRemove or ForceReplyOptionalAdditional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove a reply keyboard or to force a reply from the user.
+

sendDocument

+

Use 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.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ParameterTypeRequiredDescription
business_connection_idStringOptionalUnique identifier of the business connection on behalf of which the message will be sent
chat_idInteger or StringOptionalUnique identifier for the target chat or username of the target bot, supergroup, or channel in the format @username; required unless the message is sent as an ephemeral reply to a callback query
message_thread_idIntegerOptionalUnique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only
direct_messages_topic_idIntegerOptionalIdentifier of the direct messages topic to which the message will be sent; required if the message is sent to a direct messages chat
ephemeral_message_parametersEphemeralMessageParametersOptionalA JSON-serialized object containing the parameters of the ephemeral message to send
documentInputFile or StringYesFile to send. Pass a file_id as String to send a file that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get a file from the Internet, or upload a new one using multipart/form-data. More information on Sending Files »
thumbnailInputFile or StringOptionalThumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can only be uploaded as a new file, so you can pass “attach://<file_attach_name>” if the thumbnail was uploaded using multipart/form-data under <file_attach_name>. More information on Sending Files »
captionStringOptionalDocument caption (may also be used when resending documents by file_id), 0-1024 characters after entities parsing
parse_modeStringOptionalMode for parsing entities in the document caption. See formatting options for more details.
caption_entitiesArray of MessageEntityOptionalA JSON-serialized list of special entities that appear in the caption, which can be specified instead of parse_mode
disable_content_type_detectionBooleanOptionalDisables automatic server-side content type detection for files uploaded using multipart/form-data
disable_notificationBooleanOptionalSends the message silently. Users will receive a notification with no sound.
protect_contentBooleanOptionalProtects the contents of the sent message from forwarding and saving
allow_paid_broadcastBooleanOptionalPass True to allow up to 1000 messages per second, ignoring broadcasting limits for a fee of 0.1 Telegram Stars per message. The relevant Stars will be withdrawn from the bot's balance.
message_effect_idStringOptionalUnique identifier of the message effect to be added to the message; for private chats only
suggested_post_parametersSuggestedPostParametersOptionalA JSON-serialized object containing the parameters of the suggested post to send; for direct messages chats only. If the message is sent as a reply to another suggested post, then that suggested post is automatically declined.
reply_parametersReplyParametersOptionalDescription of the message to reply to
reply_markupInlineKeyboardMarkup or ReplyKeyboardMarkup or ReplyKeyboardRemove or ForceReplyOptionalAdditional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove a reply keyboard or to force a reply from the user.
+

sendVideo

+

Use 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; this limit may be changed in the future.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ParameterTypeRequiredDescription
business_connection_idStringOptionalUnique identifier of the business connection on behalf of which the message will be sent
chat_idInteger or StringOptionalUnique identifier for the target chat or username of the target bot, supergroup, or channel in the format @username; required unless the message is sent as an ephemeral reply to a callback query
message_thread_idIntegerOptionalUnique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only
direct_messages_topic_idIntegerOptionalIdentifier of the direct messages topic to which the message will be sent; required if the message is sent to a direct messages chat
ephemeral_message_parametersEphemeralMessageParametersOptionalA JSON-serialized object containing the parameters of the ephemeral message to send
videoInputFile or StringYesVideo to send. Pass a file_id as String to send a video that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get a video from the Internet, or upload a new video using multipart/form-data. More information on Sending Files »
durationIntegerOptionalDuration of sent video in seconds
widthIntegerOptionalVideo width
heightIntegerOptionalVideo height
thumbnailInputFile or StringOptionalThumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can only be uploaded as a new file, so you can pass “attach://<file_attach_name>” if the thumbnail was uploaded using multipart/form-data under <file_attach_name>. More information on Sending Files »
coverInputFile or StringOptionalCover for the video in the message. Pass a file_id to send a file that exists on the Telegram servers (recommended), pass an HTTP URL for Telegram to get a file from the Internet, or pass “attach://<file_attach_name>” to upload a new one using multipart/form-data under <file_attach_name> name. More information on Sending Files »
start_timestampIntegerOptionalStart timestamp for the video in the message
captionStringOptionalVideo caption (may also be used when resending videos by file_id), 0-1024 characters after entities parsing
parse_modeStringOptionalMode for parsing entities in the video caption. See formatting options for more details.
caption_entitiesArray of MessageEntityOptionalA JSON-serialized list of special entities that appear in the caption, which can be specified instead of parse_mode
show_caption_above_mediaBooleanOptionalPass True if the caption must be shown above the message media
has_spoilerBooleanOptionalPass True if the video needs to be covered with a spoiler animation
supports_streamingBooleanOptionalPass True if the uploaded video is suitable for streaming
disable_notificationBooleanOptionalSends the message silently. Users will receive a notification with no sound.
protect_contentBooleanOptionalProtects the contents of the sent message from forwarding and saving
allow_paid_broadcastBooleanOptionalPass True to allow up to 1000 messages per second, ignoring broadcasting limits for a fee of 0.1 Telegram Stars per message. The relevant Stars will be withdrawn from the bot's balance.
message_effect_idStringOptionalUnique identifier of the message effect to be added to the message; for private chats only
suggested_post_parametersSuggestedPostParametersOptionalA JSON-serialized object containing the parameters of the suggested post to send; for direct messages chats only. If the message is sent as a reply to another suggested post, then that suggested post is automatically declined.
reply_parametersReplyParametersOptionalDescription of the message to reply to
reply_markupInlineKeyboardMarkup or ReplyKeyboardMarkup or ReplyKeyboardRemove or ForceReplyOptionalAdditional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove a reply keyboard or to force a reply from the user.
+

sendAnimation

+

Use 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 in the future.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ParameterTypeRequiredDescription
business_connection_idStringOptionalUnique identifier of the business connection on behalf of which the message will be sent
chat_idInteger or StringOptionalUnique identifier for the target chat or username of the target bot, supergroup, or channel in the format @username; required unless the message is sent as an ephemeral reply to a callback query
message_thread_idIntegerOptionalUnique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only
direct_messages_topic_idIntegerOptionalIdentifier of the direct messages topic to which the message will be sent; required if the message is sent to a direct messages chat
ephemeral_message_parametersEphemeralMessageParametersOptionalA JSON-serialized object containing the parameters of the ephemeral message to send
animationInputFile or StringYesAnimation to send. Pass a file_id as String to send an animation that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get an animation from the Internet, or upload a new animation using multipart/form-data. More information on Sending Files »
durationIntegerOptionalDuration of sent animation in seconds
widthIntegerOptionalAnimation width
heightIntegerOptionalAnimation height
thumbnailInputFile or StringOptionalThumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can only be uploaded as a new file, so you can pass “attach://<file_attach_name>” if the thumbnail was uploaded using multipart/form-data under <file_attach_name>. More information on Sending Files »
captionStringOptionalAnimation caption (may also be used when resending animations by file_id), 0-1024 characters after entities parsing
parse_modeStringOptionalMode for parsing entities in the animation caption. See formatting options for more details.
caption_entitiesArray of MessageEntityOptionalA JSON-serialized list of special entities that appear in the caption, which can be specified instead of parse_mode
show_caption_above_mediaBooleanOptionalPass True if the caption must be shown above the message media
has_spoilerBooleanOptionalPass True if the animation needs to be covered with a spoiler animation
disable_notificationBooleanOptionalSends the message silently. Users will receive a notification with no sound.
protect_contentBooleanOptionalProtects the contents of the sent message from forwarding and saving
allow_paid_broadcastBooleanOptionalPass True to allow up to 1000 messages per second, ignoring broadcasting limits for a fee of 0.1 Telegram Stars per message. The relevant Stars will be withdrawn from the bot's balance.
message_effect_idStringOptionalUnique identifier of the message effect to be added to the message; for private chats only
suggested_post_parametersSuggestedPostParametersOptionalA JSON-serialized object containing the parameters of the suggested post to send; for direct messages chats only. If the message is sent as a reply to another suggested post, then that suggested post is automatically declined.
reply_parametersReplyParametersOptionalDescription of the message to reply to
reply_markupInlineKeyboardMarkup or ReplyKeyboardMarkup or ReplyKeyboardRemove or ForceReplyOptionalAdditional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove a reply keyboard or to force a reply from the user.
+

sendVoice

+

Use 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 format (other formats may be sent as Audio or Document). On success, the sent Message is returned. Bots can currently send voice messages of up to 50 MB in size; this limit may be changed in the future.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ParameterTypeRequiredDescription
business_connection_idStringOptionalUnique identifier of the business connection on behalf of which the message will be sent
chat_idInteger or StringOptionalUnique identifier for the target chat or username of the target bot, supergroup, or channel in the format @username; required unless the message is sent as an ephemeral reply to a callback query
message_thread_idIntegerOptionalUnique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only
direct_messages_topic_idIntegerOptionalIdentifier of the direct messages topic to which the message will be sent; required if the message is sent to a direct messages chat
ephemeral_message_parametersEphemeralMessageParametersOptionalA JSON-serialized object containing the parameters of the ephemeral message to send
voiceInputFile or StringYesAudio file to send. Pass a file_id as String to send a file that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get a file from the Internet, or upload a new one using multipart/form-data. More information on Sending Files »
captionStringOptionalVoice message caption, 0-1024 characters after entities parsing
parse_modeStringOptionalMode for parsing entities in the voice message caption. See formatting options for more details.
caption_entitiesArray of MessageEntityOptionalA JSON-serialized list of special entities that appear in the caption, which can be specified instead of parse_mode
durationIntegerOptionalDuration of the voice message in seconds
disable_notificationBooleanOptionalSends the message silently. Users will receive a notification with no sound.
protect_contentBooleanOptionalProtects the contents of the sent message from forwarding and saving
allow_paid_broadcastBooleanOptionalPass True to allow up to 1000 messages per second, ignoring broadcasting limits for a fee of 0.1 Telegram Stars per message. The relevant Stars will be withdrawn from the bot's balance.
message_effect_idStringOptionalUnique identifier of the message effect to be added to the message; for private chats only
suggested_post_parametersSuggestedPostParametersOptionalA JSON-serialized object containing the parameters of the suggested post to send; for direct messages chats only. If the message is sent as a reply to another suggested post, then that suggested post is automatically declined.
reply_parametersReplyParametersOptionalDescription of the message to reply to
reply_markupInlineKeyboardMarkup or ReplyKeyboardMarkup or ReplyKeyboardRemove or ForceReplyOptionalAdditional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove a reply keyboard or to force a reply from the user.
+

sendVideoNote

+

Use this method to send a rounded square MPEG4 video up to 1 minute long. On success, the sent Message is returned.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ParameterTypeRequiredDescription
business_connection_idStringOptionalUnique identifier of the business connection on behalf of which the message will be sent
chat_idInteger or StringOptionalUnique identifier for the target chat or username of the target bot, supergroup, or channel in the format @username; required unless the message is sent as an ephemeral reply to a callback query
message_thread_idIntegerOptionalUnique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only
direct_messages_topic_idIntegerOptionalIdentifier of the direct messages topic to which the message will be sent; required if the message is sent to a direct messages chat
ephemeral_message_parametersEphemeralMessageParametersOptionalA JSON-serialized object containing the parameters of the ephemeral message to send
video_noteInputFile or StringYesVideo note to send. Pass a file_id as String to send a video note that exists on the Telegram servers (recommended) or upload a new video using multipart/form-data. More information on Sending Files ». Sending video notes by a URL is currently unsupported.
durationIntegerOptionalDuration of sent video in seconds
lengthIntegerOptionalVideo width and height, i.e. diameter of the video message
thumbnailInputFile or StringOptionalThumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can only be uploaded as a new file, so you can pass “attach://<file_attach_name>” if the thumbnail was uploaded using multipart/form-data under <file_attach_name>. More information on Sending Files »
disable_notificationBooleanOptionalSends the message silently. Users will receive a notification with no sound.
protect_contentBooleanOptionalProtects the contents of the sent message from forwarding and saving
allow_paid_broadcastBooleanOptionalPass True to allow up to 1000 messages per second, ignoring broadcasting limits for a fee of 0.1 Telegram Stars per message. The relevant Stars will be withdrawn from the bot's balance.
message_effect_idStringOptionalUnique identifier of the message effect to be added to the message; for private chats only
suggested_post_parametersSuggestedPostParametersOptionalA JSON-serialized object containing the parameters of the suggested post to send; for direct messages chats only. If the message is sent as a reply to another suggested post, then that suggested post is automatically declined.
reply_parametersReplyParametersOptionalDescription of the message to reply to
reply_markupInlineKeyboardMarkup or ReplyKeyboardMarkup or ReplyKeyboardRemove or ForceReplyOptionalAdditional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove a reply keyboard or to force a reply from the user.
+

sendWidget

+

Use 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 forwarded. On success, the sent Message is returned.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ParameterTypeRequiredDescription
chat_idInteger or StringYesUnique identifier for the target chat or username of the target supergroup in the format @username
message_thread_idIntegerOptionalUnique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only
htmlStringYesHTML code of the widget, 1-32768 bytes. The code must not exceed 4096 bytes when compressed by zlib with the maximum compression level.
widthIntegerOptionalWidth of the widget in logical pixels; omit if the widget must occupy the whole width of the message bubble. The width is clamped by the app to the range from 200 to the maximum width of the message bubble.
heightIntegerOptionalHeight of the widget in logical pixels; omit if the height of the widget isn't fixed. The height is clamped by the app to the range 50-600.
public_dataStringOptionalPublic data of the widget, 0-1024 bytes, which will be available wherever the widget is shown. If the widget is shared, then all messages with it will have the same public data.
chat_dataStringOptionalData of the widget, which is specific to the message, 0-1024 bytes
captionStringOptionalWidget caption, 0-1024 characters after entities parsing
parse_modeStringOptionalMode for parsing entities in the widget caption. See formatting options for more details.
caption_entitiesArray of MessageEntityOptionalA JSON-serialized list of special entities that appear in the caption, which can be specified instead of parse_mode
show_caption_above_mediaBooleanOptionalPass True if the caption must be shown above the widget
allow_queriesBooleanOptionalPass True to allow the widget to send queries to the bot
is_sharedBooleanOptionalPass True to create a shared widget, which can be sent again using the method sendSharedWidget
disable_notificationBooleanOptionalSends the message silently. Users will receive a notification with no sound.
protect_contentBooleanOptionalProtects the contents of the sent message from forwarding and saving
allow_paid_broadcastBooleanOptionalPass True to allow up to 1000 messages per second, ignoring broadcasting limits for a fee of 0.1 Telegram Stars per message. The relevant Stars will be withdrawn from the bot's balance.
message_effect_idStringOptionalUnique identifier of the message effect to be added to the message; for private chats only
reply_parametersReplyParametersOptionalDescription of the message to reply to
reply_markupInlineKeyboardMarkup or ReplyKeyboardMarkup or ReplyKeyboardRemove or ForceReplyOptionalAdditional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove a reply keyboard or to force a reply from the user.
+

sendSharedWidget

+

Use this method to resend 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 can't be forwarded. On success, the sent Message is returned.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ParameterTypeRequiredDescription
chat_idInteger or StringYesUnique identifier for the target chat or username of the target supergroup in the format @username
message_thread_idIntegerOptionalUnique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only
widget_idStringYesUnique identifier of the shared widget
chat_dataStringOptionalData of the widget, which is specific to the message, 0-1024 bytes
captionStringOptionalWidget caption, 0-1024 characters after entities parsing
parse_modeStringOptionalMode for parsing entities in the widget caption. See formatting options for more details.
caption_entitiesArray of MessageEntityOptionalA JSON-serialized list of special entities that appear in the caption, which can be specified instead of parse_mode
show_caption_above_mediaBooleanOptionalPass True if the caption must be shown above the widget
disable_notificationBooleanOptionalSends the message silently. Users will receive a notification with no sound.
protect_contentBooleanOptionalProtects the contents of the sent message from forwarding and saving
allow_paid_broadcastBooleanOptionalPass True to allow up to 1000 messages per second, ignoring broadcasting limits for a fee of 0.1 Telegram Stars per message. The relevant Stars will be withdrawn from the bot's balance.
message_effect_idStringOptionalUnique identifier of the message effect to be added to the message; for private chats only
reply_parametersReplyParametersOptionalDescription of the message to reply to
reply_markupInlineKeyboardMarkup or ReplyKeyboardMarkup or ReplyKeyboardRemove or ForceReplyOptionalAdditional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove a reply keyboard or to force a reply from the user.
+

sendPaidMedia

+

Use this method to send paid media. On success, the sent Message is returned.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ParameterTypeRequiredDescription
business_connection_idStringOptionalUnique identifier of the business connection on behalf of which the message will be sent
chat_idInteger or StringYesUnique identifier for the target chat or username of the target bot, supergroup, or channel in the format @username. If the chat is a channel, all Telegram Star proceeds from this media will be credited to the chat's balance. Otherwise, they will be credited to the bot's balance.
message_thread_idIntegerOptionalUnique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only
direct_messages_topic_idIntegerOptionalIdentifier of the direct messages topic to which the message will be sent; required if the message is sent to a direct messages chat
star_countIntegerYesThe number of Telegram Stars that must be paid to buy access to the media; 1-25000
mediaArray of InputPaidMediaYesA JSON-serialized Array describing the media to be sent; up to 10 items
payloadStringOptionalBot-defined paid media payload, 0-128 bytes. This will not be displayed to the user; use it for your internal processes.
captionStringOptionalMedia caption, 0-1024 characters after entities parsing
parse_modeStringOptionalMode for parsing entities in the media caption. See formatting options for more details.
caption_entitiesArray of MessageEntityOptionalA JSON-serialized list of special entities that appear in the caption, which can be specified instead of parse_mode
show_caption_above_mediaBooleanOptionalPass True if the caption must be shown above the message media
disable_notificationBooleanOptionalSends the message silently. Users will receive a notification with no sound.
protect_contentBooleanOptionalProtects the contents of the sent message from forwarding and saving
allow_paid_broadcastBooleanOptionalPass True to allow up to 1000 messages per second, ignoring broadcasting limits for a fee of 0.1 Telegram Stars per message. The relevant Stars will be withdrawn from the bot's balance.
suggested_post_parametersSuggestedPostParametersOptionalA JSON-serialized object containing the parameters of the suggested post to send; for direct messages chats only. If the message is sent as a reply to another suggested post, then that suggested post is automatically declined.
reply_parametersReplyParametersOptionalDescription of the message to reply to
reply_markupInlineKeyboardMarkup or ReplyKeyboardMarkup or ReplyKeyboardRemove or ForceReplyOptionalAdditional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove a reply keyboard or to force a reply from the user.
+

sendMediaGroup

+

Use this method to send a group of photos, live photos, videos, documents or audios as an album. Documents and audio files can only be grouped in an album with messages of the same type. On success, an Array of Message objects that were sent is returned.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ParameterTypeRequiredDescription
business_connection_idStringOptionalUnique identifier of the business connection on behalf of which the message will be sent
chat_idInteger or StringYesUnique identifier for the target chat or username of the target bot, supergroup, or channel in the format @username
message_thread_idIntegerOptionalUnique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only
direct_messages_topic_idIntegerOptionalIdentifier of the direct messages topic to which the messages will be sent; required if the messages are sent to a direct messages chat
mediaArray of InputMediaAudio, InputMediaDocument, InputMediaLivePhoto, InputMediaPhoto and InputMediaVideoYesA JSON-serialized Array describing messages to be sent, must include 2-10 items
disable_notificationBooleanOptionalSends messages silently. Users will receive a notification with no sound.
protect_contentBooleanOptionalProtects the contents of the sent messages from forwarding and saving
allow_paid_broadcastBooleanOptionalPass True to allow up to 1000 messages per second, ignoring broadcasting limits for a fee of 0.1 Telegram Stars per message. The relevant Stars will be withdrawn from the bot's balance.
message_effect_idStringOptionalUnique identifier of the message effect to be added to the message; for private chats only
reply_parametersReplyParametersOptionalDescription of the message to reply to
+

sendLocation

+

Use this method to send a point on the map. On success, the sent Message is returned.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ParameterTypeRequiredDescription
business_connection_idStringOptionalUnique identifier of the business connection on behalf of which the message will be sent
chat_idInteger or StringOptionalUnique identifier for the target chat or username of the target bot, supergroup, or channel in the format @username; required unless the message is sent as an ephemeral reply to a callback query
message_thread_idIntegerOptionalUnique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only
direct_messages_topic_idIntegerOptionalIdentifier of the direct messages topic to which the message will be sent; required if the message is sent to a direct messages chat
ephemeral_message_parametersEphemeralMessageParametersOptionalA JSON-serialized object containing the parameters of the ephemeral message to send
latitudeFloatYesLatitude of the location
longitudeFloatYesLongitude of the location
horizontal_accuracyFloatOptionalThe radius of uncertainty for the location, measured in meters; 0-1500
live_periodIntegerOptionalPeriod in seconds during which the location will be updated (see Live Locations), must be between 60 and 86400, or 0x7FFFFFFF for live locations that can be edited indefinitely. Must be 0 for ephemeral messages.
headingIntegerOptionalFor live locations, a direction in which the user is moving, in degrees. Must be between 1 and 360 if specified.
proximity_alert_radiusIntegerOptionalFor live locations, a maximum distance for proximity alerts about approaching another chat member, in meters. Must be between 1 and 100000 if specified.
disable_notificationBooleanOptionalSends the message silently. Users will receive a notification with no sound.
protect_contentBooleanOptionalProtects the contents of the sent message from forwarding and saving
allow_paid_broadcastBooleanOptionalPass True to allow up to 1000 messages per second, ignoring broadcasting limits for a fee of 0.1 Telegram Stars per message. The relevant Stars will be withdrawn from the bot's balance.
message_effect_idStringOptionalUnique identifier of the message effect to be added to the message; for private chats only
suggested_post_parametersSuggestedPostParametersOptionalA JSON-serialized object containing the parameters of the suggested post to send; for direct messages chats only. If the message is sent as a reply to another suggested post, then that suggested post is automatically declined.
reply_parametersReplyParametersOptionalDescription of the message to reply to
reply_markupInlineKeyboardMarkup or ReplyKeyboardMarkup or ReplyKeyboardRemove or ForceReplyOptionalAdditional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove a reply keyboard or to force a reply from the user.
+

sendVenue

+

Use this method to send information about a venue. On success, the sent Message is returned.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ParameterTypeRequiredDescription
business_connection_idStringOptionalUnique identifier of the business connection on behalf of which the message will be sent
chat_idInteger or StringOptionalUnique identifier for the target chat or username of the target bot, supergroup, or channel in the format @username; required unless the message is sent as an ephemeral reply to a callback query
message_thread_idIntegerOptionalUnique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only
direct_messages_topic_idIntegerOptionalIdentifier of the direct messages topic to which the message will be sent; required if the message is sent to a direct messages chat
ephemeral_message_parametersEphemeralMessageParametersOptionalA JSON-serialized object containing the parameters of the ephemeral message to send
latitudeFloatYesLatitude of the venue
longitudeFloatYesLongitude of the venue
titleStringYesName of the venue
addressStringYesAddress of the venue
foursquare_idStringOptionalFoursquare identifier of the venue
foursquare_typeStringOptionalFoursquare type of the venue, if known. (For example, “arts_entertainment/default”, “arts_entertainment/aquarium” or “food/icecream”.)
google_place_idStringOptionalGoogle Places identifier of the venue
google_place_typeStringOptionalGoogle Places type of the venue. (See supported types.)
disable_notificationBooleanOptionalSends the message silently. Users will receive a notification with no sound.
protect_contentBooleanOptionalProtects the contents of the sent message from forwarding and saving
allow_paid_broadcastBooleanOptionalPass True to allow up to 1000 messages per second, ignoring broadcasting limits for a fee of 0.1 Telegram Stars per message. The relevant Stars will be withdrawn from the bot's balance.
message_effect_idStringOptionalUnique identifier of the message effect to be added to the message; for private chats only
suggested_post_parametersSuggestedPostParametersOptionalA JSON-serialized object containing the parameters of the suggested post to send; for direct messages chats only. If the message is sent as a reply to another suggested post, then that suggested post is automatically declined.
reply_parametersReplyParametersOptionalDescription of the message to reply to
reply_markupInlineKeyboardMarkup or ReplyKeyboardMarkup or ReplyKeyboardRemove or ForceReplyOptionalAdditional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove a reply keyboard or to force a reply from the user.
+

sendContact

+

Use this method to send phone contacts. On success, the sent Message is returned.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ParameterTypeRequiredDescription
business_connection_idStringOptionalUnique identifier of the business connection on behalf of which the message will be sent
chat_idInteger or StringOptionalUnique identifier for the target chat or username of the target bot, supergroup, or channel in the format @username; required unless the message is sent as an ephemeral reply to a callback query
message_thread_idIntegerOptionalUnique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only
direct_messages_topic_idIntegerOptionalIdentifier of the direct messages topic to which the message will be sent; required if the message is sent to a direct messages chat
ephemeral_message_parametersEphemeralMessageParametersOptionalA JSON-serialized object containing the parameters of the ephemeral message to send
phone_numberStringYesContact's phone number
first_nameStringYesContact's first name
last_nameStringOptionalContact's last name
vcardStringOptionalAdditional data about the contact in the form of a vCard, 0-2048 bytes
disable_notificationBooleanOptionalSends the message silently. Users will receive a notification with no sound.
protect_contentBooleanOptionalProtects the contents of the sent message from forwarding and saving
allow_paid_broadcastBooleanOptionalPass True to allow up to 1000 messages per second, ignoring broadcasting limits for a fee of 0.1 Telegram Stars per message. The relevant Stars will be withdrawn from the bot's balance.
message_effect_idStringOptionalUnique identifier of the message effect to be added to the message; for private chats only
suggested_post_parametersSuggestedPostParametersOptionalA JSON-serialized object containing the parameters of the suggested post to send; for direct messages chats only. If the message is sent as a reply to another suggested post, then that suggested post is automatically declined.
reply_parametersReplyParametersOptionalDescription of the message to reply to
reply_markupInlineKeyboardMarkup or ReplyKeyboardMarkup or ReplyKeyboardRemove or ForceReplyOptionalAdditional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove a reply keyboard or to force a reply from the user.
+

sendPoll

+

Use this method to send a native poll. On success, the sent Message is returned.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ParameterTypeRequiredDescription
business_connection_idStringOptionalUnique identifier of the business connection on behalf of which the message will be sent
chat_idInteger or StringYesUnique identifier for the target chat or username of the target bot, supergroup, or channel in the format @username. Polls can't be sent to channel direct messages chats.
message_thread_idIntegerOptionalUnique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only
questionStringYesPoll question, 1-300 characters
question_parse_modeStringOptionalMode for parsing entities in the question. See formatting options for more details. Currently, only custom emoji entities are allowed.
question_entitiesArray of MessageEntityOptionalA JSON-serialized list of special entities that appear in the poll question. It can be specified instead of question_parse_mode.
optionsArray of InputPollOptionYesA JSON-serialized list of 1-12 answer options
is_anonymousBooleanOptionalTrue, if the poll needs to be anonymous, defaults to True
typeStringOptionalPoll type, “quiz” or “regular”, defaults to “regular”
allows_multiple_answersBooleanOptionalPass True if the poll allows multiple answers, defaults to False
allows_revotingBooleanOptionalPass True if the poll allows changing the chosen answer options, defaults to False for quizzes and to True for regular polls
shuffle_optionsBooleanOptionalPass True if the poll options must be shown in random order
allow_adding_optionsBooleanOptionalPass True if answer options can be added to the poll after creation; not supported for anonymous polls and quizzes
hide_results_until_closesBooleanOptionalPass True if poll results must be shown only after the poll closes
members_onlyBooleanOptionalPass True if voting is limited to users who have been members of the chat where the poll is being sent for more than 24 hours; for channel chats only
country_codesArray of StringOptionalA JSON-serialized list of 0-12 two-letter ISO 3166-1 alpha-2 country codes indicating the countries from which users can vote in the poll; for channel chats only. Use “FT” as a country code to allow users with anonymous numbers to vote. If omitted or empty, then users from any country can participate in the poll.
correct_option_idsArray of IntegerOptionalA JSON-serialized list of monotonically increasing 0-based identifiers of the correct answer options, required for polls in quiz mode
explanationStringOptionalText that is shown when a user chooses an incorrect answer or taps on the lamp icon in a quiz-style poll, 0-200 characters with at most 2 line feeds after entities parsing
explanation_parse_modeStringOptionalMode for parsing entities in the explanation. See formatting options for more details.
explanation_entitiesArray of MessageEntityOptionalA JSON-serialized list of special entities that appear in the poll explanation. It can be specified instead of explanation_parse_mode.
explanation_mediaInputPollMediaOptionalMedia added to the quiz explanation
open_periodIntegerOptionalAmount of time in seconds the poll will be active after creation, 5-2628000. Can't be used together with close_date.
close_dateIntegerOptionalPoint in time (Unix timestamp) when the poll will be automatically closed. Must be at least 5 and no more than 2628000 seconds in the future. Can't be used together with open_period.
is_closedBooleanOptionalPass True if the poll needs to be immediately closed. This can be useful for poll preview.
descriptionStringOptionalDescription of the poll to be sent, 0-1024 characters after entities parsing
description_parse_modeStringOptionalMode for parsing entities in the poll description. See formatting options for more details.
description_entitiesArray of MessageEntityOptionalA JSON-serialized list of special entities that appear in the poll description, which can be specified instead of description_parse_mode
mediaInputPollMediaOptionalMedia added to the poll description
disable_notificationBooleanOptionalSends the message silently. Users will receive a notification with no sound.
protect_contentBooleanOptionalProtects the contents of the sent message from forwarding and saving
allow_paid_broadcastBooleanOptionalPass True to allow up to 1000 messages per second, ignoring broadcasting limits for a fee of 0.1 Telegram Stars per message. The relevant Stars will be withdrawn from the bot's balance.
message_effect_idStringOptionalUnique identifier of the message effect to be added to the message; for private chats only
reply_parametersReplyParametersOptionalDescription of the message to reply to
reply_markupInlineKeyboardMarkup or ReplyKeyboardMarkup or ReplyKeyboardRemove or ForceReplyOptionalAdditional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove a reply keyboard or to force a reply from the user.
+

sendChecklist

+

Use this method to send a checklist on behalf of a connected business account. On success, the sent Message is returned.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ParameterTypeRequiredDescription
business_connection_idStringYesUnique identifier of the business connection on behalf of which the message will be sent
chat_idInteger or StringYesUnique identifier for the target chat or username of the target bot in the format @username
checklistInputChecklistYesA JSON-serialized object for the checklist to send
disable_notificationBooleanOptionalSends the message silently. Users will receive a notification with no sound.
protect_contentBooleanOptionalProtects the contents of the sent message from forwarding and saving
message_effect_idStringOptionalUnique identifier of the message effect to be added to the message
reply_parametersReplyParametersOptionalA JSON-serialized object for description of the message to reply to
reply_markupInlineKeyboardMarkupOptionalA JSON-serialized object for an inline keyboard
+

sendDice

+

Use this method to send an animated emoji that will display a random value. On success, the sent Message is returned.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ParameterTypeRequiredDescription
business_connection_idStringOptionalUnique identifier of the business connection on behalf of which the message will be sent
chat_idInteger or StringYesUnique identifier for the target chat or username of the target bot, supergroup, or channel in the format @username
message_thread_idIntegerOptionalUnique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only
direct_messages_topic_idIntegerOptionalIdentifier of the direct messages topic to which the message will be sent; required if the message is sent to a direct messages chat
emojiStringOptionalEmoji on which the dice throw animation is based. Currently, must be one of “🎲”, “🎯”, “🏀”, “⚽”, “🎳”, or “🎰”. Dice can have values 1-6 for “🎲”, “🎯” and “🎳”, values 1-5 for “🏀” and “⚽”, and values 1-64 for “🎰”. Defaults to “🎲”.
disable_notificationBooleanOptionalSends the message silently. Users will receive a notification with no sound.
protect_contentBooleanOptionalProtects the contents of the sent message from forwarding
allow_paid_broadcastBooleanOptionalPass True to allow up to 1000 messages per second, ignoring broadcasting limits for a fee of 0.1 Telegram Stars per message. The relevant Stars will be withdrawn from the bot's balance.
message_effect_idStringOptionalUnique identifier of the message effect to be added to the message; for private chats only
suggested_post_parametersSuggestedPostParametersOptionalA JSON-serialized object containing the parameters of the suggested post to send; for direct messages chats only. If the message is sent as a reply to another suggested post, then that suggested post is automatically declined.
reply_parametersReplyParametersOptionalDescription of the message to reply to
reply_markupInlineKeyboardMarkup or ReplyKeyboardMarkup or ReplyKeyboardRemove or ForceReplyOptionalAdditional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove a reply keyboard or to force a reply from the user.
+

sendMessageDraft

+

Use 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 call sendMessage with the complete message to persist it in the user's chat. Returns True on success.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ParameterTypeRequiredDescription
chat_idIntegerYesUnique identifier for the target private chat
message_thread_idIntegerOptionalUnique identifier for the target message thread
draft_idIntegerYesUnique identifier of the message draft; must be non-zero. Changes to drafts with the same identifier are animated. Otherwise, the draft is replaced without animation.
textStringOptionalText of the message to be sent, 0-4096 characters after entities parsing. Pass an empty text to show a “Thinking…” placeholder.
parse_modeStringOptionalMode for parsing entities in the message text. See formatting options for more details.
entitiesArray of MessageEntityOptionalA JSON-serialized list of special entities that appear in message text, which can be specified instead of parse_mode
can_stopBooleanOptionalPass True to show the user a button to stop further drafts. The bot will receive an Update “stopped_message_generation” if the user presses the button.
keep_on_stopBooleanOptionalPass True to keep the draft in the chat when the button is pressed. The draft will still disappear after a short time or if the bot sends a message. To fully preserve the partial draft, the bot should send it as a new message.
+

sendChatAction

+

Use 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). Returns True on success.

+
+

Example: The ImageBot needs some time to process a request and upload the image. Instead of sending a text message along the lines of “Retrieving image, please wait…”, the bot may use sendChatAction with action = upload_photo. The user will see a “sending photo” status for the bot.

+
+

We only recommend using this method when a response from the bot will take a noticeable amount of time to arrive.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ParameterTypeRequiredDescription
business_connection_idStringOptionalUnique identifier of the business connection on behalf of which the action will be sent
chat_idInteger or StringYesUnique identifier for the target chat or username of the target bot or supergroup in the format @username. Channel chats and channel direct messages chats aren't supported.
message_thread_idIntegerOptionalUnique identifier for the target message thread or topic of a forum; for supergroups and private chats of bots with forum topic mode enabled only
actionStringYesType of action to broadcast. Choose one, depending on what the user is about to receive: typing for text messages, upload_photo for photos, record_video or upload_video for videos, record_voice or upload_voice for voice notes, upload_document for general files, choose_sticker for stickers, find_location for location data, record_video_note or upload_video_note for video notes.
+

setMessageReaction

+

Use 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 as messages in the channel. Bots can't use paid reactions. Returns True on success.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ParameterTypeRequiredDescription
chat_idInteger or StringYesUnique identifier for the target chat or username of the target bot, supergroup, or channel in the format @username
message_idIntegerYesIdentifier of the target message. If the message belongs to a media group, the reaction is set to the first non-deleted message in the group instead.
reactionArray of ReactionTypeOptionalA JSON-serialized list of reaction types to set on the message. Currently, as non-premium users, bots can set up to one reaction per message. A custom emoji reaction can be used if it is either already present on the message or explicitly allowed by chat administrators. Paid reactions can't be used by bots.
is_bigBooleanOptionalPass True to set the reaction with a big animation
+

getUserProfilePhotos

+

Use this method to get a list of profile pictures for a user. Returns a UserProfilePhotos object.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ParameterTypeRequiredDescription
user_idIntegerYesUnique identifier of the target user
offsetIntegerOptionalSequential number of the first photo to be returned. By default, all photos are returned.
limitIntegerOptionalLimits the number of photos to be retrieved. Values between 1-100 are accepted. Defaults to 100.
+

getUserProfileAudios

+

Use this method to get a list of profile audios for a user. Returns a UserProfileAudios object.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ParameterTypeRequiredDescription
user_idIntegerYesUnique identifier of the target user
offsetIntegerOptionalSequential number of the first audio to be returned. By default, all audios are returned.
limitIntegerOptionalLimits the number of audios to be retrieved. Values between 1-100 are accepted. Defaults to 100.
+

setUserEmojiStatus

+

Changes 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.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ParameterTypeRequiredDescription
user_idIntegerYesUnique identifier of the target user
emoji_status_custom_emoji_idStringOptionalCustom emoji identifier of the emoji status to set. Pass an empty string to remove the status.
emoji_status_expiration_dateIntegerOptionalExpiration date of the emoji status, if any
+

getFile

+

Use 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 via the link https://api.telegram.org/file/bot<token>/<file_path>, where <file_path> is taken from the response. It is guaranteed that the link will be valid for at least 1 hour. When the link expires, a new one can be requested by calling getFile again.

+ + + + + + + + + + + + + + + + + +
ParameterTypeRequiredDescription
file_idStringYesFile identifier to get information about
+

Note: This function may not preserve the original file name and MIME type. You should save the file's MIME type and name (if available) when the File object is received.

+

banChatMember

+

Use 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. The bot must be an administrator in the chat for this to work and must have the appropriate administrator rights. Returns True on success.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ParameterTypeRequiredDescription
chat_idInteger or StringYesUnique identifier for the target group or username of the target supergroup or channel in the format @username
user_idIntegerYesUnique identifier of the target user
until_dateIntegerOptionalDate when the user will be unbanned; Unix time. If the user is banned for more than 366 days or less than 30 seconds from the current time, they are considered to be banned forever. Applied for supergroups and channels only.
revoke_messagesBooleanOptionalPass True to delete all messages from the chat for the user that is being removed. If False, the user will be able to see messages in the group that were sent before the user was removed. Always True for supergroups and channels.
+

unbanChatMember

+

Use 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 this to work. By default, this method guarantees that after the call the user is not a member of the chat, but will be able to join it. So if the user is a member of the chat they will also be removed from the chat. If you don't want this, use the parameter only_if_banned. Returns True on success.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ParameterTypeRequiredDescription
chat_idInteger or StringYesUnique identifier for the target group or username of the target supergroup or channel in the format @username
user_idIntegerYesUnique identifier of the target user
only_if_bannedBooleanOptionalDo nothing if the user is not banned
+

restrictChatMember

+

Use 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 restrictions from a user. Returns True on success.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ParameterTypeRequiredDescription
chat_idInteger or StringYesUnique identifier for the target chat or username of the target supergroup in the format @username
user_idIntegerYesUnique identifier of the target user
permissionsChatPermissionsYesA JSON-serialized object for new user permissions
use_independent_chat_permissionsBooleanOptionalPass True if chat permissions are set independently. Otherwise, the can_send_other_messages and can_add_web_page_previews permissions will imply the can_send_messages, can_send_audios, can_send_documents, can_send_photos, can_send_videos, can_send_video_notes, and can_send_voice_notes permissions; the can_send_polls permission will imply the can_send_messages permission.
until_dateIntegerOptionalDate when restrictions will be lifted for the user; Unix time. If the user is restricted for more than 366 days or less than 30 seconds from the current time, they are considered to be restricted forever.
+

promoteChatMember

+

Use 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 parameters to demote a user. Returns True on success.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ParameterTypeRequiredDescription
chat_idInteger or StringYesUnique identifier for the target chat or username of the target channel in the format @username
user_idIntegerYesUnique identifier of the target user
is_anonymousBooleanOptionalPass True if the administrator's presence in the chat is hidden
can_manage_chatBooleanOptionalPass True if the administrator can access the chat event log, get boost list, see hidden supergroup and channel members, report spam messages, ignore slow mode, and send messages to the chat without paying Telegram Stars. Implied by any other administrator privilege.
can_delete_messagesBooleanOptionalPass True if the administrator can delete messages of other users
can_manage_video_chatsBooleanOptionalPass True if the administrator can manage video chats
can_restrict_membersBooleanOptionalPass True if the administrator can restrict, ban or unban chat members, or access supergroup statistics. For backward compatibility, defaults to True for promotions of channel administrators.
can_promote_membersBooleanOptionalPass True if the administrator can add new administrators with a subset of their own privileges or demote administrators that they have promoted, directly or indirectly (promoted by administrators that were appointed by him)
can_change_infoBooleanOptionalPass True if the administrator can change the chat title, photo and other settings
can_invite_usersBooleanOptionalPass True if the administrator can invite new users to the chat
can_post_storiesBooleanOptionalPass True if the administrator can post stories to the chat
can_edit_storiesBooleanOptionalPass True if the administrator can edit stories posted by other users, post stories to the chat page, pin chat stories, and access the chat's story archive
can_delete_storiesBooleanOptionalPass True if the administrator can delete stories posted by other users
can_post_messagesBooleanOptionalPass True if the administrator can post messages in the channel, approve suggested posts, or access channel statistics; for channels only
can_edit_messagesBooleanOptionalPass True if the administrator can edit messages of other users and can pin messages; for channels only
can_pin_messagesBooleanOptionalPass True if the administrator can pin messages; for supergroups only
can_manage_topicsBooleanOptionalPass True if the user is allowed to create, rename, close, and reopen forum topics; for supergroups only
can_manage_direct_messagesBooleanOptionalPass True if the administrator can manage direct messages within the channel and decline suggested posts; for channels only
can_manage_tagsBooleanOptionalPass True if the administrator can edit the tags of regular members; for groups and supergroups only
can_send_welcome_messagesBooleanOptionalPass True if the administrator can manage chat welcome messages or directly send them in the case of bots
+

setChatAdministratorCustomTitle

+

Use this method to set a custom title for an administrator in a supergroup promoted by the bot. Returns True on success.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ParameterTypeRequiredDescription
chat_idInteger or StringYesUnique identifier for the target chat or username of the target supergroup in the format @username
user_idIntegerYesUnique identifier of the target user
custom_titleStringYesNew custom title for the administrator; 0-16 characters, emoji are not allowed
+

setChatMemberTag

+

Use 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.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ParameterTypeRequiredDescription
chat_idInteger or StringYesUnique identifier for the target chat or username of the target supergroup in the format @username
user_idIntegerYesUnique identifier of the target user
tagStringOptionalNew tag for the member; 0-16 characters, emoji are not allowed
+

banChatSenderChat

+

Use 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 administrator in the supergroup or channel for this to work and must have the appropriate administrator rights. Returns True on success.

+ + + + + + + + + + + + + + + + + + + + + + + +
ParameterTypeRequiredDescription
chat_idInteger or StringYesUnique identifier for the target chat or username of the target channel in the format @username
sender_chat_idIntegerYesUnique identifier of the target sender chat
+

unbanChatSenderChat

+

Use 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.

+ + + + + + + + + + + + + + + + + + + + + + + +
ParameterTypeRequiredDescription
chat_idInteger or StringYesUnique identifier for the target chat or username of the target channel in the format @username
sender_chat_idIntegerYesUnique identifier of the target sender chat
+

setChatPermissions

+

Use 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 right. Returns True on success.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ParameterTypeRequiredDescription
chat_idInteger or StringYesUnique identifier for the target chat or username of the target supergroup in the format @username
permissionsChatPermissionsYesA JSON-serialized object for new default chat permissions
use_independent_chat_permissionsBooleanOptionalPass True if chat permissions are set independently. Otherwise, the can_send_other_messages and can_add_web_page_previews permissions will imply the can_send_messages, can_send_audios, can_send_documents, can_send_photos, can_send_videos, can_send_video_notes, and can_send_voice_notes permissions; the can_send_polls permission will imply the can_send_messages permission.
+

exportChatInviteLink

+

Use 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 administrator rights. Returns the new invite link as String on success.

+ + + + + + + + + + + + + + + + + +
ParameterTypeRequiredDescription
chat_idInteger or StringYesUnique identifier for the target chat or username of the target channel in the format @username
+
+

Note: Each administrator in a chat generates their own invite links. Bots can't use invite links generated by other administrators. If you want your bot to work with invite links, it will need to generate its own link using exportChatInviteLink or by calling the getChat method. If your bot needs to generate a new primary invite link replacing its previous one, use exportChatInviteLink again.

+
+

createChatInviteLink

+

Use 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 revokeChatInviteLink. Returns the new invite link as a ChatInviteLink object.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ParameterTypeRequiredDescription
chat_idInteger or StringYesUnique identifier for the target chat or username of the target channel in the format @username
nameStringOptionalInvite link name; 0-32 characters
expire_dateIntegerOptionalPoint in time (Unix timestamp) when the link will expire
member_limitIntegerOptionalThe maximum number of users that can be members of the chat simultaneously after joining the chat via this invite link; 1-99999
creates_join_requestBooleanOptionalTrue, if users joining the chat via the link need to be approved by chat administrators. If True, member_limit can't be specified.
+

editChatInviteLink

+

Use 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 ChatInviteLink object.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ParameterTypeRequiredDescription
chat_idInteger or StringYesUnique identifier for the target chat or username of the target channel in the format @username
invite_linkStringYesThe invite link to edit
nameStringOptionalInvite link name; 0-32 characters
expire_dateIntegerOptionalPoint in time (Unix timestamp) when the link will expire
member_limitIntegerOptionalThe maximum number of users that can be members of the chat simultaneously after joining the chat via this invite link; 1-99999
creates_join_requestBooleanOptionalTrue, if users joining the chat via the link need to be approved by chat administrators. If True, member_limit can't be specified.
+

createChatSubscriptionInviteLink

+

Use this method to create a subscription invite link for a channel chat. The bot must have the can_invite_users administrator right. The link can be edited using the method editChatSubscriptionInviteLink or revoked using the method revokeChatInviteLink. Returns the new invite link as a ChatInviteLink object.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ParameterTypeRequiredDescription
chat_idInteger or StringYesUnique identifier for the target channel chat or username of the target channel in the format @username
nameStringOptionalInvite link name; 0-32 characters
subscription_periodIntegerYesThe number of seconds the subscription will be active for before the next payment. Currently, it must always be 2592000 (30 days).
subscription_priceIntegerYesThe amount of Telegram Stars a user must pay initially and after each subsequent subscription period to be a member of the chat; 1-10000
+

editChatSubscriptionInviteLink

+

Use this method to edit a subscription invite link created by the bot. The bot must have the can_invite_users administrator right. Returns the edited invite link as a ChatInviteLink object.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ParameterTypeRequiredDescription
chat_idInteger or StringYesUnique identifier for the target chat or username of the target channel in the format @username
invite_linkStringYesThe invite link to edit
nameStringOptionalInvite link name; 0-32 characters
+

revokeChatInviteLink

+

Use 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 appropriate administrator rights. Returns the revoked invite link as a ChatInviteLink object.

+ + + + + + + + + + + + + + + + + + + + + + + +
ParameterTypeRequiredDescription
chat_idInteger or StringYesUnique identifier of the target chat or username of the target channel in the format @username
invite_linkStringYesThe invite link to revoke
+

approveChatJoinRequest

+

Use 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.

+ + + + + + + + + + + + + + + + + + + + + + + +
ParameterTypeRequiredDescription
chat_idInteger or StringYesUnique identifier for the target chat or username of the target channel in the format @username
user_idIntegerYesUnique identifier of the target user
+

declineChatJoinRequest

+

Use 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.

+ + + + + + + + + + + + + + + + + + + + + + + +
ParameterTypeRequiredDescription
chat_idInteger or StringYesUnique identifier for the target chat or username of the target channel in the format @username
user_idIntegerYesUnique identifier of the target user
+

answerChatJoinRequestQuery

+

Use this method to process a received chat join request query. Returns True on success.

+ + + + + + + + + + + + + + + + + + + + + + + +
ParameterTypeRequiredDescription
chat_join_request_query_idStringYesUnique identifier of the join request query
resultStringYesResult of the query. Must be either “approve” to allow the user to join the chat, “decline” to disallow the user to join the chat, or “queue” to leave the decision to other administrators.
+

sendChatJoinRequestWebApp

+

Use 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 interaction with the Mini App. Returns True on success.

+ + + + + + + + + + + + + + + + + + + + + + + +
ParameterTypeRequiredDescription
chat_join_request_query_idStringYesUnique identifier of the join request query
web_app_urlStringYesAn HTTPS URL of a Web App to be opened with additional data as specified in Initializing Web Apps
+

setChatPhoto

+

Use 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. Returns True on success.

+ + + + + + + + + + + + + + + + + + + + + + + +
ParameterTypeRequiredDescription
chat_idInteger or StringYesUnique identifier for the target chat or username of the target channel in the format @username
photoInputFileYesNew chat photo, uploaded using multipart/form-data
+

deleteChatPhoto

+

Use 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 success.

+ + + + + + + + + + + + + + + + + +
ParameterTypeRequiredDescription
chat_idInteger or StringYesUnique identifier for the target chat or username of the target channel in the format @username
+

setChatTitle

+

Use 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 success.

+ + + + + + + + + + + + + + + + + + + + + + + +
ParameterTypeRequiredDescription
chat_idInteger or StringYesUnique identifier for the target chat or username of the target channel in the format @username
titleStringYesNew chat title, 1-128 characters
+

setChatDescription

+

Use 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.

+ + + + + + + + + + + + + + + + + + + + + + + +
ParameterTypeRequiredDescription
chat_idInteger or StringYesUnique identifier for the target chat or username of the target channel in the format @username
descriptionStringOptionalNew chat description, 0-255 characters
+

pinChatMessage

+

Use 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 the 'can_pin_messages' right or the 'can_edit_messages' right to pin messages in groups and channels respectively. Returns True on success.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ParameterTypeRequiredDescription
business_connection_idStringOptionalUnique identifier of the business connection on behalf of which the message will be pinned
chat_idInteger or StringYesUnique identifier for the target chat or username of the target channel in the format @username
message_idIntegerYesIdentifier of a message to pin
disable_notificationBooleanOptionalPass True if it is not necessary to send a notification to all chat members about the new pinned message. Notifications are always disabled in channels and private chats.
+

unpinChatMessage

+

Use 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 'can_pin_messages' right or the 'can_edit_messages' right to unpin messages in groups and channels respectively. Returns True on success.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ParameterTypeRequiredDescription
business_connection_idStringOptionalUnique identifier of the business connection on behalf of which the message will be unpinned
chat_idInteger or StringYesUnique identifier for the target chat or username of the target channel in the format @username
message_idIntegerOptionalIdentifier of the message to unpin. Required if business_connection_id is specified. If not specified, the most recent pinned message (by sending date) will be unpinned.
+

unpinAllChatMessages

+

Use 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 administrator with the 'can_pin_messages' right or the 'can_edit_messages' right to unpin all pinned messages in groups and channels respectively. Returns True on success.

+ + + + + + + + + + + + + + + + + +
ParameterTypeRequiredDescription
chat_idInteger or StringYesUnique identifier for the target chat or username of the target channel in the format @username
+

leaveChat

+

Use this method for your bot to leave a group, supergroup or channel. Returns True on success.

+ + + + + + + + + + + + + + + + + +
ParameterTypeRequiredDescription
chat_idInteger or StringYesUnique identifier for the target chat or username of the target supergroup or channel in the format @username. Channel direct messages chats aren't supported; leave the corresponding channel instead.
+

getChat

+

Use this method to get up-to-date information about the chat. Returns a ChatFullInfo object on success.

+ + + + + + + + + + + + + + + + + +
ParameterTypeRequiredDescription
chat_idInteger or StringYesUnique identifier for the target chat or username of the target supergroup or channel in the format @username
+

getChatAdministrators

+

Use this method to get a list of administrators in a chat. Returns an Array of ChatMember objects.

+ + + + + + + + + + + + + + + + + + + + + + + +
ParameterTypeRequiredDescription
chat_idInteger or StringYesUnique identifier for the target chat or username of the target supergroup or channel in the format @username
return_botsBooleanOptionalPass True to additionally receive all bots that are administrators of the chat. By default, bots other than the current bot are omitted.
+

getChatMemberCount

+

Use this method to get the number of members in a chat. Returns Integer on success.

+ + + + + + + + + + + + + + + + + +
ParameterTypeRequiredDescription
chat_idInteger or StringYesUnique identifier for the target chat or username of the target supergroup or channel in the format @username
+

getChatMember

+

Use 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.

+ + + + + + + + + + + + + + + + + + + + + + + +
ParameterTypeRequiredDescription
chat_idInteger or StringYesUnique identifier for the target chat or username of the target supergroup or channel in the format @username
user_idIntegerYesUnique identifier of the target user
+

getChatShareThemeBackdrops

+

Use 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.

+

getUserPersonalChatMessages

+

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. On success, an Array of Message objects is returned.

+ + + + + + + + + + + + + + + + + + + + + + + +
ParameterTypeRequiredDescription
user_idIntegerYesUnique identifier for the target user
limitIntegerYesThe maximum number of messages to return; 1-20
+

setChatStickerSet

+

Use 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 optionally returned in getChat requests to check if the bot can use this method. Returns True on success.

+ + + + + + + + + + + + + + + + + + + + + + + +
ParameterTypeRequiredDescription
chat_idInteger or StringYesUnique identifier for the target chat or username of the target supergroup in the format @username
sticker_set_nameStringYesName of the sticker set to be set as the group sticker set
+

deleteChatStickerSet

+

Use 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 optionally returned in getChat requests to check if the bot can use this method. Returns True on success.

+ + + + + + + + + + + + + + + + + +
ParameterTypeRequiredDescription
chat_idInteger or StringYesUnique identifier for the target chat or username of the target supergroup in the format @username
+

getForumTopicIconStickers

+

Use 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.

+

createForumTopic

+

Use 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_topics administrator right. In the case of a private chat, a link to the topic can be created in the format https://t.me/<bot_username>/<message_thread_id>; the link opens the topic only for the user. Returns information about the created topic as a ForumTopic object.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ParameterTypeRequiredDescription
chat_idInteger or StringYesUnique identifier for the target chat or username of the target supergroup in the format @username
nameStringYesTopic name, 1-128 characters
icon_colorIntegerOptionalColor of the topic icon in RGB format. Currently, must be one of 7322096 (0x6FB9F0), 16766590 (0xFFD67E), 13338331 (0xCB86DB), 9367192 (0x8EEE98), 16749490 (0xFF93B2), or 16478047 (0xFB6F5F).
icon_custom_emoji_idStringOptionalUnique identifier of the custom emoji shown as the topic icon. Use getForumTopicIconStickers to get all allowed custom emoji identifiers.
+

editForumTopic

+

Use this method to edit the 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 can_manage_topics administrator right, unless it is the creator of the topic. Returns True on success.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ParameterTypeRequiredDescription
chat_idInteger or StringYesUnique identifier for the target chat or username of the target supergroup in the format @username
message_thread_idIntegerYesUnique identifier for the target message thread of the forum topic
nameStringOptionalNew topic name, 0-128 characters. If not specified or empty, the current name of the topic will be kept.
icon_custom_emoji_idStringOptionalNew unique identifier of the custom emoji shown as the topic icon. Use getForumTopicIconStickers to get all allowed custom emoji identifiers. Pass an empty string to remove the icon. If not specified, the current icon will be kept.
+

closeForumTopic

+

Use 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 right, unless it is the creator of the topic. Returns True on success.

+ + + + + + + + + + + + + + + + + + + + + + + +
ParameterTypeRequiredDescription
chat_idInteger or StringYesUnique identifier for the target chat or username of the target supergroup in the format @username
message_thread_idIntegerYesUnique identifier for the target message thread of the forum topic
+

reopenForumTopic

+

Use 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 right, unless it is the creator of the topic. Returns True on success.

+ + + + + + + + + + + + + + + + + + + + + + + +
ParameterTypeRequiredDescription
chat_idInteger or StringYesUnique identifier for the target chat or username of the target supergroup in the format @username
message_thread_idIntegerYesUnique identifier for the target message thread of the forum topic
+

deleteForumTopic

+

Use this method to delete a forum topic along with all its messages in a forum supergroup chat or a private chat with a user. 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_delete_messages administrator right. Returns True on success.

+ + + + + + + + + + + + + + + + + + + + + + + +
ParameterTypeRequiredDescription
chat_idInteger or StringYesUnique identifier for the target chat or username of the target supergroup in the format @username
message_thread_idIntegerYesUnique identifier for the target message thread of the forum topic
+

unpinAllForumTopicMessages

+

Use 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 work and must have the can_pin_messages administrator right in the supergroup. Returns True on success.

+ + + + + + + + + + + + + + + + + + + + + + + +
ParameterTypeRequiredDescription
chat_idInteger or StringYesUnique identifier for the target chat or username of the target supergroup in the format @username
message_thread_idIntegerYesUnique identifier for the target message thread of the forum topic
+

editGeneralForumTopic

+

Use 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 right. Returns True on success.

+ + + + + + + + + + + + + + + + + + + + + + + +
ParameterTypeRequiredDescription
chat_idInteger or StringYesUnique identifier for the target chat or username of the target supergroup in the format @username
nameStringYesNew topic name, 1-128 characters
+

closeGeneralForumTopic

+

Use 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 right. Returns True on success.

+ + + + + + + + + + + + + + + + + +
ParameterTypeRequiredDescription
chat_idInteger or StringYesUnique identifier for the target chat or username of the target supergroup in the format @username
+

reopenGeneralForumTopic

+

Use 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 right. The topic will be automatically unhidden if it was hidden. Returns True on success.

+ + + + + + + + + + + + + + + + + +
ParameterTypeRequiredDescription
chat_idInteger or StringYesUnique identifier for the target chat or username of the target supergroup in the format @username
+

hideGeneralForumTopic

+

Use 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 right. The topic will be automatically closed if it was open. Returns True on success.

+ + + + + + + + + + + + + + + + + +
ParameterTypeRequiredDescription
chat_idInteger or StringYesUnique identifier for the target chat or username of the target supergroup in the format @username
+

unhideGeneralForumTopic

+

Use 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 right. Returns True on success.

+ + + + + + + + + + + + + + + + + +
ParameterTypeRequiredDescription
chat_idInteger or StringYesUnique identifier for the target chat or username of the target supergroup in the format @username
+

unpinAllGeneralForumTopicMessages

+

Use 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. Returns True on success.

+ + + + + + + + + + + + + + + + + +
ParameterTypeRequiredDescription
chat_idInteger or StringYesUnique identifier for the target chat or username of the target supergroup in the format @username
+

answerCallbackQuery

+

Use this method to send answers to callback queries sent from inline keyboards or rich messages. 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.

+
+

Alternatively, the user can be redirected to the specified Game URL. For this option to work, you must first create a game for your bot via @BotFather and accept the terms. Otherwise, you may use links like t.me/your_bot?start=XXXX that open your bot with a parameter.

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ParameterTypeRequiredDescription
callback_query_idStringYesUnique identifier for the query to be answered
textStringOptionalText of the notification. If not specified, nothing will be shown to the user, 0-200 characters.
show_alertBooleanOptionalIf True, an alert will be shown by the client instead of a notification at the top of the chat screen. Defaults to False.
urlStringOptionalURL that will be opened by the user's client. If you have created a Game and accepted the conditions via @BotFather, specify the URL that opens your game - note that this will only work if the query comes from a callback_game button.

Otherwise, you may use links like t.me/your_bot?start=XXXX that open your bot with a parameter.
cache_timeIntegerOptionalThe maximum amount of time in seconds that the result of the callback query may be cached client-side. Defaults to 0.
+

answerWidgetQuery

+

Use 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 editMessageWidgetData or editSharedWidgetData to change it. On success, True is returned.

+ + + + + + + + + + + + + + + + + + + + + + + +
ParameterTypeRequiredDescription
widget_query_idStringYesUnique identifier for the query to be answered
dataStringOptionalData to be returned to the widget, 0-1024 bytes
+

answerGuestQuery

+

Use this method to reply to a received guest message. On success, a SentGuestMessage object is returned.

+ + + + + + + + + + + + + + + + + + + + + + + +
ParameterTypeRequiredDescription
guest_query_idStringYesUnique identifier for the query to be answered
resultInlineQueryResultYesA JSON-serialized object describing the message to be sent
+

getUserChatBoosts

+

Use 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.

+ + + + + + + + + + + + + + + + + + + + + + + +
ParameterTypeRequiredDescription
chat_idInteger or StringYesUnique identifier for the chat or username of the channel in the format @username
user_idIntegerYesUnique identifier of the target user
+

getBusinessConnection

+

Use this method to get information about the connection of the bot with a business account. Returns a BusinessConnection object on success.

+ + + + + + + + + + + + + + + + + +
ParameterTypeRequiredDescription
business_connection_idStringYesUnique identifier of the business connection
+

getManagedBotToken

+

Use this method to get the token of a managed bot. Returns the token as String on success.

+ + + + + + + + + + + + + + + + + +
ParameterTypeRequiredDescription
user_idIntegerYesUser identifier of the managed bot whose token will be returned
+

replaceManagedBotToken

+

Use this method to revoke the current token of a managed bot and generate a new one. Returns the new token as String on success.

+ + + + + + + + + + + + + + + + + +
ParameterTypeRequiredDescription
user_idIntegerYesUser identifier of the managed bot whose token will be replaced
+

getManagedBotAccessSettings

+

Use this method to get the access settings of a managed bot. Returns a BotAccessSettings object on success.

+ + + + + + + + + + + + + + + + + +
ParameterTypeRequiredDescription
user_idIntegerYesUser identifier of the managed bot whose access settings will be returned
+

setManagedBotAccessSettings

+

Use this method to change the access settings of a managed bot. Returns True on success.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ParameterTypeRequiredDescription
user_idIntegerYesUser identifier of the managed bot whose access settings will be changed
is_access_restrictedBooleanYesPass True if only selected users can access the bot. The bot's owner can always access it.
added_user_idsArray of IntegerOptionalA JSON-serialized list of up to 10 identifiers of users who will have access to the bot in addition to its owner. Ignored if is_access_restricted is False.
+

setMySettings

+

Use this method to change the settings of the bot. Settings that aren't specified remain unchanged. Returns True on success.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ParameterTypeRequiredDescription
supports_inline_queriesBooleanOptionalPass True to enable inline mode for the bot or False to disable it
inline_query_placeholderStringOptionalNew placeholder for inline queries, which is shown in the input field after the bot's username. Pass an empty string to use the default placeholder.
needs_inline_query_locationBooleanOptionalPass True to request the location of the user with every inline query to the bot or False to stop requesting it
inline_feedback_share_denominatorIntegerOptionalDenominator of the share of chosen inline results received by the bot; the bot receives 1 out of inline_feedback_share_denominator chosen results. Must be one of 1, 10, 100, or 1000. Pass 0 to stop receiving chosen inline results.
can_join_groupsBooleanOptionalPass True to allow adding the bot to groups or False to disallow it
can_read_all_group_messagesBooleanOptionalPass True to disable privacy mode for the bot or False to enable it
can_connect_to_businessBooleanOptionalPass True to allow connecting the bot to user accounts to manage them or False to disallow it
can_manage_botsBooleanOptionalPass True to allow creating other bots that will be controlled by the bot or False to disallow it
supports_guest_queriesBooleanOptionalPass True to allow guest queries to the bot from chats it isn't a member of or False to disallow them
supports_join_request_queriesBooleanOptionalPass True to allow assigning the bot to process join request queries or False to disallow it
has_topics_enabledBooleanOptionalPass True to enable forum topic mode in private chats with the bot or False to disable it
allows_users_to_create_topicsBooleanOptionalPass True to allow users to create and delete topics in private chats with the bot or False to disallow it
has_topic_sidebarBooleanOptionalPass True to show topics in private chats with the bot in a sidebar or False to stop showing them in a sidebar
can_communicate_with_botsBooleanOptionalPass True to allow the bot to communicate with other bots in groups, private chats, and through business accounts or False to disallow it
callback_query_modeStringOptionalMode in which the bot receives callback queries from buttons in messages sent by the bot. Must be one of “default” (the field message is always used and contains an InaccessibleMessage if the message is inaccessible to the bot), “auto” (the field inline_message_id is used instead of the field message if the message is inaccessible to the bot; the field message can still contain an inaccessible message if the message has just been deleted), or “inline” (the field inline_message_id is always used instead of the field message).
+

setMyCommands

+

Use this method to change the list of the bot's commands. See this manual for more details about bot commands. Returns True on success.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ParameterTypeRequiredDescription
commandsArray of BotCommandYesA JSON-serialized list of bot commands to be set as the list of the bot's commands. At most 100 commands can be specified.
scopeBotCommandScopeOptionalA JSON-serialized object, describing scope of users for which the commands are relevant. Defaults to BotCommandScopeDefault.
language_codeStringOptionalA two-letter ISO 639-1 language code. If empty, commands will be applied to all users from the given scope, for whose language there are no dedicated commands.
+

deleteMyCommands

+

Use 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.

+ + + + + + + + + + + + + + + + + + + + + + + +
ParameterTypeRequiredDescription
scopeBotCommandScopeOptionalA JSON-serialized object, describing scope of users for which the commands are relevant. Defaults to BotCommandScopeDefault.
language_codeStringOptionalA two-letter ISO 639-1 language code. If empty, commands will be applied to all users from the given scope, for whose language there are no dedicated commands.
+

getMyCommands

+

Use 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.

+ + + + + + + + + + + + + + + + + + + + + + + +
ParameterTypeRequiredDescription
scopeBotCommandScopeOptionalA JSON-serialized object, describing scope of users. Defaults to BotCommandScopeDefault.
language_codeStringOptionalA two-letter ISO 639-1 language code or an empty string
+

setMyName

+

Use this method to change the bot's name. Returns True on success.

+ + + + + + + + + + + + + + + + + + + + + + + +
ParameterTypeRequiredDescription
nameStringOptionalNew bot name; 0-64 characters. Pass an empty string to remove the dedicated name for the given language.
language_codeStringOptionalA two-letter ISO 639-1 language code. If empty, the name will be shown to all users for whose language there is no dedicated name.
+

getMyName

+

Use this method to get the current bot name for the given user language. Returns BotName on success.

+ + + + + + + + + + + + + + + + + +
ParameterTypeRequiredDescription
language_codeStringOptionalA two-letter ISO 639-1 language code or an empty string
+

setMyDescription

+

Use 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.

+ + + + + + + + + + + + + + + + + + + + + + + +
ParameterTypeRequiredDescription
descriptionStringOptionalNew bot description; 0-512 characters. Pass an empty string to remove the dedicated description for the given language.
language_codeStringOptionalA two-letter ISO 639-1 language code. If empty, the description will be applied to all users for whose language there is no dedicated description.
+

getMyDescription

+

Use this method to get the current bot description for the given user language. Returns BotDescription on success.

+ + + + + + + + + + + + + + + + + +
ParameterTypeRequiredDescription
language_codeStringOptionalA two-letter ISO 639-1 language code or an empty string
+

setMyShortDescription

+

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. Returns True on success.

+ + + + + + + + + + + + + + + + + + + + + + + +
ParameterTypeRequiredDescription
short_descriptionStringOptionalNew short description for the bot; 0-120 characters. Pass an empty string to remove the dedicated short description for the given language.
language_codeStringOptionalA two-letter ISO 639-1 language code. If empty, the short description will be applied to all users for whose language there is no dedicated short description.
+

getMyShortDescription

+

Use this method to get the current bot short description for the given user language. Returns BotShortDescription on success.

+ + + + + + + + + + + + + + + + + +
ParameterTypeRequiredDescription
language_codeStringOptionalA two-letter ISO 639-1 language code or an empty string
+

setMyProfilePhoto

+

Changes the profile photo of the bot. Returns True on success.

+ + + + + + + + + + + + + + + + + +
ParameterTypeRequiredDescription
photoInputProfilePhotoYesThe new profile photo to set
+

removeMyProfilePhoto

+

Removes the profile photo of the bot. Requires no parameters. Returns True on success.

+

setChatMenuButton

+

Use this method to change the bot's menu button in a private chat, or the default menu button. Returns True on success.

+ + + + + + + + + + + + + + + + + + + + + + + +
ParameterTypeRequiredDescription
chat_idIntegerOptionalUnique identifier for the target private chat. If not specified, the bot's default menu button will be changed.
menu_buttonMenuButtonOptionalA JSON-serialized object for the bot's new menu button. Defaults to MenuButtonDefault.
+

getChatMenuButton

+

Use 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.

+ + + + + + + + + + + + + + + + + +
ParameterTypeRequiredDescription
chat_idIntegerOptionalUnique identifier for the target private chat. If not specified, the bot's default menu button will be returned.
+

setMyDefaultAdministratorRights

+

Use 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 before adding the bot. Returns True on success.

+ + + + + + + + + + + + + + + + + + + + + + + +
ParameterTypeRequiredDescription
rightsChatAdministratorRightsOptionalA JSON-serialized object describing new default administrator rights. If not specified, the default administrator rights will be cleared.
for_channelsBooleanOptionalPass True to change the default administrator rights of the bot in channels. Otherwise, the default administrator rights of the bot for groups and supergroups will be changed.
+

getMyDefaultAdministratorRights

+

Use this method to get the current default administrator rights of the bot. Returns ChatAdministratorRights on success.

+ + + + + + + + + + + + + + + + + +
ParameterTypeRequiredDescription
for_channelsBooleanOptionalPass True to get the default administrator rights of the bot in channels. Otherwise, the default administrator rights of the bot for groups and supergroups will be returned.
+

getAvailableGifts

+

Returns the list of gifts that can be sent by the bot to users and channel chats. Requires no parameters. Returns a Gifts object.

+

sendGift

+

Sends 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.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ParameterTypeRequiredDescription
user_idIntegerOptionalRequired if chat_id is not specified. Unique identifier of the target user who will receive the gift.
chat_idInteger or StringOptionalRequired if user_id is not specified. Unique identifier for the chat that will receive the gift or username of the channel in the format @username.
gift_idStringYesIdentifier of the gift; limited gifts can't be sent to channel chats
pay_for_upgradeBooleanOptionalPass True to pay for the gift upgrade from the bot's balance, thereby making the upgrade free for the receiver
textStringOptionalText that will be shown along with the gift; 0-128 characters
text_parse_modeStringOptionalMode for parsing entities in the text. See formatting options for more details. Entities other than “bold”, “italic”, “underline”, “strikethrough”, “spoiler”, “custom_emoji”, and “date_time” are ignored.
text_entitiesArray of MessageEntityOptionalA JSON-serialized list of special entities that appear in the gift text. It can be specified instead of text_parse_mode. Entities other than “bold”, “italic”, “underline”, “strikethrough”, “spoiler”, “custom_emoji”, and “date_time” are ignored.
+

giftPremiumSubscription

+

Gifts a Telegram Premium subscription to the given user. Returns True on success.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ParameterTypeRequiredDescription
user_idIntegerYesUnique identifier of the target user who will receive a Telegram Premium subscription
month_countIntegerYesNumber of months the Telegram Premium subscription will be active for the user; must be one of 3, 6, or 12
star_countIntegerYesNumber of Telegram Stars to pay for the Telegram Premium subscription; must be 1000 for 3 months, 1500 for 6 months, and 2500 for 12 months
textStringOptionalText that will be shown along with the service message about the subscription; 0-128 characters
text_parse_modeStringOptionalMode for parsing entities in the text. See formatting options for more details. Entities other than “bold”, “italic”, “underline”, “strikethrough”, “spoiler”, “custom_emoji”, and “date_time” are ignored.
text_entitiesArray of MessageEntityOptionalA JSON-serialized list of special entities that appear in the gift text. It can be specified instead of text_parse_mode. Entities other than “bold”, “italic”, “underline”, “strikethrough”, “spoiler”, “custom_emoji”, and “date_time” are ignored.
+

verifyUser

+

Verifies a user on behalf of the organization which is represented by the bot. Returns True on success.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ParameterTypeRequiredDescription
user_idIntegerYesUnique identifier of the target user
custom_descriptionStringOptionalCustom description for the verification; 0-70 characters. Must be empty if the organization isn't allowed to provide a custom verification description.
custom_description_parse_modeStringOptionalMode for parsing entities in the custom description. See formatting options for more details. Only “text_link” entities are supported.
custom_description_entitiesArray of MessageEntityOptionalA JSON-serialized list of special entities that appear in the custom description, which can be specified instead of custom_description_parse_mode. Only “text_link” entities are supported.
+

verifyChat

+

Verifies a chat on behalf of the organization which is represented by the bot. Returns True on success.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ParameterTypeRequiredDescription
chat_idInteger or StringYesUnique identifier for the target chat or username of the target bot, supergroup, or channel in the format @username. Channel direct messages chats can't be verified.
custom_descriptionStringOptionalCustom description for the verification; 0-70 characters. Must be empty if the organization isn't allowed to provide a custom verification description.
custom_description_parse_modeStringOptionalMode for parsing entities in the custom description. See formatting options for more details. Only “text_link” entities are supported.
custom_description_entitiesArray of MessageEntityOptionalA JSON-serialized list of special entities that appear in the custom description, which can be specified instead of custom_description_parse_mode. Only “text_link” entities are supported.
+

removeUserVerification

+

Removes verification from a user who is currently verified on behalf of the organization represented by the bot. Returns True on success.

+ + + + + + + + + + + + + + + + + +
ParameterTypeRequiredDescription
user_idIntegerYesUnique identifier of the target user
+

removeChatVerification

+

Removes verification from a chat that is currently verified on behalf of the organization represented by the bot. Returns True on success.

+ + + + + + + + + + + + + + + + + +
ParameterTypeRequiredDescription
chat_idInteger or StringYesUnique identifier for the target chat or username of the target bot, supergroup, or channel in the format @username
+

readBusinessMessage

+

Marks an incoming message as read on behalf of a business account. Requires the can_read_messages business bot right. Returns True on success.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ParameterTypeRequiredDescription
business_connection_idStringYesUnique identifier of the business connection on behalf of which to read the message
chat_idIntegerYesUnique identifier of the chat in which the message was received. The chat must have been active in the last 24 hours.
message_idIntegerYesUnique identifier of the message to mark as read
+

deleteBusinessMessages

+

Deletes 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 message. Returns True on success.

+ + + + + + + + + + + + + + + + + + + + + + + +
ParameterTypeRequiredDescription
business_connection_idStringYesUnique identifier of the business connection on behalf of which to delete the messages
message_idsArray of IntegerYesA JSON-serialized list of 1-100 identifiers of messages to delete. All messages must be from the same chat. See deleteMessage for limitations on which messages can be deleted.
+

setBusinessAccountName

+

Changes the first and last name of a managed business account. Requires the can_edit_name business bot right. Returns True on success.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ParameterTypeRequiredDescription
business_connection_idStringYesUnique identifier of the business connection
first_nameStringYesThe new value of the first name for the business account; 1-64 characters
last_nameStringOptionalThe new value of the last name for the business account; 0-64 characters
+

setBusinessAccountUsername

+

Changes the username of a managed business account. Requires the can_edit_username business bot right. Returns True on success.

+ + + + + + + + + + + + + + + + + + + + + + + +
ParameterTypeRequiredDescription
business_connection_idStringYesUnique identifier of the business connection
usernameStringOptionalThe new value of the username for the business account; 0-32 characters
+

setBusinessAccountBio

+

Changes the bio of a managed business account. Requires the can_edit_bio business bot right. Returns True on success.

+ + + + + + + + + + + + + + + + + + + + + + + +
ParameterTypeRequiredDescription
business_connection_idStringYesUnique identifier of the business connection
bioStringOptionalThe new value of the bio for the business account; 0-140 characters
+

setBusinessAccountProfilePhoto

+

Changes the profile photo of a managed business account. Requires the can_edit_profile_photo business bot right. Returns True on success.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ParameterTypeRequiredDescription
business_connection_idStringYesUnique identifier of the business connection
photoInputProfilePhotoYesThe new profile photo to set
is_publicBooleanOptionalPass True to set the public photo, which will be visible even if the main photo is hidden by the business account's privacy settings. An account can have only one public photo.
+

removeBusinessAccountProfilePhoto

+

Removes the current profile photo of a managed business account. Requires the can_edit_profile_photo business bot right. Returns True on success.

+ + + + + + + + + + + + + + + + + + + + + + + +
ParameterTypeRequiredDescription
business_connection_idStringYesUnique identifier of the business connection
is_publicBooleanOptionalPass True to remove the public photo, which is visible even if the main photo is hidden by the business account's privacy settings. After the main photo is removed, the previous profile photo (if present) becomes the main photo.
+

setBusinessAccountGiftSettings

+

Changes 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.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ParameterTypeRequiredDescription
business_connection_idStringYesUnique identifier of the business connection
show_gift_buttonBooleanYesPass True if a button for sending a gift to the user or by the business account must always be shown in the input field
accepted_gift_typesAcceptedGiftTypesYesTypes of gifts accepted by the business account
+

getBusinessAccountStarBalance

+

Returns 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.

+ + + + + + + + + + + + + + + + + +
ParameterTypeRequiredDescription
business_connection_idStringYesUnique identifier of the business connection
+

transferBusinessAccountStars

+

Transfers Telegram Stars from the business account balance to the bot's balance. Requires the can_transfer_stars business bot right. Returns True on success.

+ + + + + + + + + + + + + + + + + + + + + + + +
ParameterTypeRequiredDescription
business_connection_idStringYesUnique identifier of the business connection
star_countIntegerYesNumber of Telegram Stars to transfer; 1-10000
+

getBusinessAccountGifts

+

Returns the gifts received and owned by a managed business account. Requires the can_view_gifts_and_stars business bot right. Returns OwnedGifts on success.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ParameterTypeRequiredDescription
business_connection_idStringYesUnique identifier of the business connection
exclude_unsavedBooleanOptionalPass True to exclude gifts that aren't saved to the account's profile page
exclude_savedBooleanOptionalPass True to exclude gifts that are saved to the account's profile page
exclude_unlimitedBooleanOptionalPass True to exclude gifts that can be purchased an unlimited number of times
exclude_limited_upgradableBooleanOptionalPass True to exclude gifts that can be purchased a limited number of times and can be upgraded to unique
exclude_limited_non_upgradableBooleanOptionalPass True to exclude gifts that can be purchased a limited number of times and can't be upgraded to unique
exclude_uniqueBooleanOptionalPass True to exclude unique gifts
exclude_from_blockchainBooleanOptionalPass True to exclude gifts that were assigned from the TON blockchain and can't be resold or transferred in Telegram
sort_by_priceBooleanOptionalPass True to sort results by gift price instead of send date. Sorting is applied before pagination.
offsetStringOptionalOffset of the first entry to return as received from the previous request; use an empty string to get the first chunk of results
limitIntegerOptionalThe maximum number of gifts to be returned; 1-100. Defaults to 100.
+

getUserGifts

+

Returns the gifts owned and hosted by a user. Returns OwnedGifts on success.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ParameterTypeRequiredDescription
user_idIntegerYesUnique identifier of the user
exclude_unlimitedBooleanOptionalPass True to exclude gifts that can be purchased an unlimited number of times
exclude_limited_upgradableBooleanOptionalPass True to exclude gifts that can be purchased a limited number of times and can be upgraded to unique
exclude_limited_non_upgradableBooleanOptionalPass True to exclude gifts that can be purchased a limited number of times and can't be upgraded to unique
exclude_from_blockchainBooleanOptionalPass True to exclude gifts that were assigned from the TON blockchain and can't be resold or transferred in Telegram
exclude_uniqueBooleanOptionalPass True to exclude unique gifts
sort_by_priceBooleanOptionalPass True to sort results by gift price instead of send date. Sorting is applied before pagination.
offsetStringOptionalOffset of the first entry to return as received from the previous request; use an empty string to get the first chunk of results
limitIntegerOptionalThe maximum number of gifts to be returned; 1-100. Defaults to 100.
+

getChatGifts

+

Returns the gifts owned by a chat. Returns OwnedGifts on success.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ParameterTypeRequiredDescription
chat_idInteger or StringYesUnique identifier for the target chat or username of the target channel in the format @username
exclude_unsavedBooleanOptionalPass True to exclude gifts that aren't saved to the chat's profile page. Always True, unless the bot has the can_post_messages administrator right in the channel.
exclude_savedBooleanOptionalPass True to exclude gifts that are saved to the chat's profile page. Always False, unless the bot has the can_post_messages administrator right in the channel.
exclude_unlimitedBooleanOptionalPass True to exclude gifts that can be purchased an unlimited number of times
exclude_limited_upgradableBooleanOptionalPass True to exclude gifts that can be purchased a limited number of times and can be upgraded to unique
exclude_limited_non_upgradableBooleanOptionalPass True to exclude gifts that can be purchased a limited number of times and can't be upgraded to unique
exclude_from_blockchainBooleanOptionalPass True to exclude gifts that were assigned from the TON blockchain and can't be resold or transferred in Telegram
exclude_uniqueBooleanOptionalPass True to exclude unique gifts
sort_by_priceBooleanOptionalPass True to sort results by gift price instead of send date. Sorting is applied before pagination.
offsetStringOptionalOffset of the first entry to return as received from the previous request; use an empty string to get the first chunk of results
limitIntegerOptionalThe maximum number of gifts to be returned; 1-100. Defaults to 100.
+

getUniqueGift

+

Use this method to get information about a unique gift by its name. Returns a UniqueGift object on success.

+ + + + + + + + + + + + + + + + + +
ParameterTypeRequiredDescription
nameStringYesUnique name of the gift
+

convertGiftToStars

+

Converts a given regular gift to Telegram Stars. Requires the can_convert_gifts_to_stars business bot right. Returns True on success.

+ + + + + + + + + + + + + + + + + + + + + + + +
ParameterTypeRequiredDescription
business_connection_idStringYesUnique identifier of the business connection
owned_gift_idStringYesUnique identifier of the regular gift that should be converted to Telegram Stars
+

upgradeGift

+

Upgrades 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 success.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ParameterTypeRequiredDescription
business_connection_idStringYesUnique identifier of the business connection
owned_gift_idStringYesUnique identifier of the regular gift that should be upgraded to a unique one
keep_original_detailsBooleanOptionalPass True to keep the original gift text, sender and receiver in the upgraded gift
star_countIntegerOptionalThe amount of Telegram Stars that will be paid for the upgrade from the business account balance. If gift.prepaid_upgrade_star_count > 0, then pass 0; otherwise, the can_transfer_stars business bot right is required and gift.upgrade_star_count must be passed.
+

transferGift

+

Transfers an owned unique gift to another user. Requires the can_transfer_and_upgrade_gifts business bot right. Requires the can_transfer_stars business bot right if the transfer is paid. Returns True on success.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ParameterTypeRequiredDescription
business_connection_idStringYesUnique identifier of the business connection
owned_gift_idStringYesUnique identifier of the unique gift that should be transferred
new_owner_chat_idIntegerYesUnique identifier of the chat which will own the gift. The chat must have been active in the last 24 hours.
star_countIntegerOptionalThe amount of Telegram Stars that will be paid for the transfer from the business account balance. If positive, then the can_transfer_stars business bot right is required.
+

deleteBusinessAccountGift

+

Deletes 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 total_count of the Gift is omitted) and wasn't refunded. Returns True on success.

+ + + + + + + + + + + + + + + + + + + + + + + +
ParameterTypeRequiredDescription
business_connection_idStringYesUnique identifier of the business connection
owned_gift_idStringYesUnique identifier of the regular gift that should be deleted
+

postStory

+

Posts a story on behalf of a managed business account. Requires the can_manage_stories business bot right. Returns Story on success.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ParameterTypeRequiredDescription
business_connection_idStringYesUnique identifier of the business connection
contentInputStoryContentYesContent of the story
active_periodIntegerYesPeriod after which the story is moved to the archive, in seconds; must be one of 6 * 3600, 12 * 3600, 86400, or 2 * 86400
captionStringOptionalCaption of the story, 0-2048 characters after entities parsing
parse_modeStringOptionalMode for parsing entities in the story caption. See formatting options for more details.
caption_entitiesArray of MessageEntityOptionalA JSON-serialized list of special entities that appear in the caption, which can be specified instead of parse_mode
areasArray of StoryAreaOptionalA JSON-serialized list of clickable areas to be shown on the story
post_to_chat_pageBooleanOptionalPass True to keep the story accessible after it expires
protect_contentBooleanOptionalPass True if the content of the story must be protected from forwarding and screenshotting
+

repostStory

+

Reposts 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. Requires the can_manage_stories business bot right for both business accounts. Returns Story on success.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ParameterTypeRequiredDescription
business_connection_idStringYesUnique identifier of the business connection
from_chat_idIntegerYesUnique identifier of the chat which posted the story that should be reposted
from_story_idIntegerYesUnique identifier of the story that should be reposted
active_periodIntegerYesPeriod after which the story is moved to the archive, in seconds; must be one of 6 * 3600, 12 * 3600, 86400, or 2 * 86400
post_to_chat_pageBooleanOptionalPass True to keep the story accessible after it expires
protect_contentBooleanOptionalPass True if the content of the story must be protected from forwarding and screenshotting
+

editStory

+

Edits 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.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ParameterTypeRequiredDescription
business_connection_idStringYesUnique identifier of the business connection
story_idIntegerYesUnique identifier of the story to edit
contentInputStoryContentYesContent of the story
captionStringOptionalCaption of the story, 0-2048 characters after entities parsing
parse_modeStringOptionalMode for parsing entities in the story caption. See formatting options for more details.
caption_entitiesArray of MessageEntityOptionalA JSON-serialized list of special entities that appear in the caption, which can be specified instead of parse_mode
areasArray of StoryAreaOptionalA JSON-serialized list of clickable areas to be shown on the story
+

deleteStory

+

Deletes 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.

+ + + + + + + + + + + + + + + + + + + + + + + +
ParameterTypeRequiredDescription
business_connection_idStringYesUnique identifier of the business connection
story_idIntegerYesUnique identifier of the story to delete
+

answerWebAppQuery

+

Use 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.

+ + + + + + + + + + + + + + + + + + + + + + + +
ParameterTypeRequiredDescription
web_app_query_idStringYesUnique identifier for the query to be answered
resultInlineQueryResultYesA JSON-serialized object describing the message to be sent
+

savePreparedInlineMessage

+

Stores a message that can be sent by a user of a Mini App. Returns a PreparedInlineMessage object.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ParameterTypeRequiredDescription
user_idIntegerYesUnique identifier of the target user that can use the prepared message
resultInlineQueryResultYesA JSON-serialized object describing the message to be sent
allow_user_chatsBooleanOptionalPass True if the message can be sent to private chats with users
allow_bot_chatsBooleanOptionalPass True if the message can be sent to private chats with bots
allow_group_chatsBooleanOptionalPass True if the message can be sent to group and supergroup chats
allow_channel_chatsBooleanOptionalPass True if the message can be sent to channel chats
+

savePreparedKeyboardButton

+

Stores a keyboard button that can be used by a user within a Mini App. Returns a PreparedKeyboardButton object.

+ + + + + + + + + + + + + + + + + + + + + + + +
ParameterTypeRequiredDescription
user_idIntegerYesUnique identifier of the target user that can use the button
buttonKeyboardButtonYesA JSON-serialized object describing the button to be saved. The button must be of the type request_users, request_chat, or request_managed_bot.
+

Inline mode methods

+

Methods and objects used in the inline mode are described in the Inline mode section.

+

Updating messages

+

The 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, but can also help reduce clutter in conversations with regular chat bots.

+

Please note that it is currently only possible to edit messages without reply_markup or with inline keyboards.

+

editMessageText

+

Use 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 sent by the bot and do not contain an inline keyboard can only be edited within 48 hours from the time they were sent.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ParameterTypeRequiredDescription
business_connection_idStringOptionalUnique identifier of the business connection on behalf of which the message to be edited was sent
chat_idInteger or StringOptionalRequired if inline_message_id is not specified. Unique identifier for the target chat or username of the target bot, supergroup, or channel in the format @username.
message_idIntegerOptionalRequired if inline_message_id is not specified. Identifier of the message to edit.
inline_message_idStringOptionalRequired if chat_id and message_id are not specified. Identifier of the inline message.
textStringOptionalNew text of the message, 1-4096 characters after entity parsing; required if rich_message isn't specified
parse_modeStringOptionalMode for parsing entities in the message text. See formatting options for more details.
entitiesArray of MessageEntityOptionalA JSON-serialized list of special entities that appear in message text, which can be specified instead of parse_mode
link_preview_optionsLinkPreviewOptionsOptionalLink preview generation options for the message
rich_messageInputRichMessageOptionalNew rich content of the message; required if text isn't specified. Direct upload of new files and explicit upload of files by a URL aren't supported when an inline message is edited.
reply_markupInlineKeyboardMarkupOptionalA JSON-serialized object for an inline keyboard
+

editMessageCaption

+

Use 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 bot and do not contain an inline keyboard can only be edited within 48 hours from the time they were sent.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ParameterTypeRequiredDescription
business_connection_idStringOptionalUnique identifier of the business connection on behalf of which the message to be edited was sent
chat_idInteger or StringOptionalRequired if inline_message_id is not specified. Unique identifier for the target chat or username of the target bot, supergroup, or channel in the format @username.
message_idIntegerOptionalRequired if inline_message_id is not specified. Identifier of the message to edit.
inline_message_idStringOptionalRequired if chat_id and message_id are not specified. Identifier of the inline message.
captionStringOptionalNew caption of the message, 0-1024 characters after entities parsing
parse_modeStringOptionalMode for parsing entities in the message caption. See formatting options for more details.
caption_entitiesArray of MessageEntityOptionalA JSON-serialized list of special entities that appear in the caption, which can be specified instead of parse_mode
show_caption_above_mediaBooleanOptionalPass True if the caption must be shown above the message media. Supported only for animation, live photo, paid media, photo, video and widget messages.
reply_markupInlineKeyboardMarkupOptionalA JSON-serialized object for an inline keyboard
+

editMessageMedia

+

Use this method to edit animation, audio, document, live photo, photo, or video messages, or to replace a text or a rich message with media. If a message is part of a message album, then it can be edited only to an audio for audio albums, only to a document for document albums and to a photo, a live photo, or a video otherwise. When an inline message is edited, a new file can't be uploaded; use a previously uploaded file via its file_id or specify a URL. 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 bot and do not contain an inline keyboard can only be edited within 48 hours from the time they were sent.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ParameterTypeRequiredDescription
business_connection_idStringOptionalUnique identifier of the business connection on behalf of which the message to be edited was sent
chat_idInteger or StringOptionalRequired if inline_message_id is not specified. Unique identifier for the target chat or username of the target bot, supergroup, or channel in the format @username.
message_idIntegerOptionalRequired if inline_message_id is not specified. Identifier of the message to edit.
inline_message_idStringOptionalRequired if chat_id and message_id are not specified. Identifier of the inline message.
mediaInputMediaYesA JSON-serialized object for the new media content of the message
reply_markupInlineKeyboardMarkupOptionalA JSON-serialized object for a new inline keyboard
+

editMessageLiveLocation

+

Use 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 inline message, the edited Message is returned; otherwise, True is returned.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ParameterTypeRequiredDescription
business_connection_idStringOptionalUnique identifier of the business connection on behalf of which the message to be edited was sent
chat_idInteger or StringOptionalRequired if inline_message_id is not specified. Unique identifier for the target chat or username of the target bot, supergroup, or channel in the format @username.
message_idIntegerOptionalRequired if inline_message_id is not specified. Identifier of the message to edit.
inline_message_idStringOptionalRequired if chat_id and message_id are not specified. Identifier of the inline message.
latitudeFloatYesLatitude of new location
longitudeFloatYesLongitude of new location
live_periodIntegerOptionalNew period in seconds during which the location can be updated, starting from the message send date. If 0x7FFFFFFF is specified, then the location can be updated forever. Otherwise, the new value must not exceed the current live_period by more than a day, and the live location expiration date must remain within the next 90 days. If not specified, then live_period remains unchanged.
horizontal_accuracyFloatOptionalThe radius of uncertainty for the location, measured in meters; 0-1500
headingIntegerOptionalDirection in which the user is moving, in degrees. Must be between 1 and 360 if specified.
proximity_alert_radiusIntegerOptionalThe maximum distance for proximity alerts about approaching another chat member, in meters. Must be between 1 and 100000 if specified.
reply_markupInlineKeyboardMarkupOptionalA JSON-serialized object for a new inline keyboard
+

stopMessageLiveLocation

+

Use 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.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ParameterTypeRequiredDescription
business_connection_idStringOptionalUnique identifier of the business connection on behalf of which the message to be edited was sent
chat_idInteger or StringOptionalRequired if inline_message_id is not specified. Unique identifier for the target chat or username of the target bot, supergroup, or channel in the format @username.
message_idIntegerOptionalRequired if inline_message_id is not specified. Identifier of the message with live location to stop.
inline_message_idStringOptionalRequired if chat_id and message_id are not specified. Identifier of the inline message.
reply_markupInlineKeyboardMarkupOptionalA JSON-serialized object for a new inline keyboard
+

editMessageChecklist

+

Use this method to edit a checklist on behalf of a connected business account. On success, the edited Message is returned.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ParameterTypeRequiredDescription
business_connection_idStringYesUnique identifier of the business connection on behalf of which the message to be edited was sent
chat_idInteger or StringYesUnique identifier for the target chat or username of the target bot in the format @username
message_idIntegerYesUnique identifier for the target message
checklistInputChecklistYesA JSON-serialized object for the new checklist
reply_markupInlineKeyboardMarkupOptionalA JSON-serialized object for the new inline keyboard for the message
+

editMessageWidgetData

+

Use 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.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ParameterTypeRequiredDescription
chat_idInteger or StringOptionalRequired if inline_message_id is not specified. Unique identifier for the target chat or username of the target supergroup in the format @username.
message_idIntegerOptionalRequired if inline_message_id is not specified. Identifier of the message with the widget.
inline_message_idStringOptionalRequired if chat_id and message_id are not specified. Identifier of the inline message.
public_dataStringOptionalNew public data of the widget, 0-1024 bytes; pass an empty string to remove the public data. If omitted, then the public data isn't changed.
chat_dataStringOptionalNew data of the widget, which is specific to the message, 0-1024 bytes; pass an empty string to remove the data. If omitted, then the data isn't changed.
+

editSharedWidgetData

+

Use 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.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ParameterTypeRequiredDescription
widget_idStringYesUnique identifier of the shared widget
public_dataStringYesNew public data of the widget, 0-1024 bytes; pass an empty string to remove the public data
cache_timeIntegerOptionalThe maximum amount of time in seconds that the public data of the widget may be cached client-side; 5-3600. If omitted, then the current value is kept, which is 30 by default.
+

editMessageReplyMarkup

+

Use 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 not sent by the bot and do not contain an inline keyboard can only be edited within 48 hours from the time they were sent.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ParameterTypeRequiredDescription
business_connection_idStringOptionalUnique identifier of the business connection on behalf of which the message to be edited was sent
chat_idInteger or StringOptionalRequired if inline_message_id is not specified. Unique identifier for the target chat or username of the target bot, supergroup, or channel in the format @username.
message_idIntegerOptionalRequired if inline_message_id is not specified. Identifier of the message to edit.
inline_message_idStringOptionalRequired if chat_id and message_id are not specified. Identifier of the inline message.
reply_markupInlineKeyboardMarkupOptionalA JSON-serialized object for an inline keyboard
+

stopPoll

+

Use this method to stop a poll which was sent by the bot. On success, the stopped Poll is returned.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ParameterTypeRequiredDescription
business_connection_idStringOptionalUnique identifier of the business connection on behalf of which the message to be edited was sent
chat_idInteger or StringYesUnique identifier for the target chat or username of the target bot, supergroup, or channel in the format @username
message_idIntegerYesIdentifier of the original message with the poll
reply_markupInlineKeyboardMarkupOptionalA JSON-serialized object for a new message inline keyboard
+

editEphemeralMessageText

+

Use 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.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ParameterTypeRequiredDescription
chat_idInteger or StringYesUnique identifier for the target chat or username of the target supergroup in the format @username
receiver_user_idIntegerYesIdentifier of the user who received the message
ephemeral_message_idIntegerYesIdentifier of the ephemeral message to edit
textStringOptionalNew text of the message, 1-4096 characters after entity parsing; required if rich_message isn't specified
parse_modeStringOptionalMode for parsing entities in the message text. See formatting options for more details.
entitiesArray of MessageEntityOptionalA JSON-serialized list of special entities that appear in message text, which can be specified instead of parse_mode
rich_messageInputRichMessageOptionalNew rich content of the message; required if text isn't specified
link_preview_optionsLinkPreviewOptionsOptionalLink preview generation options for the message
reply_markupInlineKeyboardMarkupOptionalA JSON-serialized object for an inline keyboard
+

editEphemeralMessageMedia

+

Use 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.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ParameterTypeRequiredDescription
chat_idInteger or StringYesUnique identifier for the target chat or username of the target supergroup in the format @username
receiver_user_idIntegerYesIdentifier of the user who received the message
ephemeral_message_idIntegerYesIdentifier of the ephemeral message to edit
mediaInputMediaYesA JSON-serialized object for the new media content of the message
reply_markupInlineKeyboardMarkupOptionalA JSON-serialized object for an inline keyboard
+

editEphemeralMessageCaption

+

Use 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.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ParameterTypeRequiredDescription
chat_idInteger or StringYesUnique identifier for the target chat or username of the target supergroup in the format @username
receiver_user_idIntegerYesIdentifier of the user who received the message
ephemeral_message_idIntegerYesIdentifier of the ephemeral message to edit
captionStringOptionalNew caption of the message, 0-1024 characters after entities parsing
parse_modeStringOptionalMode for parsing entities in the message caption. See formatting options for more details.
caption_entitiesArray of MessageEntityOptionalA JSON-serialized list of special entities that appear in the caption, which can be specified instead of parse_mode
show_caption_above_mediaBooleanOptionalPass True if the caption must be shown above the message media. Supported only for animation, live photo, photo and video messages.
reply_markupInlineKeyboardMarkupOptionalA JSON-serialized object for an inline keyboard
+

editEphemeralMessageReplyMarkup

+

Use 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.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ParameterTypeRequiredDescription
chat_idInteger or StringYesUnique identifier for the target chat or username of the target supergroup in the format @username
receiver_user_idIntegerYesIdentifier of the user who received the message
ephemeral_message_idIntegerYesIdentifier of the ephemeral message to edit
reply_markupInlineKeyboardMarkupOptionalA JSON-serialized object for an inline keyboard
+

approveSuggestedPost

+

Use 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.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ParameterTypeRequiredDescription
chat_idIntegerYesUnique identifier for the target direct messages chat
message_idIntegerYesIdentifier of a suggested post message to approve
send_dateIntegerOptionalPoint in time (Unix timestamp) when the post is expected to be published; omit if the date has already been specified when the suggested post was created. If specified, then the date must not be more than 2678400 seconds (30 days) in the future.
+

declineSuggestedPost

+

Use 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.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ParameterTypeRequiredDescription
chat_idIntegerYesUnique identifier for the target direct messages chat
message_idIntegerYesIdentifier of a suggested post message to decline
commentStringOptionalComment for the creator of the suggested post; 0-128 characters
+

deleteMessage

+

Use this method to delete a message, including service messages, with the following limitations:
- A message can only be deleted if it was sent less than 48 hours ago.
- Service messages about a supergroup, channel, or forum topic creation can't be deleted.
- A dice message in a private chat can only be deleted if it was sent more than 24 hours ago.
- Bots can delete outgoing messages in private chats, groups, and supergroups.
- Bots can delete incoming messages in private chats.
- Bots granted can_post_messages permissions can delete outgoing messages in channels.
- If the bot is an administrator of a group, it can delete any message there.
- If the bot has the can_delete_messages administrator right in a supergroup or a channel, it can delete any message there.
- If the bot has the can_manage_direct_messages administrator right in a channel, it can delete any message in the corresponding direct messages chat.
Returns True on success.

+ + + + + + + + + + + + + + + + + + + + + + + +
ParameterTypeRequiredDescription
chat_idInteger or StringYesUnique identifier for the target chat or username of the target bot, supergroup, or channel in the format @username
message_idIntegerYesIdentifier of the message to delete
+

deleteMessages

+

Use this method to delete multiple messages simultaneously. If some of the specified messages can't be found, they are skipped. Returns True on success.

+ + + + + + + + + + + + + + + + + + + + + + + +
ParameterTypeRequiredDescription
chat_idInteger or StringYesUnique identifier for the target chat or username of the target bot, supergroup, or channel in the format @username
message_idsArray of IntegerYesA JSON-serialized list of 1-100 identifiers of messages to delete. See deleteMessage for limitations on which messages can be deleted.
+

deleteEphemeralMessage

+

Use 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.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ParameterTypeRequiredDescription
chat_idInteger or StringYesUnique identifier for the target chat or username of the target supergroup in the format @username
receiver_user_idIntegerYesIdentifier of the user who received the message
ephemeral_message_idIntegerYesIdentifier of the ephemeral message to delete
+

deleteMessageReaction

+

Use 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.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ParameterTypeRequiredDescription
chat_idInteger or StringYesUnique identifier for the target chat or username of the target supergroup in the format @username
message_idIntegerYesIdentifier of the target message
user_idIntegerOptionalIdentifier of the user whose reaction will be removed, if the reaction was added by a user
actor_chat_idIntegerOptionalIdentifier of the chat whose reaction will be removed, if the reaction was added by a chat
+

deleteAllMessageReactions

+

Use 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.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ParameterTypeRequiredDescription
chat_idInteger or StringYesUnique identifier for the target chat or username of the target supergroup in the format @username
user_idIntegerOptionalIdentifier of the user whose reactions will be removed, if the reactions were added by a user
actor_chat_idIntegerOptionalIdentifier of the chat whose reactions will be removed, if the reactions were added by a chat
+

Stickers

+

The following methods and objects allow your bot to handle stickers and sticker sets.

+

Sticker

+

This object represents a sticker.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
file_idStringIdentifier for this file, which can be used to download or reuse the file
file_unique_idStringUnique identifier for this file, which is supposed to be the same over time and for different bots. Can't be used to download or reuse the file.
typeStringType of the sticker, currently one of “regular”, “mask”, “custom_emoji”. The type of the sticker is independent from its format, which is determined by the fields is_animated and is_video.
widthIntegerSticker width
heightIntegerSticker height
is_animatedBooleanTrue, if the sticker is animated
is_videoBooleanTrue, if the sticker is a video sticker
thumbnailPhotoSizeOptional. Sticker thumbnail in the .WEBP or .JPG format
emojiStringOptional. Emoji associated with the sticker
set_nameStringOptional. Name of the sticker set to which the sticker belongs
premium_animationFileOptional. For premium regular stickers, premium animation for the sticker
mask_positionMaskPositionOptional. For mask stickers, the position where the mask should be placed
custom_emoji_idStringOptional. For custom emoji stickers, unique identifier of the custom emoji
needs_repaintingTrueOptional. True, if the sticker must be repainted to a text color in messages, the color of the Telegram Premium badge in emoji status, white color on chat photos, or another appropriate color in other places
file_sizeIntegerOptional. File size in bytes
+

StickerSet

+

This object represents a sticker set.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
nameStringSticker set name
titleStringSticker set title
sticker_typeStringType of stickers in the set, currently one of “regular”, “mask”, “custom_emoji”
stickersArray of StickerList of all set stickers
thumbnailPhotoSizeOptional. Sticker set thumbnail in the .WEBP, .TGS, or .WEBM format
+

MaskPosition

+

This object describes the position on faces where a mask should be placed by default.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
pointStringThe part of the face relative to which the mask should be placed. One of “forehead”, “eyes”, “mouth”, or “chin”.
x_shiftFloatShift by X-axis measured in widths of the mask scaled to the face size, from left to right. For example, choosing -1.0 will place the mask just to the left of the default mask position.
y_shiftFloatShift by Y-axis measured in heights of the mask scaled to the face size, from top to bottom. For example, 1.0 will place the mask just below the default mask position.
scaleFloatMask scaling coefficient. For example, 2.0 means double size.
+

InputSticker

+

This object describes a sticker to be added to a sticker set.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
stickerStringThe added sticker. Pass a file_id as a String to send a file that already exists on the Telegram servers, pass an HTTP URL as a String for Telegram to get a file from the Internet, or pass “attach://<file_attach_name>” to upload a new file using multipart/form-data under <file_attach_name> name. Animated and video stickers can't be uploaded via HTTP URL. More information on Sending Files »
formatStringFormat of the added sticker, must be one of “static” for a .WEBP or .PNG image, “animated” for a .TGS animation, “video” for a .WEBM video
emoji_listArray of StringList of 1-20 emoji associated with the sticker
mask_positionMaskPositionOptional. Position where the mask should be placed on faces. For “mask” stickers only.
keywordsArray of StringOptional. List of 0-20 search keywords for the sticker with a total length of up to 64 characters. For “regular” and “custom_emoji” stickers only.
+

sendSticker

+

Use this method to send static .WEBP, animated .TGS, or video .WEBM stickers. On success, the sent Message is returned.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ParameterTypeRequiredDescription
business_connection_idStringOptionalUnique identifier of the business connection on behalf of which the message will be sent
chat_idInteger or StringOptionalUnique identifier for the target chat or username of the target bot, supergroup, or channel in the format @username; required unless the message is sent as an ephemeral reply to a callback query
message_thread_idIntegerOptionalUnique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only
direct_messages_topic_idIntegerOptionalIdentifier of the direct messages topic to which the message will be sent; required if the message is sent to a direct messages chat
ephemeral_message_parametersEphemeralMessageParametersOptionalA JSON-serialized object containing the parameters of the ephemeral message to send
stickerInputFile or StringYesSticker to send. Pass a file_id as String to send a file that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get a .WEBP sticker from the Internet, or upload a new .WEBP, .TGS, or .WEBM sticker using multipart/form-data. More information on Sending Files ». Video and animated stickers can't be sent via an HTTP URL.
emojiStringOptionalEmoji associated with the sticker; only for just uploaded stickers
disable_notificationBooleanOptionalSends the message silently. Users will receive a notification with no sound.
protect_contentBooleanOptionalProtects the contents of the sent message from forwarding and saving
allow_paid_broadcastBooleanOptionalPass True to allow up to 1000 messages per second, ignoring broadcasting limits for a fee of 0.1 Telegram Stars per message. The relevant Stars will be withdrawn from the bot's balance.
message_effect_idStringOptionalUnique identifier of the message effect to be added to the message; for private chats only
suggested_post_parametersSuggestedPostParametersOptionalA JSON-serialized object containing the parameters of the suggested post to send; for direct messages chats only. If the message is sent as a reply to another suggested post, then that suggested post is automatically declined.
reply_parametersReplyParametersOptionalDescription of the message to reply to
reply_markupInlineKeyboardMarkup or ReplyKeyboardMarkup or ReplyKeyboardRemove or ForceReplyOptionalAdditional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove a reply keyboard or to force a reply from the user.
+

getStickerSet

+

Use this method to get a sticker set. On success, a StickerSet object is returned.

+ + + + + + + + + + + + + + + + + +
ParameterTypeRequiredDescription
nameStringYesName of the sticker set
+

getCustomEmojiStickers

+

Use this method to get information about custom emoji stickers by their identifiers. Returns an Array of Sticker objects.

+ + + + + + + + + + + + + + + + + +
ParameterTypeRequiredDescription
custom_emoji_idsArray of StringYesA JSON-serialized list of custom emoji identifiers. At most 200 custom emoji identifiers can be specified.
+

uploadStickerFile

+

Use 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.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ParameterTypeRequiredDescription
user_idIntegerYesUser identifier of sticker file owner
stickerInputFileYesA file with the sticker in .WEBP, .PNG, .TGS, or .WEBM format. See https://core.telegram.org/stickers for technical requirements. More information on Sending Files »
sticker_formatStringYesFormat of the sticker, must be one of “static”, “animated”, “video”
+

createNewStickerSet

+

Use 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.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ParameterTypeRequiredDescription
user_idIntegerYesUser identifier of created sticker set owner
nameStringYesShort name of sticker set, to be used in t.me/addstickers/ URLs (e.g., animals). Can contain only English letters, digits and underscores. Must begin with a letter, can't contain consecutive underscores and must end in "_by_<bot_username>". <bot_username> is case insensitive. 1-64 characters.
titleStringYesSticker set title, 1-64 characters
stickersArray of InputStickerYesA JSON-serialized list of 1-50 initial stickers to be added to the sticker set
sticker_typeStringOptionalType of stickers in the set, pass “regular”, “mask”, or “custom_emoji”. By default, a regular sticker set is created.
needs_repaintingBooleanOptionalPass True if stickers in the sticker set must be repainted to the color of text when used in messages, the accent color if used as emoji status, white on chat photos, or another appropriate color based on context; for custom emoji sticker sets only
+

addStickerToSet

+

Use 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.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ParameterTypeRequiredDescription
user_idIntegerYesUser identifier of sticker set owner
nameStringYesSticker set name
stickerInputStickerYesA JSON-serialized object with information about the added sticker. If exactly the same sticker had already been added to the set, then the set isn't changed.
+

setStickerPositionInSet

+

Use this method to move a sticker in a set created by the bot to a specific position. Returns True on success.

+ + + + + + + + + + + + + + + + + + + + + + + +
ParameterTypeRequiredDescription
stickerStringYesFile identifier of the sticker
positionIntegerYesNew sticker position in the set, zero-based
+

deleteStickerFromSet

+

Use this method to delete a sticker from a set created by the bot. Returns True on success.

+ + + + + + + + + + + + + + + + + +
ParameterTypeRequiredDescription
stickerStringYesFile identifier of the sticker
+

replaceStickerInSet

+

Use 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.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ParameterTypeRequiredDescription
user_idIntegerYesUser identifier of the sticker set owner
nameStringYesSticker set name
old_stickerStringYesFile identifier of the replaced sticker
stickerInputStickerYesA JSON-serialized object with information about the added sticker. If exactly the same sticker had already been added to the set, then the set remains unchanged.
+

setStickerEmojiList

+

Use 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.

+ + + + + + + + + + + + + + + + + + + + + + + +
ParameterTypeRequiredDescription
stickerStringYesFile identifier of the sticker
emoji_listArray of StringYesA JSON-serialized list of 1-20 emoji associated with the sticker
+

setStickerKeywords

+

Use 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.

+ + + + + + + + + + + + + + + + + + + + + + + +
ParameterTypeRequiredDescription
stickerStringYesFile identifier of the sticker
keywordsArray of StringOptionalA JSON-serialized list of 0-20 search keywords for the sticker with a total length of up to 64 characters
+

setStickerMaskPosition

+

Use 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.

+ + + + + + + + + + + + + + + + + + + + + + + +
ParameterTypeRequiredDescription
stickerStringYesFile identifier of the sticker
mask_positionMaskPositionOptionalA JSON-serialized object with the position where the mask should be placed on faces. Omit the parameter to remove the mask position.
+

setStickerSetTitle

+

Use this method to set the title of a created sticker set. Returns True on success.

+ + + + + + + + + + + + + + + + + + + + + + + +
ParameterTypeRequiredDescription
nameStringYesSticker set name
titleStringYesSticker set title, 1-64 characters
+

setStickerSetThumbnail

+

Use 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.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ParameterTypeRequiredDescription
nameStringYesSticker set name
user_idIntegerYesUser identifier of the sticker set owner
thumbnailInputFile or StringOptionalA .WEBP or .PNG image with the thumbnail, must be up to 128 kilobytes in size and have a width and height of exactly 100px, or a .TGS animation with a thumbnail up to 32 kilobytes in size (see https://core.telegram.org/stickers#animation-requirements for animated sticker technical requirements), or a .WEBM video with the thumbnail up to 32 kilobytes in size; see https://core.telegram.org/stickers#video-requirements for video sticker technical requirements. Pass a file_id as a String to send a file that already exists on the Telegram servers, pass an HTTP URL as a String for Telegram to get a file from the Internet, or upload a new one using multipart/form-data. More information on Sending Files ». Animated and video sticker set thumbnails can't be uploaded via HTTP URL. If omitted, then the thumbnail is dropped and the first sticker is used as the thumbnail.
formatStringYesFormat of the thumbnail, must be one of “static” for a .WEBP or .PNG image, “animated” for a .TGS animation, or “video” for a .WEBM video
+

setCustomEmojiStickerSetThumbnail

+

Use this method to set the thumbnail of a custom emoji sticker set. Returns True on success.

+ + + + + + + + + + + + + + + + + + + + + + + +
ParameterTypeRequiredDescription
nameStringYesSticker set name
custom_emoji_idStringOptionalCustom emoji identifier of a sticker from the sticker set; pass an empty string to drop the thumbnail and use the first sticker as the thumbnail
+

deleteStickerSet

+

Use this method to delete a sticker set that was created by the bot. Returns True on success.

+ + + + + + + + + + + + + + + + + +
ParameterTypeRequiredDescription
nameStringYesSticker set name
+

Rich messages

+

The following methods and objects allow your bot to handle and send rich messages.

+

Rich Message Formatting Options

+

Rich 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 specify rich message content using Markdown-style or HTML-style formatting, or explicit blocks.

+

Plain URLs, e-mail addresses, username mentions, hashtags, cashtags, bot commands, phone numbers, and bank card numbers are detected automatically. To disable automatic entity detection, pass True in the skip_entity_detection field. Note that Telegram clients will display an alert to the user before opening an inline link ('Open this link?' together with the full URL).

+

When Markdown-style or HTML-style formatting is used, you can use links in the form tg://photo?id=..., tg://video?id=..., tg://document?id=..., and tg://audio?id=... instead of an HTTP URL to reuse previously uploaded files or upload a new file.

+
Rich Message Limits
+

Rich messages are subject to the following limits:

+
    +
  • Up to 32768 UTF-8 characters in the rich message text, including custom emoji alternative text and formula source.
  • +
  • Up to 500 blocks, including nested blocks, list items, ordered list items, table rows, quotation blocks, and details blocks.
  • +
  • Up to 16 levels of nested formatting and blocks.
  • +
  • Up to 50 media attachments in total.
  • +
  • Up to 20 columns in a table.
  • +
+
Rich Markdown style
+

To use this mode, pass rich message content in the markdown field. Use the following syntax in your message:

+
**bold text**
+__bold text__
+*italic text*
+_italic text_
+~~strikethrough text~~
+`inline fixed-width code`
+==marked text==
+||spoiler||
+
+[inline URL](https://t.me/)
+[inline e-mail](mailto:user@example.com)
+[inline phone number](tel:+123456789)
+[inline mention of a user](tg://user?id=123456789)
+![👍](tg://emoji?id=5368324170671202286)
+![22:45 tomorrow](tg://time?unix=1647531900&format=wDT)
+$x^2 + y^2$
+\#hashtag $USD +12345678901, card: 4242 4242 4242 4242, https://t.me t.me a@t.me /command @username
+all the text above was on the same line
+
+# Heading 1
+## Heading 2
+### Heading 3
+#### Heading 4
+##### Heading 5
+###### Heading 6
+
+Paragraph text
+
+```python
+  print('pre-formatted fixed-width code block written in the Python programming language')
+```
+
+---
+
+- unordered list item
+* unordered list item
++ unordered list item
+
+1. ordered list item
+2. ordered list item
+
+- [ ] task list item
+- [x] completed task list item
+
+>Block quotation started
+>
+>Block quotation continued on the next line
+>Block quotation continued on the same line
+>
+>The last line of the block quotation
+
+![](https://telegram.org/example/photo.jpg)
+![](https://telegram.org/example/video.mp4)
+![](https://telegram.org/example/audio.mp3)
+![](https://telegram.org/example/audio.ogg)
+![](https://telegram.org/example/animation.gif)
+![](https://telegram.org/example/document.zip)
+
+![](https://telegram.org/example/photo.jpg "Photo caption")
+![](https://telegram.org/example/video.mp4 "Video caption")
+![](https://telegram.org/example/audio.mp3 "Audio caption")
+![](https://telegram.org/example/audio.ogg "Voice note caption")
+![](https://telegram.org/example/animation.gif "Animation caption")
+![](https://telegram.org/example/document.zip "Document caption")
+
+| Header 1 | Header 2 |
+|:---------|:--------:|
+| left     | center   |
+
+Text with a reference[^id1] and another one[^id2].
+
+[^id1]: Definition of the first footnote.
+[^id2]: Definition of the second footnote.
+
+$$E = mc^2$$
+
+```math
+E = mc^2
+```
+
+## Example Nested Syntax Report for _Q1_
+Intro with <u>underlined text</u>, ==marked text==, and $x^2 + y^2$.
+**Bold _italic <u>underlined italic bold</u> italic_ bold**
+<u>In inline tags, nested **markdown** is parsed</u>
+>Quote with **bold text, ~~strikethrough, and <tg-spoiler>spoiler</tg-spoiler>~~**, plus [a link](https://t.me/).
+
+- List item with `code`, <sup>superscript</sup>, <sub>subscript</sub>, and a footnote[^note]
+- Another item with **bold <tg-spoiler><code>spoiler code</code></tg-spoiler>**
+- Another item with ~~strikethrough and <ins>inserted text</ins>~~
+
+| Metric | Value |
+|:-------|------:|
+| Speed  | **42** <sup>ms</sup> |
+| Status | <tg-spoiler>ready</tg-spoiler> |
+
+[^note]: Footnote with _italic text_ and <u>HTML underline</u>.
+
+---
+
+# Details blocks can contain Markdown content:
+
+<details open><summary>Summary with **bold text**</summary>
+
+### Details heading
+- List item with _italic text_
+- List item with <tg-spoiler>spoiler</tg-spoiler>
+
+</details>
+
+# Collages and slideshows can contain Markdown media blocks:
+
+<tg-collage>
+
+![](https://telegram.org/example/photo.jpg)
+![](https://telegram.org/example/video.mp4)
+
+</tg-collage>
+
+<tg-slideshow>
+
+![](https://telegram.org/example/photo.jpg)
+![](https://telegram.org/example/video.mp4)
+
+</tg-slideshow>
+

For formatting features that don't have Markdown syntax, use HTML tags:

+
<u>underlined text</u>, <ins>underlined text</ins>
+<sub>subscript text</sub>
+<sup>superscript text</sup>
+<a name="chapter-1"></a>
+<aside>Pull quote<cite>The Author</cite></aside>
+<details open><summary>Title</summary>Content</details>
+<tg-map lat="41.9" long="12.5" zoom="14"/>
+<tg-collage><img src="https://telegram.org/example/photo.jpg"/><figcaption>Caption<cite>The Author</cite></figcaption></tg-collage>
+<tg-slideshow><img src="https://telegram.org/example/photo.jpg"/><video src="https://telegram.org/example/video.mp4"/><figcaption>Slideshow caption<cite>The Author</cite></figcaption></tg-slideshow>
+<p>Inline buttons:
+  <tg-button type="url" style="success" url="https://t.me">url</tg-button>
+  <tg-button type="url" url="tg://user?id=777000">user</tg-button>
+  <tg-button type="callback_data" style="link" data="callback">callback with the date <tg-time unix="1647531900" format="wDT">22:45 tomorrow</tg-time> and the custom emoji <tg-emoji emoji-id="5368324170671202286">👍</tg-emoji></tg-button>
+  <tg-button type="web_app" style="danger" url="https://telegram.org">Mini App (private chats only)</tg-button>
+  <tg-button type="login_url" url="https://t.me" forward-text="forward text" request-write-access>login (requires domain set up via @BotFather)</tg-button>
+  <tg-button type="switch_inline_query" style="primary" query="inline">inline</tg-button>
+  <tg-button type="switch_inline_query_current_chat" query="inline 2">inline 2</tg-button>
+  <tg-button type="switch_inline_query_chosen_chat" query="inline 3" allow-user-chats allow-bot-chats allow-group-chats allow-channel-chats>inline 3</tg-button>
+  <tg-button type="copy_text" text="...copy">Copy</tg-button>
+  <tg-button type="disabled">Disabled</tg-button>
+</p>
+<tg-button-row align="left">
+  <tg-button type="url" url="https://t.me">url</tg-button>
+  <tg-button type="url" style="success" url="tg://user?id=777000">user</tg-button>
+  <tg-button type="callback_data" style="link" data="callback">callback</tg-button>
+</tg-button-row>
+<tg-button-row align="center">
+  <tg-button type="web_app" url="https://telegram.org">Mini App (private chats only)</tg-button>
+</tg-button-row>
+<tg-button-row align="center">
+  <tg-button type="login_url" style="danger" url="https://t.me" forward-text="forward text" request-write-access>login (requires domain set up via @BotFather)</tg-button>
+</tg-button-row>
+<tg-button-row align="right">
+  <tg-button type="switch_inline_query" query="inline">inline</tg-button>
+  <tg-button type="switch_inline_query_current_chat" query="inline 2">inline 2</tg-button>
+  <tg-button type="switch_inline_query_chosen_chat" query="inline 3" allow-user-chats allow-group-chats allow-channel-chats>inline 3</tg-button>
+</tg-button-row>
+<tg-button-row>
+  <tg-button type="copy_text" text="...copy">Copy</tg-button>
+  <tg-button type="disabled" style="primary">Disabled</tg-button>
+</tg-button-row>
+

Additionally, you can use the following tag in sendRichMessageDraft:

+
<tg-thinking>Thinking...</tg-thinking>
+

Please note:

+
    +
  • Rich Markdown is compatible with GitHub Flavored Markdown where possible and can contain arbitrary HTML. Supported rich message HTML tags are parsed as described in Rich HTML style.
  • +
  • Media can be specified only as a separate block.
  • +
  • Media blocks support only HTTP and HTTPS URLs.
  • +
  • Media type is determined by the MIME type and the URL of the media.
  • +
  • In media syntax, the optional title after the URL is used as the caption; for example, displays “Photo caption” under the media.
  • +
  • Table cells can contain only inline formatting.
  • +
  • Formula source is treated as raw LaTeX.
  • +
  • Markdown isn't parsed inside block HTML tags other than <details>, <tg-collage> and <tg-slideshow>; therefore, only HTML tags can be used there.
  • +
  • See date-time entity formatting for more details about supported date-time formats.
  • +
+
Rich HTML style
+

To use this mode, pass rich message content in the html field. The following tags are currently supported:

+
<a name="chapter-0"></a>
+<b>bold text</b>, <strong>bold text</strong>
+<i>italic text</i>, <em>italic text</em>
+<u>underlined text</u>, <ins>underlined text</ins>
+<s>strikethrough text</s>, <strike>strikethrough text</strike>, <del>strikethrough text</del>
+<code>inline fixed-width code</code>
+<mark>marked text</mark>
+<sub>subscript text</sub>
+<sup>superscript text</sup>
+<tg-spoiler>spoiler</tg-spoiler>
+
+<a href="#note-1">Reference</a>
+<a href="https://t.me/">inline URL</a>
+<a href="mailto:user@example.com">inline e-mail</a>
+<a href="tel:+123456789">inline phone number</a>
+<a href="tg://user?id=123456789">inline mention of a user</a>
+<a href="#chapter-1">in-document link</a>
+<a name="chapter-1"></a>
+
+<tg-reference name="note-1">Referenced text</tg-reference>
+<tg-emoji emoji-id="5368324170671202286">👍</tg-emoji>
+<img src="tg://emoji?id=5368324170671202286" alt="👍"/>
+<tg-time unix="1647531900" format="wDT">22:45 tomorrow</tg-time>
+<tg-math>x^2 + y^2</tg-math>
+
+#hashtag $USD +12345678901, card: 4242 4242 4242 4242, https://t.me t.me a@t.me /command @username
+
+all the text above was on the same line
+
+<h1>Heading 1</h1>
+<h2>Heading 2</h2>
+<h3>Heading 3</h3>
+<h4>Heading 4</h4>
+<h5>Heading 5</h5>
+<h6>Heading 6</h6>
+
+<a name="chapter-2"></a>
+
+<p>Paragraph text</p>
+<pre>pre-formatted fixed-width code block</pre>
+<pre><code class="language-python">  print('pre-formatted fixed-width code block written in the Python programming language')</code></pre>
+<footer>Footer text</footer>
+<hr/>
+<ul><li>unordered list item</li></ul>
+<ol><li>ordered list item</li></ol>
+<ol start="3" type="a" reversed><li>ordered list item</li></ol>
+<ol><li value="7" type="i">ordered list item with explicit number</li></ol>
+<ul>
+<li><input type="checkbox" checked>Checked checkbox</li>
+<li><input type="checkbox">Unchecked checkbox</li>
+</ul>
+
+<blockquote>Block quotation started<br>Block quotation continued<br>The last line of the block quotation<cite>The Author</cite></blockquote>
+<blockquote expandable>Expandable block quotation started<br>Expandable block quotation continued<br>Expandable block quotation continued<br>Expandable block quotation continued<br>The last line of the expandable block quotation<cite>The Author</cite></blockquote>
+<aside>Pull quote<cite>The Author</cite></aside>
+
+<img src="https://telegram.org/example/photo.jpg"/>
+<video src="https://telegram.org/example/video.mp4"></video>
+<audio src="https://telegram.org/example/audio.mp3"></audio>
+<audio src="https://telegram.org/example/audio.ogg"></audio>
+<video src="https://telegram.org/example/animation.gif"></video>
+<tg-document src="https://telegram.org/example/document.zip"></tg-document>
+
+<figure><img src="https://telegram.org/example/photo.jpg" tg-spoiler/><figcaption>Photo caption<cite>Photo credit</cite></figcaption></figure>
+<figure><video src="https://telegram.org/example/video.mp4" tg-spoiler></video><figcaption>Video caption</figcaption></figure>
+<figure><audio src="https://telegram.org/example/audio.mp3"></audio><figcaption>Audio caption</figcaption></figure>
+<figure><audio src="https://telegram.org/example/audio.ogg"></audio><figcaption>Voice note caption</figcaption></figure>
+<figure><video src="https://telegram.org/example/animation.gif" tg-spoiler></video><figcaption>Animation caption</figcaption></figure>
+<figure><tg-document src="https://telegram.org/example/document.zip"></tg-document><figcaption>Document caption</figcaption></figure>
+
+<tg-map lat="41.9" long="12.5" zoom="14"/>
+<figure><tg-map lat="41.9" long="12.5" zoom="14"/><figcaption>Map caption</figcaption></figure>
+
+<tg-collage><img src="https://telegram.org/example/photo.jpg"/><video src="https://telegram.org/example/video.mp4"/></tg-collage>
+<tg-collage><video src="https://telegram.org/example/video.mp4"/><img src="https://telegram.org/example/photo.jpg"/><figcaption>Collage caption</figcaption></tg-collage>
+<tg-slideshow><img src="https://telegram.org/example/photo.jpg"/><video src="https://telegram.org/example/video.mp4"/></tg-slideshow>
+<tg-slideshow><video src="https://telegram.org/example/video.mp4"/><img src="https://telegram.org/example/photo.jpg"/><figcaption>Slideshow caption</figcaption></tg-slideshow>
+
+<table><tr><th>Header 1</th><th>Header 2</th></tr><tr><td>Value 1</td><td>Value 2</td></tr></table>
+<table bordered striped compact><caption>Table caption</caption>
+<tr><td colspan="2" rowspan="2" align="left">Value</td><td align="center">Value2</td><td align="right">Value3</td></tr>
+<tr><td valign="top">Value4</td><td valign="middle">Value5</td><td valign="bottom">Value6</td></tr>
+<tr><td>Value7</td></tr></table>
+
+<details><summary>Title</summary>Content</details>
+<details open><summary>Title</summary>Content</details>
+<tg-math-block>E = mc^2</tg-math-block>
+<p>Inline buttons:
+  <tg-button type="url" style="success" url="https://t.me">url</tg-button>
+  <tg-button type="url" url="tg://user?id=777000">user</tg-button>
+  <tg-button type="callback_data" style="link" data="callback">callback with the date <tg-time unix="1647531900" format="wDT">22:45 tomorrow</tg-time> and the custom emoji <tg-emoji emoji-id="5368324170671202286">👍</tg-emoji></tg-button>
+  <tg-button type="web_app" style="danger" url="https://telegram.org">Mini App (private chats only)</tg-button>
+  <tg-button type="login_url" url="https://t.me" forward-text="forward text" request-write-access>login (requires domain set up via @BotFather)</tg-button>
+  <tg-button type="switch_inline_query" style="primary" query="inline">inline</tg-button>
+  <tg-button type="switch_inline_query_current_chat" query="inline 2">inline 2</tg-button>
+  <tg-button type="switch_inline_query_chosen_chat" query="inline 3" allow-user-chats allow-bot-chats allow-group-chats allow-channel-chats>inline 3</tg-button>
+  <tg-button type="copy_text" text="...copy">Copy</tg-button>
+  <tg-button type="disabled">Disabled</tg-button>
+</p>
+<tg-button-row align="left">
+  <tg-button type="url" url="https://t.me">url</tg-button>
+  <tg-button type="url" style="success" url="tg://user?id=777000">user</tg-button>
+  <tg-button type="callback_data" style="link" data="callback">callback</tg-button>
+</tg-button-row>
+<tg-button-row align="center">
+  <tg-button type="web_app" url="https://telegram.org">Mini App (private chats only)</tg-button>
+</tg-button-row>
+<tg-button-row align="center">
+  <tg-button type="login_url" style="danger" url="https://t.me" forward-text="forward text" request-write-access>login (requires domain set up via @BotFather)</tg-button>
+</tg-button-row>
+<tg-button-row align="right">
+  <tg-button type="switch_inline_query" query="inline">inline</tg-button>
+  <tg-button type="switch_inline_query_current_chat" query="inline 2">inline 2</tg-button>
+  <tg-button type="switch_inline_query_chosen_chat" query="inline 3" allow-user-chats allow-group-chats allow-channel-chats>inline 3</tg-button>
+</tg-button-row>
+<tg-button-row>
+  <tg-button type="copy_text" text="...copy">Copy</tg-button>
+  <tg-button type="disabled" style="primary">Disabled</tg-button>
+</tg-button-row>
+

Additionally, you can use the following tag in sendRichMessageDraft:

+
<tg-thinking>Thinking...</tg-thinking>
+

Please note:

+
    +
  • Only the tags mentioned above are currently supported.
  • +
  • All numerical HTML entities are supported.
  • +
  • The API currently supports only the following named HTML entities: &lt;, &gt;, &amp;, &quot;, &apos;, &nbsp;, &hellip;, &mdash;, &ndash;, &lsquo;, &rsquo;, &ldquo; and &rdquo;.
  • +
  • Use nested pre and code tags to define the programming language for a pre-formatted block.
  • +
  • Programming language can't be specified for standalone code tags.
  • +
  • Links mailto:..., tel:..., and tg://user?id=... are rendered as e-mail links, phone links, and inline mentions respectively. Other supported links are rendered as regular inline links.
  • +
  • Images, videos, and audio files can be specified only as separate media blocks.
  • +
  • Media blocks support only HTTP and HTTPS URLs.
  • +
  • An empty <a name="..."></a> on its own creates an anchor that can be linked to with <a href="#...">...</a>.
  • +
  • In <figcaption>, you can use <cite> tags to specify caption credit.
  • +
  • Use <tg-reference name="...">...</tg-reference> to define referenced text that can be linked to with <a href="#...">...</a>.
  • +
  • The body of a <details> tag can contain rich message content. If the open attribute is specified, the block is expanded by default.
  • +
  • Formula source is treated as raw LaTeX.
  • +
  • See date-time entity formatting for more details about supported date-time formats.
  • +
+

RichMessage

+

Rich formatted message.

+ + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
blocksArray of RichBlockContent of the message
is_rtlBooleanOptional. True, if the rich message must be shown right-to-left
+

InputRichMessage

+

Describes a rich message to be sent. Exactly one of the fields html, markdown, or blocks must be used.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
blocksArray of InputRichBlockOptional. Content of the rich message to send described as a list of blocks
htmlStringOptional. Content of the rich message to send described using HTML formatting. See rich message formatting options for more details. Use the media field to specify the media used in the message.
markdownStringOptional. Content of the rich message to send described using Markdown formatting. See rich message formatting options for more details. Use the media field to specify the media used in the message.
mediaArray of InputRichMessageMediaOptional. List of media that are specified in the markdown or html fields using tg://photo?id=, tg://video?id=, tg://document?id=, and tg://audio?id= links
is_rtlBooleanOptional. Pass True if the rich message must be shown right-to-left
skip_entity_detectionBooleanOptional. Pass True to skip automatic detection of entities (e.g., URLs, email addresses, username mentions, hashtags, cashtags, bot commands, or phone numbers) in the text
+

InputRichMessageMedia

+

Describes a media element embedded in an outgoing rich message.

+ + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
idStringUnique identifier of the media used in a tg://photo?id=, tg://video?id=, tg://document?id=, or tg://audio?id= link. 1-64 characters, only A-Z, a-z, 0-9, _ and - are allowed.
mediaInputMediaAnimation or InputMediaAudio or InputMediaDocument or InputMediaPhoto or InputMediaVideo or InputMediaVoiceNoteThe media to be sent. Everything except the media itself and its properties is ignored.
+

sendRichMessage

+

Use 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.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ParameterTypeRequiredDescription
business_connection_idStringOptionalUnique identifier of the business connection on behalf of which the message will be sent. The bot can send rich messages on behalf of a business account only if the corresponding user can send rich messages.
chat_idInteger or StringOptionalUnique identifier for the target chat or username of the target bot, supergroup, or channel in the format @username; required unless the message is sent as an ephemeral reply to a callback query
message_thread_idIntegerOptionalUnique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only
direct_messages_topic_idIntegerOptionalIdentifier of the direct messages topic to which the message will be sent; required if the message is sent to a direct messages chat
ephemeral_message_parametersEphemeralMessageParametersOptionalA JSON-serialized object containing the parameters of the ephemeral message to send
rich_messageInputRichMessageYesThe message to be sent
disable_notificationBooleanOptionalSends the message silently. Users will receive a notification with no sound.
protect_contentBooleanOptionalProtects the contents of the sent message from forwarding and saving
allow_paid_broadcastBooleanOptionalPass True to allow up to 1000 messages per second, ignoring broadcasting limits for a fee of 0.1 Telegram Stars per message. The relevant Stars will be withdrawn from the bot's balance.
message_effect_idStringOptionalUnique identifier of the message effect to be added to the message; for private chats only
suggested_post_parametersSuggestedPostParametersOptionalA JSON-serialized object containing the parameters of the suggested post to send; for direct messages chats only. If the message is sent as a reply to another suggested post, then that suggested post is automatically declined.
reply_parametersReplyParametersOptionalDescription of the message to reply to
reply_markupInlineKeyboardMarkup or ReplyKeyboardMarkup or ReplyKeyboardRemove or ForceReplyOptionalAdditional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove a reply keyboard or to force a reply from the user.
+

sendRichMessageDraft

+

Use 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 must call sendRichMessage with the complete message to persist it in the user's chat. Returns True on success.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ParameterTypeRequiredDescription
chat_idIntegerYesUnique identifier for the target private chat
message_thread_idIntegerOptionalUnique identifier for the target message thread
draft_idIntegerYesUnique identifier of the message draft; must be non-zero. Changes to drafts with the same identifier are animated. Otherwise, the draft is replaced without animation.
rich_messageInputRichMessageYesThe partial message to be streamed. Direct upload of new files and explicit upload of files by a URL aren't supported.
can_stopBooleanOptionalPass True to show the user a button to stop further drafts. The bot will receive an Update “stopped_message_generation” if the user presses the button.
keep_on_stopBooleanOptionalPass True to keep the draft in the chat when the button is pressed. The draft will still disappear after a short time or if the bot sends a message. To fully preserve the partial draft, the bot should send it as a new message.
+

RichMessageButton

+

This 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.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
textRichTextText of the button. May contain only plain text, RichTextCustomEmoji and RichTextDateTime entities.
styleStringOptional. Style of the button. Must be one of “danger”, “success”, “primary”, or “link” (the button is shown as a regular link without borders). Apps may use theme-specific colors for the button background and text based on the style. The style “link” is allowed only for callback buttons.
urlStringOptional. HTTP or tg:// URL to be opened when the button is pressed. Links tg://user?id=<user_id> can be used to mention a user by their identifier without using a username, if this is allowed by their privacy settings.
callback_dataStringOptional. Data to be sent in a callback query to the bot when the button is pressed, 1-64 bytes
web_appWebAppInfoOptional. Description of the Web App that will be launched when the user presses the button. The Web App will be able to send an arbitrary message on behalf of the user using the method answerWebAppQuery. Available only in private chats between a user and the bot. Not supported for messages sent on behalf of a business account.
login_urlLoginUrlOptional. An HTTPS URL used to automatically authorize the user. Can be used as a replacement for the Telegram Login Widget. Not supported for ephemeral messages.
switch_inline_queryStringOptional. If set, pressing the button will prompt the user to select one of their chats, open that chat and insert the bot's username and the specified inline query in the input field. May be empty, in which case just the bot's username will be inserted. Not supported for messages sent in channel direct messages chats and on behalf of a business account.
switch_inline_query_current_chatStringOptional. If set, pressing the button will insert the bot's username and the specified inline query in the current chat's input field. May be empty, in which case only the bot's username will be inserted. Not supported in channels and for messages sent in channel direct messages chats and on behalf of a business account.
switch_inline_query_chosen_chatSwitchInlineQueryChosenChatOptional. If set, pressing the button will prompt the user to select one of their chats of the specified type, open that chat and insert the bot's username and the specified inline query in the input field. Not supported for messages sent in channel direct messages chats and on behalf of a business account.
copy_textCopyTextButtonOptional. A button that copies the specified text to the clipboard
disabledDisabledButtonOptional. If set, then the button is disabled and does nothing
+

RichText

+

This 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:

+ +

RichTextBold

+

A bold text.

+ + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
typeStringType of the rich text, always “bold”
textRichTextThe text
+

RichTextItalic

+

An italicized text.

+ + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
typeStringType of the rich text, always “italic”
textRichTextThe text
+

RichTextUnderline

+

An underlined text.

+ + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
typeStringType of the rich text, always “underline”
textRichTextThe text
+

RichTextStrikethrough

+

A strikethrough text.

+ + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
typeStringType of the rich text, always “strikethrough”
textRichTextThe text
+

RichTextSpoiler

+

A text covered by a spoiler.

+ + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
typeStringType of the rich text, always “spoiler”
textRichTextThe text
+

RichTextDateTime

+

Formatted date and time.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
typeStringType of the rich text, always “date_time”
textRichTextThe text
unix_timeIntegerThe Unix time associated with the entity
date_time_formatStringThe string that defines the formatting of the date and time. See date-time entity formatting for more details.
+

RichTextTextMention

+

A mention of a Telegram user by their identifier.

+ + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
typeStringType of the rich text, always “text_mention”
textRichTextThe text
userUserThe mentioned user
+

RichTextSubscript

+

A subscript text.

+ + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
typeStringType of the rich text, always “subscript”
textRichTextThe text
+

RichTextSuperscript

+

A superscript text.

+ + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
typeStringType of the rich text, always “superscript”
textRichTextThe text
+

RichTextMarked

+

A marked text.

+ + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
typeStringType of the rich text, always “marked”
textRichTextThe text
+

RichTextCode

+

A monowidth text.

+ + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
typeStringType of the rich text, always “code”
textRichTextThe text
+

RichTextCustomEmoji

+

A custom emoji.

+ + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
typeStringType of the rich text, always “custom_emoji”
custom_emoji_idStringUnique identifier of the custom emoji. Use getCustomEmojiStickers to get full information about the sticker.
alternative_textStringAlternative emoji for the custom emoji
+

RichTextMathematicalExpression

+

A mathematical expression.

+ + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
typeStringType of the rich text, always “mathematical_expression”
expressionStringThe expression in LaTeX format
+

RichTextUrl

+

A text with a link.

+ + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
typeStringType of the rich text, always “url”
textRichTextThe text
urlStringURL of the link
+

RichTextEmailAddress

+

A text with an email address.

+ + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
typeStringType of the rich text, always “email_address”
textRichTextThe text
email_addressStringThe email address
+

RichTextPhoneNumber

+

A text with a phone number.

+ + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
typeStringType of the rich text, always “phone_number”
textRichTextThe text
phone_numberStringThe phone number
+

RichTextBankCardNumber

+

A text with a bank card number.

+ + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
typeStringType of the rich text, always “bank_card_number”
textRichTextThe text
bank_card_numberStringThe bank card number
+

RichTextTonAddress

+

An address in the TON blockchain.

+ + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
typeStringType of the rich text, always “ton_address”
textRichTextText of the address
addressStringThe address
+

RichTextMention

+

A mention by a username.

+ + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
typeStringType of the rich text, always “mention”
textRichTextThe text
usernameStringThe username
+

RichTextHashtag

+

A hashtag.

+ + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
typeStringType of the rich text, always “hashtag”
textRichTextThe text
hashtagStringThe hashtag
+

RichTextCashtag

+

A cashtag.

+ + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
typeStringType of the rich text, always “cashtag”
textRichTextThe text
cashtagStringThe cashtag
+

RichTextBotCommand

+

A bot command.

+ + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
typeStringType of the rich text, always “bot_command”
textRichTextThe text
bot_commandStringThe bot command
+

RichTextButton

+

A button.

+ + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
typeStringType of the rich text, always “button”
buttonRichMessageButtonThe button
+

RichTextAnchor

+

An anchor.

+ + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
typeStringType of the rich text, always “anchor”
nameStringThe name of the anchor
+

RichTextAnchorLink

+

A link to an anchor.

+ + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
typeStringType of the rich text, always “anchor_link”
textRichTextThe link text
anchor_nameStringThe name of the anchor. If the name is empty, then the link brings the user back to the top of the message.
+

RichTextReference

+

A reference.

+ + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
typeStringType of the rich text, always “reference”
textRichTextText of the reference
nameStringThe name of the reference
+

RichTextReferenceLink

+

A link to a reference.

+ + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
typeStringType of the rich text, always “reference_link”
textRichTextThe link text
reference_nameStringThe name of the reference
+

RichBlockCaption

+

Caption of a rich formatted block.

+ + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
textRichTextBlock caption
creditRichTextOptional. Block credit which corresponds to the HTML tag <cite>
+

RichBlockTableCell

+

Cell in a table.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
textRichTextOptional. Text in the cell. If omitted, then the cell is invisible.
is_headerTrueOptional. True, if the cell is a header cell
colspanIntegerOptional. The number of columns the cell spans if it is bigger than 1
rowspanIntegerOptional. The number of rows the cell spans if it is bigger than 1
alignStringHorizontal cell content alignment. Currently, must be one of “left”, “center”, or “right”.
valignStringVertical cell content alignment. Currently, must be one of “top”, “middle”, or “bottom”.
+

RichBlockListItem

+

An item of a list.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
labelStringLabel of the item
blocksArray of RichBlockThe content of the item
has_checkboxTrueOptional. True, if the item has a checkbox
is_checkedTrueOptional. True, if the item has a checked checkbox
valueIntegerOptional. For ordered lists, the numeric value of the item label
typeStringOptional. For ordered lists, the type of the item label; must be one of “a” for lowercase letters, “A” for uppercase letters, “i” for lowercase Roman numerals, “I” for uppercase Roman numerals, or “1” for decimal numbers
+

RichBlock

+

This object represents a block in a rich formatted message. Currently, it can be any of the following types:

+ +

RichBlockParagraph

+

A text paragraph, corresponding to the HTML tag <p>.

+ + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
typeStringType of the block, always “paragraph”
textRichTextText of the block
+

RichBlockSectionHeading

+

A section heading, corresponding to the HTML tags <h1>, <h2>, <h3>, <h4>, <h5>, or <h6>.

+ + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
typeStringType of the block, always “heading”
textRichTextText of the block
sizeIntegerRelative size of the text font; 1-6, 1 is the largest, 6 is the smallest
+

RichBlockPreformatted

+

A preformatted text block, corresponding to the nested HTML tags <pre> and <code>.

+ + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
typeStringType of the block, always “pre”
textRichTextText of the block
languageStringOptional. The programming language of the text
+

RichBlockFooter

+

A footer, corresponding to the HTML tag <footer>.

+ + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
typeStringType of the block, always “footer”
textRichTextText of the block
+

RichBlockDivider

+

A divider, corresponding to the HTML tag <hr/>.

+ + + + + + + + + + + + + + + +
FieldTypeDescription
typeStringType of the block, always “divider”
+

RichBlockMathematicalExpression

+

A block with a mathematical expression in LaTeX format, corresponding to the custom HTML tag <tg-math-block>.

+ + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
typeStringType of the block, always “mathematical_expression”
expressionStringThe mathematical expression in LaTeX format
+

RichBlockAnchor

+

A block with an anchor, corresponding to the HTML tag <a> with the attribute name.

+ + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
typeStringType of the block, always “anchor”
nameStringThe name of the anchor
+

RichBlockList

+

A list of blocks, corresponding to the HTML tag <ul> or <ol> with multiple nested tags <li>.

+ + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
typeStringType of the block, always “list”
itemsArray of RichBlockListItemItems of the list
+

RichBlockBlockQuotation

+

A block quotation, corresponding to the HTML tag <blockquote>.

+ + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
typeStringType of the block, always “blockquote”
blocksArray of RichBlockContent of the block
creditRichTextOptional. Credit of the block
+

RichBlockExpandableBlockQuotation

+

A block quotation, corresponding to the HTML tag <blockquote> with the custom attribute "expandable".

+ + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
typeStringType of the block, always “expandable_blockquote”
blocksArray of RichBlockContent of the block
creditRichTextOptional. Credit of the block
+

RichBlockPullQuotation

+

A quotation with centered text, loosely corresponding to the HTML tag <aside>.

+ + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
typeStringType of the block, always “pullquote”
textRichTextText of the block
creditRichTextOptional. Credit of the block
+

RichBlockCollage

+

A collage, corresponding to the custom HTML tag <tg-collage>.

+ + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
typeStringType of the block, always “collage”
blocksArray of RichBlockElements of the collage
captionRichBlockCaptionOptional. Caption of the block
+

RichBlockSlideshow

+

A slideshow, corresponding to the custom HTML tag <tg-slideshow>.

+ + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
typeStringType of the block, always “slideshow”
blocksArray of RichBlockElements of the slideshow
captionRichBlockCaptionOptional. Caption of the block
+

RichBlockTable

+

A table, corresponding to the HTML tag <table>.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
typeStringType of the block, always “table”
cellsArray of Array of RichBlockTableCellCells of the table
is_borderedTrueOptional. True, if the table has borders
is_stripedTrueOptional. True, if the table is striped
is_compactTrueOptional. True, if table cells have smaller indents
captionRichTextOptional. Caption of the table
+

RichBlockDetails

+

An expandable block for details disclosure, corresponding to the HTML tag <details>.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
typeStringType of the block, always “details”
summaryRichTextAlways shown summary of the block
blocksArray of RichBlockContent of the block
is_openTrueOptional. True, if the content of the block is visible by default
+

RichBlockMap

+

A block with a map, corresponding to the custom HTML tag <tg-map>.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
typeStringType of the block, always “map”
locationLocationLocation of the center of the map
zoomIntegerMap zoom level
widthIntegerExpected width of the map
heightIntegerExpected height of the map
captionRichBlockCaptionOptional. Caption of the block
+

RichBlockButtons

+

A block containing a list of buttons that are shown in one row, corresponding to the custom HTML tag <tg-button-row>.

+ + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
typeStringType of the block, always “buttons”
buttonsArray of RichMessageButtonThe buttons
alignStringOptional. Horizontal alignment of the buttons. Currently, must be one of “left”, “center”, or “right”.
+

RichBlockAnimation

+

A block with an animation, corresponding to the HTML tag <video>.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
typeStringType of the block, always “animation”
animationAnimationThe animation
has_spoilerTrueOptional. True, if the media preview is covered by a spoiler animation
captionRichBlockCaptionOptional. Caption of the block
+

RichBlockAudio

+

A block with a music file, corresponding to the HTML tag <audio>.

+ + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
typeStringType of the block, always “audio”
audioAudioThe audio
captionRichBlockCaptionOptional. Caption of the block
+

RichBlockDocument

+

A block with a general file, corresponding to the custom HTML tag <tg-document>.

+ + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
typeStringType of the block, always “document”
documentDocumentThe document
captionRichBlockCaptionOptional. Caption of the block
+

RichBlockPhoto

+

A block with a photo, corresponding to the HTML tag <img>.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
typeStringType of the block, always “photo”
photoArray of PhotoSizeAvailable sizes of the photo
has_spoilerTrueOptional. True, if the media preview is covered by a spoiler animation
captionRichBlockCaptionOptional. Caption of the block
+

RichBlockVideo

+

A block with a video, corresponding to the HTML tag <video>.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
typeStringType of the block, always “video”
videoVideoThe video
has_spoilerTrueOptional. True, if the media preview is covered by a spoiler animation
captionRichBlockCaptionOptional. Caption of the block
+

RichBlockVoiceNote

+

A block with a voice note, corresponding to the HTML tag <audio>.

+ + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
typeStringType of the block, always “voice_note”
voice_noteVoiceThe voice note
captionRichBlockCaptionOptional. Caption of the block
+

RichBlockThinking

+

A 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/AIActions for examples of custom emoji that are recommended for usage in the block.

+ + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
typeStringType of the block, always “thinking”
textRichTextText of the block. See https://t.me/addemoji/AIActions for examples of custom emoji that are recommended for usage in the block.
+

InputRichBlockListItem

+

An item of a list to be sent.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
blocksArray of InputRichBlockThe content of the item
has_checkboxTrueOptional. Pass True if the item has a checkbox
is_checkedTrueOptional. Pass True if the item has a checked checkbox
valueIntegerOptional. For ordered lists, the numeric value of the item label
typeStringOptional. For ordered lists, the type of the item label; must be one of “a” for lowercase letters, “A” for uppercase letters, “i” for lowercase Roman numerals, “I” for uppercase Roman numerals, or “1” for decimal numbers
+

InputRichBlock

+

This object represents a block in a rich formatted message to be sent. Currently, it can be any of the following types:

+ +

InputRichBlockParagraph

+

A text paragraph, corresponding to the HTML tag <p>.

+ + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
typeStringType of the block, always “paragraph”
textRichTextText of the block
+

InputRichBlockSectionHeading

+

A section heading, corresponding to the HTML tags <h1>, <h2>, <h3>, <h4>, <h5>, or <h6>.

+ + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
typeStringType of the block, always “heading”
textRichTextText of the block
sizeIntegerRelative size of the text font; 1-6, 1 is the largest, 6 is the smallest
+

InputRichBlockPreformatted

+

A preformatted text block, corresponding to the nested HTML tags <pre> and <code>.

+ + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
typeStringType of the block, always “pre”
textRichTextText of the block
languageStringOptional. The programming language of the text
+

InputRichBlockFooter

+

A footer, corresponding to the HTML tag <footer>.

+ + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
typeStringType of the block, always “footer”
textRichTextText of the block
+

InputRichBlockDivider

+

A divider, corresponding to the HTML tag <hr/>.

+ + + + + + + + + + + + + + + +
FieldTypeDescription
typeStringType of the block, always “divider”
+

InputRichBlockMathematicalExpression

+

A block with a mathematical expression in LaTeX format, corresponding to the custom HTML tag <tg-math-block>.

+ + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
typeStringType of the block, always “mathematical_expression”
expressionStringThe mathematical expression in LaTeX format
+

InputRichBlockAnchor

+

A block with an anchor, corresponding to the HTML tag <a> with the attribute name.

+ + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
typeStringType of the block, always “anchor”
nameStringThe name of the anchor
+

InputRichBlockList

+

A list of blocks, corresponding to the HTML tag <ul> or <ol> with multiple nested tags <li>.

+ + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
typeStringType of the block, always “list”
itemsArray of InputRichBlockListItemItems of the list
+

InputRichBlockBlockQuotation

+

A block quotation, corresponding to the HTML tag <blockquote>.

+ + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
typeStringType of the block, always “blockquote”
blocksArray of InputRichBlockContent of the block
creditRichTextOptional. Credit of the block
+

InputRichBlockExpandableBlockQuotation

+

A block quotation, corresponding to the HTML tag <blockquote> with the custom attribute "expandable".

+ + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
typeStringType of the block, always “expandable_blockquote”
blocksArray of InputRichBlockContent of the block
creditRichTextOptional. Credit of the block
+

InputRichBlockPullQuotation

+

A quotation with centered text, loosely corresponding to the HTML tag <aside>.

+ + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
typeStringType of the block, always “pullquote”
textRichTextText of the block
creditRichTextOptional. Credit of the block
+

InputRichBlockCollage

+

A collage, corresponding to the custom HTML tag <tg-collage>.

+ + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
typeStringType of the block, always “collage”
blocksArray of InputRichBlockElements of the collage
captionRichBlockCaptionOptional. Caption of the block
+

InputRichBlockSlideshow

+

A slideshow, corresponding to the custom HTML tag <tg-slideshow>.

+ + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
typeStringType of the block, always “slideshow”
blocksArray of InputRichBlockElements of the slideshow
captionRichBlockCaptionOptional. Caption of the block
+

InputRichBlockTable

+

A table, corresponding to the HTML tag <table>.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
typeStringType of the block, always “table”
cellsArray of Array of RichBlockTableCellCells of the table
is_borderedTrueOptional. Pass True if the table has borders
is_stripedTrueOptional. Pass True if the table is striped
is_compactTrueOptional. Pass True if table cells must have smaller indents
captionRichTextOptional. Caption of the table
+

InputRichBlockDetails

+

An expandable block for details disclosure, corresponding to the HTML tag <details>.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
typeStringType of the block, always “details”
summaryRichTextAlways shown summary of the block
blocksArray of InputRichBlockContent of the block
is_openTrueOptional. Pass True if the content of the block is visible by default
+

InputRichBlockMap

+

A 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.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
typeStringType of the block, always “map”
locationLocationLocation of the center of the map
zoomIntegerOptional. Map zoom level; 0-24
widthIntegerOptional. Map width; 0-10000
heightIntegerOptional. Map height; 0-10000
captionRichBlockCaptionOptional. Caption of the block
+

InputRichBlockButtons

+

A block containing a list of buttons that are shown in one row, corresponding to the custom HTML tag <tg-button-row>.

+ + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
typeStringType of the block, always “buttons”
buttonsArray of RichMessageButtonList of 1-8 buttons to send
alignStringOptional. Horizontal alignment of the buttons. Currently, must be one of “left”, “center”, or “right”.
+

InputRichBlockAnimation

+

A block with an animation, corresponding to the HTML tag <video>.

+ + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
typeStringType of the block, always “animation”
animationInputMediaAnimationThe animation. Caption is ignored.
captionRichBlockCaptionOptional. Caption of the block
+

InputRichBlockAudio

+

A block with a music file, corresponding to the HTML tag <audio>.

+ + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
typeStringType of the block, always “audio”
audioInputMediaAudioThe audio. Caption is ignored.
captionRichBlockCaptionOptional. Caption of the block
+

InputRichBlockDocument

+

A block with a general file, corresponding to the custom HTML tag <tg-document>.

+ + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
typeStringType of the block, always “document”
documentInputMediaDocumentThe document. Caption is ignored.
captionRichBlockCaptionOptional. Caption of the block
+

InputRichBlockPhoto

+

A block with a photo, corresponding to the HTML tag <img>.

+ + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
typeStringType of the block, always “photo”
photoInputMediaPhotoThe photo. Caption is ignored.
captionRichBlockCaptionOptional. Caption of the block
+

InputRichBlockVideo

+

A block with a video, corresponding to the HTML tag <video>.

+ + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
typeStringType of the block, always “video”
videoInputMediaVideoThe video. Caption is ignored.
captionRichBlockCaptionOptional. Caption of the block
+

InputRichBlockVoiceNote

+

A block with a voice note, corresponding to the HTML tag <audio>.

+ + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
typeStringType of the block, always “voice_note”
voice_noteInputMediaVoiceNoteThe voice note. Caption is ignored.
captionRichBlockCaptionOptional. Caption of the block
+

InputRichBlockThinking

+

A 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/AIActions for examples of custom emoji that are recommended for usage in the block.

+ + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
typeStringType of the block, always “thinking”
textRichTextText of the block. See https://t.me/addemoji/AIActions for examples of custom emoji that are recommended for usage in the block.
+

Inline mode

+

The following methods and objects allow your bot to work in inline mode.
Please see our Introduction to Inline bots for more details.

+

To enable this option, send the /setinline command to @BotFather and provide the placeholder text that the user will see in the input field after typing your bot's name, or use the parameters supports_inline_queries and inline_query_placeholder of the method setMySettings.

+

InlineQuery

+

This object represents an incoming inline query. When the user sends an empty query, your bot could return some default or trending results.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
idStringUnique identifier for this query
fromUserSender
queryStringText of the query (up to 256 characters)
offsetStringOffset of the results to be returned, can be controlled by the bot
chat_typeStringOptional. Type of the chat from which the inline query was sent. Can be either “sender” for a private chat with the inline query sender, “private”, “group”, “supergroup”, or “channel”. The chat type should always be known for requests sent from official clients and most third-party clients, unless the request was sent from a secret chat.
locationLocationOptional. Sender location, only for bots that enabled user location requests via @BotFather or using the parameter needs_inline_query_location of the method setMySettings
+

answerInlineQuery

+

Use this method to send answers to an inline query. On success, True is returned.
No more than 50 results per query are allowed.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ParameterTypeRequiredDescription
inline_query_idStringYesUnique identifier for the answered query
resultsArray of InlineQueryResultYesA JSON-serialized Array of results for the inline query
cache_timeIntegerOptionalThe maximum amount of time in seconds that the result of the inline query may be cached on the server. Defaults to 300.
is_personalBooleanOptionalPass True if results may be cached on the server side only for the user that sent the query. By default, results may be returned to any user who sends the same query.
next_offsetStringOptionalPass the offset that a client should send in the next query with the same text to receive more results. Pass an empty string if there are no more results or if you don't support pagination. Offset length can't exceed 64 bytes.
buttonInlineQueryResultsButtonOptionalA JSON-serialized object describing a button to be shown above inline query results
+

InlineQueryResultsButton

+

This object represents a button to be shown above inline query results. You must use exactly one of the optional fields.

+ + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
textStringLabel text on the button
web_appWebAppInfoOptional. Description of the Web App that will be launched when the user presses the button. The Web App will be able to switch back to the inline mode using the method switchInlineQuery inside the Web App.
start_parameterStringOptional. Deep-linking parameter for the /start message sent to the bot when a user presses the button. 1-64 characters, only A-Z, a-z, 0-9, _ and - are allowed.

Example: An inline bot that sends YouTube videos can ask the user to connect the bot to their YouTube account to adapt search results accordingly. To do this, it displays a 'Connect your YouTube account' button above the results, or even before showing any. The user presses the button, switches to a private chat with the bot and, in doing so, passes a start parameter that instructs the bot to return an OAuth link. Once done, the bot can offer a switch_inline button so that the user can easily return to the chat where they wanted to use the bot's inline capabilities.
+

InlineQueryResult

+

This object represents one result of an inline query. Telegram clients currently support results of the following 20 types:

+ +

Note: All URLs passed in inline query results will be available to end users and therefore must be assumed to be public.

+

InlineQueryResultArticle

+

Represents a link to an article or web page.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
typeStringType of the result, must be article
idStringUnique identifier for this result, 1-64 Bytes
titleStringTitle of the result
input_message_contentInputMessageContentContent of the message to be sent
reply_markupInlineKeyboardMarkupOptional. Inline keyboard attached to the message
urlStringOptional. URL of the result
descriptionStringOptional. Short description of the result
thumbnail_urlStringOptional. Url of the thumbnail for the result
thumbnail_widthIntegerOptional. Thumbnail width
thumbnail_heightIntegerOptional. Thumbnail height
+

InlineQueryResultPhoto

+

Represents a link to a photo. 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 specified content instead of the photo.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
typeStringType of the result, must be photo
idStringUnique identifier for this result, 1-64 bytes
photo_urlStringA valid URL of the photo. Photo must be in JPEG format. Photo size must not exceed 5MB.
thumbnail_urlStringURL of the thumbnail for the photo
photo_widthIntegerOptional. Width of the photo
photo_heightIntegerOptional. Height of the photo
titleStringOptional. Title for the result
descriptionStringOptional. Short description of the result
captionStringOptional. Caption of the photo to be sent, 0-1024 characters after entities parsing
parse_modeStringOptional. Mode for parsing entities in the photo caption. See formatting options for more details.
caption_entitiesArray of MessageEntityOptional. List of special entities that appear in the caption, which can be specified instead of parse_mode
show_caption_above_mediaBooleanOptional. Pass True if the caption must be shown above the message media
reply_markupInlineKeyboardMarkupOptional. Inline keyboard attached to the message
input_message_contentInputMessageContentOptional. Content of the message to be sent instead of the photo
+

InlineQueryResultGif

+

Represents a link to an animated GIF file. 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 message with the specified content instead of the animation.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
typeStringType of the result, must be gif
idStringUnique identifier for this result, 1-64 bytes
gif_urlStringA valid URL for the GIF file
gif_widthIntegerOptional. Width of the GIF
gif_heightIntegerOptional. Height of the GIF
gif_durationIntegerOptional. Duration of the GIF in seconds
thumbnail_urlStringURL of the static (JPEG or GIF) or animated (MPEG4) thumbnail for the result
thumbnail_mime_typeStringOptional. MIME type of the thumbnail, must be one of “image/jpeg”, “image/gif”, or “video/mp4”. Defaults to “image/jpeg”.
titleStringOptional. Title for the result
captionStringOptional. Caption of the GIF file to be sent, 0-1024 characters after entities parsing
parse_modeStringOptional. Mode for parsing entities in the caption. See formatting options for more details.
caption_entitiesArray of MessageEntityOptional. List of special entities that appear in the caption, which can be specified instead of parse_mode
show_caption_above_mediaBooleanOptional. Pass True if the caption must be shown above the message media
reply_markupInlineKeyboardMarkupOptional. Inline keyboard attached to the message
input_message_contentInputMessageContentOptional. Content of the message to be sent instead of the GIF animation
+

InlineQueryResultMpeg4Gif

+

Represents 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 an optional caption. Alternatively, you can use input_message_content to send a message with the specified content instead of the animation.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
typeStringType of the result, must be mpeg4_gif
idStringUnique identifier for this result, 1-64 bytes
mpeg4_urlStringA valid URL for the MPEG4 file
mpeg4_widthIntegerOptional. Video width
mpeg4_heightIntegerOptional. Video height
mpeg4_durationIntegerOptional. Video duration in seconds
thumbnail_urlStringURL of the static (JPEG or GIF) or animated (MPEG4) thumbnail for the result
thumbnail_mime_typeStringOptional. MIME type of the thumbnail, must be one of “image/jpeg”, “image/gif”, or “video/mp4”. Defaults to “image/jpeg”.
titleStringOptional. Title for the result
captionStringOptional. Caption of the MPEG-4 file to be sent, 0-1024 characters after entities parsing
parse_modeStringOptional. Mode for parsing entities in the caption. See formatting options for more details.
caption_entitiesArray of MessageEntityOptional. List of special entities that appear in the caption, which can be specified instead of parse_mode
show_caption_above_mediaBooleanOptional. Pass True if the caption must be shown above the message media
reply_markupInlineKeyboardMarkupOptional. Inline keyboard attached to the message
input_message_contentInputMessageContentOptional. Content of the message to be sent instead of the video animation
+

InlineQueryResultVideo

+

Represents 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 message with the specified content instead of the video.

+
+

If an InlineQueryResultVideo message contains an embedded video (e.g., YouTube), you must replace its content using input_message_content.

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
typeStringType of the result, must be video
idStringUnique identifier for this result, 1-64 bytes
video_urlStringA valid URL for the embedded video player or video file
mime_typeStringMIME type of the content of the video URL, “text/html” or “video/mp4”
thumbnail_urlStringURL of the thumbnail (JPEG only) for the video
titleStringTitle for the result
captionStringOptional. Caption of the video to be sent, 0-1024 characters after entities parsing
parse_modeStringOptional. Mode for parsing entities in the video caption. See formatting options for more details.
caption_entitiesArray of MessageEntityOptional. List of special entities that appear in the caption, which can be specified instead of parse_mode
show_caption_above_mediaBooleanOptional. Pass True if the caption must be shown above the message media
video_widthIntegerOptional. Video width
video_heightIntegerOptional. Video height
video_durationIntegerOptional. Video duration in seconds
descriptionStringOptional. Short description of the result
reply_markupInlineKeyboardMarkupOptional. Inline keyboard attached to the message
input_message_contentInputMessageContentOptional. Content of the message to be sent instead of the video. This field is required if InlineQueryResultVideo is used to send an HTML page as a result (e.g., a YouTube video).
+

InlineQueryResultAudio

+

Represents 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.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
typeStringType of the result, must be audio
idStringUnique identifier for this result, 1-64 bytes
audio_urlStringA valid URL for the audio file
titleStringTitle
captionStringOptional. Caption, 0-1024 characters after entities parsing
parse_modeStringOptional. Mode for parsing entities in the audio caption. See formatting options for more details.
caption_entitiesArray of MessageEntityOptional. List of special entities that appear in the caption, which can be specified instead of parse_mode
performerStringOptional. Performer
audio_durationIntegerOptional. Audio duration in seconds
reply_markupInlineKeyboardMarkupOptional. Inline keyboard attached to the message
input_message_contentInputMessageContentOptional. Content of the message to be sent instead of the audio
+

InlineQueryResultVoice

+

Represents 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 specified content instead of the voice message.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
typeStringType of the result, must be voice
idStringUnique identifier for this result, 1-64 bytes
voice_urlStringA valid URL for the voice recording
titleStringRecording title
captionStringOptional. Caption, 0-1024 characters after entities parsing
parse_modeStringOptional. Mode for parsing entities in the voice message caption. See formatting options for more details.
caption_entitiesArray of MessageEntityOptional. List of special entities that appear in the caption, which can be specified instead of parse_mode
voice_durationIntegerOptional. Recording duration in seconds
reply_markupInlineKeyboardMarkupOptional. Inline keyboard attached to the message
input_message_contentInputMessageContentOptional. Content of the message to be sent instead of the voice recording
+

InlineQueryResultDocument

+

Represents 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. Currently, only .PDF and .ZIP files can be sent using this method.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
typeStringType of the result, must be document
idStringUnique identifier for this result, 1-64 bytes
titleStringTitle for the result
captionStringOptional. Caption of the document to be sent, 0-1024 characters after entities parsing
parse_modeStringOptional. Mode for parsing entities in the document caption. See formatting options for more details.
caption_entitiesArray of MessageEntityOptional. List of special entities that appear in the caption, which can be specified instead of parse_mode
document_urlStringA valid URL for the file
mime_typeStringMIME type of the content of the file, either “application/pdf” or “application/zip”
descriptionStringOptional. Short description of the result
reply_markupInlineKeyboardMarkupOptional. Inline keyboard attached to the message
input_message_contentInputMessageContentOptional. Content of the message to be sent instead of the file
thumbnail_urlStringOptional. URL of the thumbnail (JPEG only) for the file
thumbnail_widthIntegerOptional. Thumbnail width
thumbnail_heightIntegerOptional. Thumbnail height
+

InlineQueryResultLocation

+

Represents 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.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
typeStringType of the result, must be location
idStringUnique identifier for this result, 1-64 Bytes
latitudeFloatLocation latitude in degrees
longitudeFloatLocation longitude in degrees
titleStringLocation title
horizontal_accuracyFloatOptional. The radius of uncertainty for the location, measured in meters; 0-1500
live_periodIntegerOptional. Period in seconds during which the location can be updated, must be between 60 and 86400, or 0x7FFFFFFF for live locations that can be edited indefinitely
headingIntegerOptional. For live locations, a direction in which the user is moving, in degrees. Must be between 1 and 360 if specified.
proximity_alert_radiusIntegerOptional. For live locations, a maximum distance for proximity alerts about approaching another chat member, in meters. Must be between 1 and 100000 if specified.
reply_markupInlineKeyboardMarkupOptional. Inline keyboard attached to the message
input_message_contentInputMessageContentOptional. Content of the message to be sent instead of the location
thumbnail_urlStringOptional. Url of the thumbnail for the result
thumbnail_widthIntegerOptional. Thumbnail width
thumbnail_heightIntegerOptional. Thumbnail height
+

InlineQueryResultVenue

+

Represents 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.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
typeStringType of the result, must be venue
idStringUnique identifier for this result, 1-64 Bytes
latitudeFloatLatitude of the venue location in degrees
longitudeFloatLongitude of the venue location in degrees
titleStringTitle of the venue
addressStringAddress of the venue
foursquare_idStringOptional. Foursquare identifier of the venue if known
foursquare_typeStringOptional. Foursquare type of the venue, if known. (For example, “arts_entertainment/default”, “arts_entertainment/aquarium” or “food/icecream”.)
google_place_idStringOptional. Google Places identifier of the venue
google_place_typeStringOptional. Google Places type of the venue. (See supported types.)
reply_markupInlineKeyboardMarkupOptional. Inline keyboard attached to the message
input_message_contentInputMessageContentOptional. Content of the message to be sent instead of the venue
thumbnail_urlStringOptional. Url of the thumbnail for the result
thumbnail_widthIntegerOptional. Thumbnail width
thumbnail_heightIntegerOptional. Thumbnail height
+

InlineQueryResultContact

+

Represents 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.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
typeStringType of the result, must be contact
idStringUnique identifier for this result, 1-64 Bytes
phone_numberStringContact's phone number
first_nameStringContact's first name
last_nameStringOptional. Contact's last name
vcardStringOptional. Additional data about the contact in the form of a vCard, 0-2048 bytes
reply_markupInlineKeyboardMarkupOptional. Inline keyboard attached to the message
input_message_contentInputMessageContentOptional. Content of the message to be sent instead of the contact
thumbnail_urlStringOptional. Url of the thumbnail for the result
thumbnail_widthIntegerOptional. Thumbnail width
thumbnail_heightIntegerOptional. Thumbnail height
+

InlineQueryResultGame

+

Represents a Game.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
typeStringType of the result, must be game
idStringUnique identifier for this result, 1-64 bytes
game_short_nameStringShort name of the game
reply_markupInlineKeyboardMarkupOptional. Inline keyboard attached to the message
+

InlineQueryResultCachedPhoto

+

Represents 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 specified content instead of the photo.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
typeStringType of the result, must be photo
idStringUnique identifier for this result, 1-64 bytes
photo_file_idStringA valid file identifier of the photo
titleStringOptional. Title for the result
descriptionStringOptional. Short description of the result
captionStringOptional. Caption of the photo to be sent, 0-1024 characters after entities parsing
parse_modeStringOptional. Mode for parsing entities in the photo caption. See formatting options for more details.
caption_entitiesArray of MessageEntityOptional. List of special entities that appear in the caption, which can be specified instead of parse_mode
show_caption_above_mediaBooleanOptional. Pass True if the caption must be shown above the message media
reply_markupInlineKeyboardMarkupOptional. Inline keyboard attached to the message
input_message_contentInputMessageContentOptional. Content of the message to be sent instead of the photo
+

InlineQueryResultCachedGif

+

Represents 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 message with the specified content instead of the animation.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
typeStringType of the result, must be gif
idStringUnique identifier for this result, 1-64 bytes
gif_file_idStringA valid file identifier for the GIF file
titleStringOptional. Title for the result
captionStringOptional. Caption of the GIF file to be sent, 0-1024 characters after entities parsing
parse_modeStringOptional. Mode for parsing entities in the caption. See formatting options for more details.
caption_entitiesArray of MessageEntityOptional. List of special entities that appear in the caption, which can be specified instead of parse_mode
show_caption_above_mediaBooleanOptional. Pass True if the caption must be shown above the message media
reply_markupInlineKeyboardMarkupOptional. Inline keyboard attached to the message
input_message_contentInputMessageContentOptional. Content of the message to be sent instead of the GIF animation
+

InlineQueryResultCachedMpeg4Gif

+

Represents 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 can use input_message_content to send a message with the specified content instead of the animation.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
typeStringType of the result, must be mpeg4_gif
idStringUnique identifier for this result, 1-64 bytes
mpeg4_file_idStringA valid file identifier for the MPEG4 file
titleStringOptional. Title for the result
captionStringOptional. Caption of the MPEG-4 file to be sent, 0-1024 characters after entities parsing
parse_modeStringOptional. Mode for parsing entities in the caption. See formatting options for more details.
caption_entitiesArray of MessageEntityOptional. List of special entities that appear in the caption, which can be specified instead of parse_mode
show_caption_above_mediaBooleanOptional. Pass True if the caption must be shown above the message media
reply_markupInlineKeyboardMarkupOptional. Inline keyboard attached to the message
input_message_contentInputMessageContentOptional. Content of the message to be sent instead of the video animation
+

InlineQueryResultCachedSticker

+

Represents 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 the sticker.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
typeStringType of the result, must be sticker
idStringUnique identifier for this result, 1-64 bytes
sticker_file_idStringA valid file identifier of the sticker
reply_markupInlineKeyboardMarkupOptional. Inline keyboard attached to the message
input_message_contentInputMessageContentOptional. Content of the message to be sent instead of the sticker
+

InlineQueryResultCachedDocument

+

Represents 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 content instead of the file.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
typeStringType of the result, must be document
idStringUnique identifier for this result, 1-64 bytes
titleStringTitle for the result
document_file_idStringA valid file identifier for the file
descriptionStringOptional. Short description of the result
captionStringOptional. Caption of the document to be sent, 0-1024 characters after entities parsing
parse_modeStringOptional. Mode for parsing entities in the document caption. See formatting options for more details.
caption_entitiesArray of MessageEntityOptional. List of special entities that appear in the caption, which can be specified instead of parse_mode
reply_markupInlineKeyboardMarkupOptional. Inline keyboard attached to the message
input_message_contentInputMessageContentOptional. Content of the message to be sent instead of the file
+

InlineQueryResultCachedVideo

+

Represents 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 the specified content instead of the video.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
typeStringType of the result, must be video
idStringUnique identifier for this result, 1-64 bytes
video_file_idStringA valid file identifier for the video file
titleStringTitle for the result
descriptionStringOptional. Short description of the result
captionStringOptional. Caption of the video to be sent, 0-1024 characters after entities parsing
parse_modeStringOptional. Mode for parsing entities in the video caption. See formatting options for more details.
caption_entitiesArray of MessageEntityOptional. List of special entities that appear in the caption, which can be specified instead of parse_mode
show_caption_above_mediaBooleanOptional. Pass True if the caption must be shown above the message media
reply_markupInlineKeyboardMarkupOptional. Inline keyboard attached to the message
input_message_contentInputMessageContentOptional. Content of the message to be sent instead of the video
+

InlineQueryResultCachedVoice

+

Represents 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 instead of the voice message.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
typeStringType of the result, must be voice
idStringUnique identifier for this result, 1-64 bytes
voice_file_idStringA valid file identifier for the voice message
titleStringVoice message title
captionStringOptional. Caption, 0-1024 characters after entities parsing
parse_modeStringOptional. Mode for parsing entities in the voice message caption. See formatting options for more details.
caption_entitiesArray of MessageEntityOptional. List of special entities that appear in the caption, which can be specified instead of parse_mode
reply_markupInlineKeyboardMarkupOptional. Inline keyboard attached to the message
input_message_contentInputMessageContentOptional. Content of the message to be sent instead of the voice message
+

InlineQueryResultCachedAudio

+

Represents 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 instead of the audio.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
typeStringType of the result, must be audio
idStringUnique identifier for this result, 1-64 bytes
audio_file_idStringA valid file identifier for the audio file
captionStringOptional. Caption, 0-1024 characters after entities parsing
parse_modeStringOptional. Mode for parsing entities in the audio caption. See formatting options for more details.
caption_entitiesArray of MessageEntityOptional. List of special entities that appear in the caption, which can be specified instead of parse_mode
reply_markupInlineKeyboardMarkupOptional. Inline keyboard attached to the message
input_message_contentInputMessageContentOptional. Content of the message to be sent instead of the audio
+

InputMessageContent

+

This object represents the content of a message to be sent as a result of an inline query. Telegram clients currently support the following types:

+ +

InputTextMessageContent

+

Represents the content of a text message to be sent as the result of an inline query.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
message_textStringText of the message to be sent, 1-4096 characters
parse_modeStringOptional. Mode for parsing entities in the message text. See formatting options for more details.
entitiesArray of MessageEntityOptional. List of special entities that appear in message text, which can be specified instead of parse_mode
link_preview_optionsLinkPreviewOptionsOptional. Link preview generation options for the message
+

InputRichMessageContent

+

Represents the content of a rich message to be sent as the result of an inline query.

+ + + + + + + + + + + + + + + +
FieldTypeDescription
rich_messageInputRichMessageThe message to be sent. Only previously uploaded files may be used in the message.
+

InputLocationMessageContent

+

Represents the content of a location message to be sent as the result of an inline query.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
latitudeFloatLatitude of the location in degrees
longitudeFloatLongitude of the location in degrees
horizontal_accuracyFloatOptional. The radius of uncertainty for the location, measured in meters; 0-1500
live_periodIntegerOptional. Period in seconds during which the location can be updated, must be between 60 and 86400, or 0x7FFFFFFF for live locations that can be edited indefinitely
headingIntegerOptional. For live locations, a direction in which the user is moving, in degrees. Must be between 1 and 360 if specified.
proximity_alert_radiusIntegerOptional. For live locations, a maximum distance for proximity alerts about approaching another chat member, in meters. Must be between 1 and 100000 if specified.
+

InputVenueMessageContent

+

Represents the content of a venue message to be sent as the result of an inline query.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
latitudeFloatLatitude of the venue in degrees
longitudeFloatLongitude of the venue in degrees
titleStringName of the venue
addressStringAddress of the venue
foursquare_idStringOptional. Foursquare identifier of the venue, if known
foursquare_typeStringOptional. Foursquare type of the venue, if known. (For example, “arts_entertainment/default”, “arts_entertainment/aquarium” or “food/icecream”.)
google_place_idStringOptional. Google Places identifier of the venue
google_place_typeStringOptional. Google Places type of the venue. (See supported types.)
+

InputContactMessageContent

+

Represents the content of a contact message to be sent as the result of an inline query.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
phone_numberStringContact's phone number
first_nameStringContact's first name
last_nameStringOptional. Contact's last name
vcardStringOptional. Additional data about the contact in the form of a vCard, 0-2048 bytes
+

InputInvoiceMessageContent

+

Represents the content of an invoice message to be sent as the result of an inline query.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
titleStringProduct name, 1-32 characters
descriptionStringProduct description, 1-255 characters
payloadStringBot-defined invoice payload, 1-128 bytes. This will not be displayed to the user; use it for your internal processes.
provider_tokenStringOptional. Payment provider token, obtained via @BotFather. Pass an empty string for payments in Telegram Stars.
currencyStringThree-letter ISO 4217 currency code, see more on currencies. Pass “XTR” for payments in Telegram Stars.
pricesArray of LabeledPricePrice breakdown, a JSON-serialized list of components (e.g. product price, tax, discount, delivery cost, delivery tax, bonus, etc.). Must contain exactly one item for payments in Telegram Stars.
max_tip_amountIntegerOptional. The maximum accepted amount for tips in the smallest units of the currency (integer, not float/double). For example, for a maximum tip of US$ 1.45 pass max_tip_amount = 145. See the exp parameter in currencies.json; it shows the number of digits past the decimal point for each currency (2 for the majority of currencies). Defaults to 0. Not supported for payments in Telegram Stars.
suggested_tip_amountsArray of IntegerOptional. A JSON-serialized Array of suggested amounts of tips in the smallest units of the currency (integer, not float/double). At most 4 suggested tip amounts can be specified. The suggested tip amounts must be positive, passed in a strictly increasing order and must not exceed max_tip_amount.
provider_dataStringOptional. A JSON-serialized object for data about the invoice, which will be shared with the payment provider. A detailed description of the required fields should be provided by the payment provider.
photo_urlStringOptional. URL of the product photo for the invoice. Can be a photo of the goods or a marketing image for a service.
photo_sizeIntegerOptional. Photo size in bytes
photo_widthIntegerOptional. Photo width
photo_heightIntegerOptional. Photo height
need_nameBooleanOptional. Pass True if you require the user's full name to complete the order. Ignored for payments in Telegram Stars.
need_phone_numberBooleanOptional. Pass True if you require the user's phone number to complete the order. Ignored for payments in Telegram Stars.
need_emailBooleanOptional. Pass True if you require the user's email address to complete the order. Ignored for payments in Telegram Stars.
need_shipping_addressBooleanOptional. Pass True if you require the user's shipping address to complete the order. Ignored for payments in Telegram Stars.
send_phone_number_to_providerBooleanOptional. Pass True if the user's phone number should be sent to the provider. Ignored for payments in Telegram Stars.
send_email_to_providerBooleanOptional. Pass True if the user's email address should be sent to the provider. Ignored for payments in Telegram Stars.
is_flexibleBooleanOptional. Pass True if the final price depends on the shipping method. Ignored for payments in Telegram Stars.
+

InputWidgetMessageContent

+

Represents 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.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
htmlStringHTML code of the widget, 1-32768 bytes. The code must not exceed 4096 bytes when compressed by zlib with the maximum compression level.
widthIntegerOptional. Width of the widget in logical pixels; omit if the widget must occupy the whole width of the message bubble. The width is clamped by the app to the range from 200 to the maximum width of the message bubble.
heightIntegerOptional. Height of the widget in logical pixels; omit if the height of the widget isn't fixed. The height is clamped by the app to the range 50-600.
public_dataStringOptional. Public data of the widget, 0-1024 bytes, which will be available wherever the widget is shown. If the widget is shared, then all messages with it will have the same public data.
chat_dataStringOptional. Data of the widget, which is specific to the message, 0-1024 bytes
captionStringOptional. Widget caption, 0-1024 characters after entities parsing
parse_modeStringOptional. Mode for parsing entities in the widget caption. See formatting options for more details.
caption_entitiesArray of MessageEntityOptional. List of special entities that appear in the caption, which can be specified instead of parse_mode
show_caption_above_mediaBooleanOptional. Pass True if the caption must be shown above the widget
allow_queriesBooleanOptional. Pass True to allow the widget to send queries to the bot
is_sharedBooleanOptional. Pass True to create a shared widget. Each message sent from the result creates a separate shared widget, whose identifier is received by the bot only in the field widget_id of queries from the widget. To send an existing shared widget in response to an inline query, use InputSharedWidgetMessageContent instead.
+

InputSharedWidgetMessageContent

+

Represents 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.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
widget_idStringUnique identifier of the shared widget created by the bot
chat_dataStringOptional. Data of the widget, which is specific to the message, 0-1024 bytes
captionStringOptional. Widget caption, 0-1024 characters after entities parsing
parse_modeStringOptional. Mode for parsing entities in the widget caption. See formatting options for more details.
caption_entitiesArray of MessageEntityOptional. List of special entities that appear in the caption, which can be specified instead of parse_mode
show_caption_above_mediaBooleanOptional. Pass True if the caption must be shown above the widget
+

ChosenInlineResult

+

Represents a result of an inline query that was chosen by the user and sent to their chat partner.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
result_idStringThe unique identifier for the result that was chosen
fromUserThe user that chose the result
locationLocationOptional. Sender location, only for bots that enabled user location requests via @BotFather or using the parameter needs_inline_query_location of the method setMySettings
inline_message_idStringOptional. Identifier of the sent inline message. Available only if there is an inline keyboard attached to the message. Will also be received in callback queries and can be used to edit the message.
queryStringThe query that was used to obtain the result
+

Note: It is necessary to enable inline feedback via @BotFather or using the parameter inline_feedback_share_denominator of the method setMySettings in order to receive these objects in updates.

+

Payments

+

Your 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.

+

sendInvoice

+

Use this method to send invoices. On success, the sent Message is returned.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ParameterTypeRequiredDescription
chat_idInteger or StringYesUnique identifier for the target chat or username of the target bot, supergroup, or channel in the format @username
message_thread_idIntegerOptionalUnique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only
direct_messages_topic_idIntegerOptionalIdentifier of the direct messages topic to which the message will be sent; required if the message is sent to a direct messages chat
titleStringYesProduct name, 1-32 characters
descriptionStringYesProduct description, 1-255 characters
payloadStringYesBot-defined invoice payload, 1-128 bytes. This will not be displayed to the user; use it for your internal processes.
provider_tokenStringOptionalPayment provider token, obtained via @BotFather. Pass an empty string for payments in Telegram Stars.
currencyStringYesThree-letter ISO 4217 currency code, see more on currencies. Pass “XTR” for payments in Telegram Stars.
pricesArray of LabeledPriceYesPrice breakdown, a JSON-serialized list of components (e.g. product price, tax, discount, delivery cost, delivery tax, bonus, etc.). Must contain exactly one item for payments in Telegram Stars.
max_tip_amountIntegerOptionalThe maximum accepted amount for tips in the smallest units of the currency (integer, not float/double). For example, for a maximum tip of US$ 1.45 pass max_tip_amount = 145. See the exp parameter in currencies.json; it shows the number of digits past the decimal point for each currency (2 for the majority of currencies). Defaults to 0. Not supported for payments in Telegram Stars.
suggested_tip_amountsArray of IntegerOptionalA JSON-serialized Array of suggested amounts of tips in the smallest units of the currency (integer, not float/double). At most 4 suggested tip amounts can be specified. The suggested tip amounts must be positive, passed in a strictly increasing order and must not exceed max_tip_amount.
start_parameterStringOptionalUnique deep-linking parameter. If left empty, forwarded copies of the sent message will have a Pay button, allowing multiple users to pay directly from the forwarded message, using the same invoice. If non-empty, forwarded copies of the sent message will have a URL button with a deep link to the bot (instead of a Pay button), with the value used as the start parameter.
provider_dataStringOptionalJSON-serialized data about the invoice, which will be shared with the payment provider. A detailed description of the required fields should be provided by the payment provider.
photo_urlStringOptionalURL of the product photo for the invoice. Can be a photo of the goods or a marketing image for a service. People like it better when they see what they are paying for.
photo_sizeIntegerOptionalPhoto size in bytes
photo_widthIntegerOptionalPhoto width
photo_heightIntegerOptionalPhoto height
need_nameBooleanOptionalPass True if you require the user's full name to complete the order. Ignored for payments in Telegram Stars.
need_phone_numberBooleanOptionalPass True if you require the user's phone number to complete the order. Ignored for payments in Telegram Stars.
need_emailBooleanOptionalPass True if you require the user's email address to complete the order. Ignored for payments in Telegram Stars.
need_shipping_addressBooleanOptionalPass True if you require the user's shipping address to complete the order. Ignored for payments in Telegram Stars.
send_phone_number_to_providerBooleanOptionalPass True if the user's phone number should be sent to the provider. Ignored for payments in Telegram Stars.
send_email_to_providerBooleanOptionalPass True if the user's email address should be sent to the provider. Ignored for payments in Telegram Stars.
is_flexibleBooleanOptionalPass True if the final price depends on the shipping method. Ignored for payments in Telegram Stars.
disable_notificationBooleanOptionalSends the message silently. Users will receive a notification with no sound.
protect_contentBooleanOptionalProtects the contents of the sent message from forwarding and saving
allow_paid_broadcastBooleanOptionalPass True to allow up to 1000 messages per second, ignoring broadcasting limits for a fee of 0.1 Telegram Stars per message. The relevant Stars will be withdrawn from the bot's balance.
message_effect_idStringOptionalUnique identifier of the message effect to be added to the message; for private chats only
suggested_post_parametersSuggestedPostParametersOptionalA JSON-serialized object containing the parameters of the suggested post to send; for direct messages chats only. If the message is sent as a reply to another suggested post, then that suggested post is automatically declined.
reply_parametersReplyParametersOptionalDescription of the message to reply to
reply_markupInlineKeyboardMarkupOptionalA JSON-serialized object for an inline keyboard. If empty, one 'Pay total price' button will be shown. If not empty, the first button must be a Pay button.
+

createInvoiceLink

+

Use this method to create a link for an invoice. Returns the created invoice link as String on success.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ParameterTypeRequiredDescription
business_connection_idStringOptionalUnique identifier of the business connection on behalf of which the link will be created. For payments in Telegram Stars only.
titleStringYesProduct name, 1-32 characters
descriptionStringYesProduct description, 1-255 characters
payloadStringYesBot-defined invoice payload, 1-128 bytes. This will not be displayed to the user; use it for your internal processes.
provider_tokenStringOptionalPayment provider token, obtained via @BotFather. Pass an empty string for payments in Telegram Stars.
currencyStringYesThree-letter ISO 4217 currency code, see more on currencies. Pass “XTR” for payments in Telegram Stars.
pricesArray of LabeledPriceYesPrice breakdown, a JSON-serialized list of components (e.g. product price, tax, discount, delivery cost, delivery tax, bonus, etc.). Must contain exactly one item for payments in Telegram Stars.
subscription_periodIntegerOptionalThe number of seconds the subscription will be active for before the next payment. The currency must be set to “XTR” (Telegram Stars) if the parameter is used. Currently, it must always be 2592000 (30 days) if specified. Any number of subscriptions can be active for a given bot at the same time, including multiple concurrent subscriptions from the same user. Subscription price must not exceed 10000 Telegram Stars.
max_tip_amountIntegerOptionalThe maximum accepted amount for tips in the smallest units of the currency (integer, not float/double). For example, for a maximum tip of US$ 1.45 pass max_tip_amount = 145. See the exp parameter in currencies.json; it shows the number of digits past the decimal point for each currency (2 for the majority of currencies). Defaults to 0. Not supported for payments in Telegram Stars.
suggested_tip_amountsArray of IntegerOptionalA JSON-serialized Array of suggested amounts of tips in the smallest units of the currency (integer, not float/double). At most 4 suggested tip amounts can be specified. The suggested tip amounts must be positive, passed in a strictly increasing order and must not exceed max_tip_amount.
provider_dataStringOptionalJSON-serialized data about the invoice, which will be shared with the payment provider. A detailed description of the required fields should be provided by the payment provider.
photo_urlStringOptionalURL of the product photo for the invoice. Can be a photo of the goods or a marketing image for a service.
photo_sizeIntegerOptionalPhoto size in bytes
photo_widthIntegerOptionalPhoto width
photo_heightIntegerOptionalPhoto height
need_nameBooleanOptionalPass True if you require the user's full name to complete the order. Ignored for payments in Telegram Stars.
need_phone_numberBooleanOptionalPass True if you require the user's phone number to complete the order. Ignored for payments in Telegram Stars.
need_emailBooleanOptionalPass True if you require the user's email address to complete the order. Ignored for payments in Telegram Stars.
need_shipping_addressBooleanOptionalPass True if you require the user's shipping address to complete the order. Ignored for payments in Telegram Stars.
send_phone_number_to_providerBooleanOptionalPass True if the user's phone number should be sent to the provider. Ignored for payments in Telegram Stars.
send_email_to_providerBooleanOptionalPass True if the user's email address should be sent to the provider. Ignored for payments in Telegram Stars.
is_flexibleBooleanOptionalPass True if the final price depends on the shipping method. Ignored for payments in Telegram Stars.
+

answerShippingQuery

+

If 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 success, True is returned.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ParameterTypeRequiredDescription
shipping_query_idStringYesUnique identifier for the query to be answered
okBooleanYesPass True if delivery to the specified address is possible and False if there are any problems (for example, if delivery to the specified address is not possible)
shipping_optionsArray of ShippingOptionOptionalRequired if ok is True. A JSON-serialized Array of available shipping options.
error_messageStringOptionalRequired if ok is False. Error message in human-readable form that explains why it is impossible to complete the order (e.g. “Sorry, delivery to your desired address is unavailable”). Telegram will display this message to the user.
+

answerPreCheckoutQuery

+

Once 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 queries. On success, True is returned. Note: The Bot API must receive an answer within 10 seconds after the pre-checkout query was sent.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ParameterTypeRequiredDescription
pre_checkout_query_idStringYesUnique identifier for the query to be answered
okBooleanYesSpecify True if everything is alright (goods are available, etc.) and the bot is ready to proceed with the order. Use False if there are any problems.
error_messageStringOptionalRequired if ok is False. Error message in human-readable form that explains the reason for failure to proceed with the checkout (e.g. "Sorry, somebody just bought the last of our amazing black T-shirts while you were busy filling out your payment details. Please choose a different color or garment!"). Telegram will display this message to the user.
+

getMyStarBalance

+

A method to get the current Telegram Stars balance of the bot. Requires no parameters. On success, returns a StarAmount object.

+

getStarTransactions

+

Returns the bot's Telegram Star transactions in chronological order. On success, returns a StarTransactions object.

+ + + + + + + + + + + + + + + + + + + + + + + +
ParameterTypeRequiredDescription
offsetIntegerOptionalNumber of transactions to skip in the response
limitIntegerOptionalThe maximum number of transactions to be retrieved. Values between 1-100 are accepted. Defaults to 100.
+

refundStarPayment

+

Refunds a successful payment in Telegram Stars. Returns True on success.

+ + + + + + + + + + + + + + + + + + + + + + + +
ParameterTypeRequiredDescription
user_idIntegerYesIdentifier of the user whose payment will be refunded
telegram_payment_charge_idStringYesTelegram payment identifier
+

editUserStarSubscription

+

Allows the bot to cancel or re-enable extension of a subscription paid in Telegram Stars. Returns True on success.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ParameterTypeRequiredDescription
user_idIntegerYesIdentifier of the user whose subscription will be edited
telegram_payment_charge_idStringYesTelegram payment identifier for the subscription
is_canceledBooleanYesPass True to cancel extension of the user subscription; the subscription must be active up to the end of the current subscription period. Pass False to allow the user to re-enable a subscription that was previously canceled by the bot.
+

LabeledPrice

+

This object represents a portion of the price for goods or services.

+ + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
labelStringPortion label
amountIntegerPrice of the product in the smallest units of the currency (integer, not float/double). For example, for a price of US$ 1.45 pass amount = 145. See the exp parameter in currencies.json; it shows the number of digits past the decimal point for each currency (2 for the majority of currencies).
+

Invoice

+

This object contains basic information about an invoice.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
titleStringProduct name
descriptionStringProduct description
start_parameterStringUnique bot deep-linking parameter that can be used to generate this invoice
currencyStringThree-letter ISO 4217 currency code, or “XTR” for payments in Telegram Stars
total_amountIntegerTotal price in the smallest units of the currency (integer, not float/double). For example, for a price of US$ 1.45, total_amount = 145. See the exp parameter in currencies.json; it shows the number of digits past the decimal point for each currency (2 for the majority of currencies).
+

ShippingAddress

+

This object represents a shipping address.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
country_codeStringTwo-letter ISO 3166-1 alpha-2 country code
stateStringState, if applicable
cityStringCity
street_line1StringFirst line for the address
street_line2StringSecond line for the address
post_codeStringAddress post code
+

OrderInfo

+

This object represents information about an order.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
nameStringOptional. User name
phone_numberStringOptional. User's phone number
emailStringOptional. User email
shipping_addressShippingAddressOptional. User shipping address
+

ShippingOption

+

This object represents one shipping option.

+ + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
idStringShipping option identifier
titleStringOption title
pricesArray of LabeledPriceList of price portions
+

SuccessfulPayment

+

This 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. This is outside of Telegram's control.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
currencyStringThree-letter ISO 4217 currency code, or “XTR” for payments in Telegram Stars
total_amountIntegerTotal price in the smallest units of the currency (integer, not float/double). For example, for a price of US$ 1.45, total_amount = 145. See the exp parameter in currencies.json; it shows the number of digits past the decimal point for each currency (2 for the majority of currencies).
invoice_payloadStringBot-specified invoice payload
subscription_expiration_dateIntegerOptional. Expiration date of the subscription, in Unix time; for recurring payments only
is_recurringTrueOptional. True, if the payment is a recurring payment for a subscription
is_first_recurringTrueOptional. True, if the payment is the first payment for a subscription
shipping_option_idStringOptional. Identifier of the shipping option chosen by the user
order_infoOrderInfoOptional. Order information provided by the user
telegram_payment_charge_idStringTelegram payment identifier
provider_payment_charge_idStringProvider payment identifier
+

RefundedPayment

+

This object contains basic information about a refunded payment.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
currencyStringThree-letter ISO 4217 currency code, or “XTR” for payments in Telegram Stars. Currently, always “XTR”.
total_amountIntegerTotal refunded price in the smallest units of the currency (integer, not float/double). For example, for a price of US$ 1.45, total_amount = 145. See the exp parameter in currencies.json; it shows the number of digits past the decimal point for each currency (2 for the majority of currencies).
invoice_payloadStringBot-specified invoice payload
telegram_payment_charge_idStringTelegram payment identifier
provider_payment_charge_idStringOptional. Provider payment identifier
+

ShippingQuery

+

This object contains information about an incoming shipping query.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
idStringUnique query identifier
fromUserUser who sent the query
invoice_payloadStringBot-specified invoice payload
shipping_addressShippingAddressUser-specified shipping address
+

PreCheckoutQuery

+

This object contains information about an incoming pre-checkout query.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
idStringUnique query identifier
fromUserUser who sent the query
currencyStringThree-letter ISO 4217 currency code, or “XTR” for payments in Telegram Stars
total_amountIntegerTotal price in the smallest units of the currency (integer, not float/double). For example, for a price of US$ 1.45, total_amount = 145. See the exp parameter in currencies.json; it shows the number of digits past the decimal point for each currency (2 for the majority of currencies).
invoice_payloadStringBot-specified invoice payload
shipping_option_idStringOptional. Identifier of the shipping option chosen by the user
order_infoOrderInfoOptional. Order information provided by the user
+

PaidMediaPurchased

+

This object contains information about a paid media purchase.

+ + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
fromUserUser who purchased the media
paid_media_payloadStringBot-specified paid media payload
+

RevenueWithdrawalState

+

This object describes the state of a revenue withdrawal operation. Currently, it can be one of

+ +

RevenueWithdrawalStatePending

+

The withdrawal is in progress.

+ + + + + + + + + + + + + + + +
FieldTypeDescription
typeStringType of the state, always “pending”
+

RevenueWithdrawalStateSucceeded

+

The withdrawal succeeded.

+ + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
typeStringType of the state, always “succeeded”
dateIntegerDate the withdrawal was completed in Unix time
urlStringAn HTTPS URL that can be used to see transaction details
+

RevenueWithdrawalStateFailed

+

The withdrawal failed and the transaction was refunded.

+ + + + + + + + + + + + + + + +
FieldTypeDescription
typeStringType of the state, always “failed”
+

AffiliateInfo

+

Contains information about the affiliate that received a commission via this transaction.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
affiliate_userUserOptional. The bot or the user that received an affiliate commission if it was received by a bot or a user
affiliate_chatChatOptional. The chat that received an affiliate commission if it was received by a chat
commission_per_milleIntegerThe number of Telegram Stars received by the affiliate for each 1000 Telegram Stars received by the bot from referred users
amountIntegerInteger amount of Telegram Stars received by the affiliate from the transaction, rounded to 0; can be negative for refunds
nanostar_amountIntegerOptional. The number of 1/1000000000 shares of Telegram Stars received by the affiliate; from -999999999 to 999999999; can be negative for refunds
+

TransactionPartner

+

This object describes the source of a transaction, or its recipient for outgoing transactions. Currently, it can be one of

+ +

TransactionPartnerUser

+

Describes a transaction with a user.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
typeStringType of the transaction partner, always “user”
transaction_typeStringType of the transaction, currently one of “invoice_payment” for payments via invoices, “paid_media_payment” for payments for paid media, “gift_purchase” for gifts sent by the bot, “premium_purchase” for Telegram Premium subscriptions gifted by the bot, “business_account_transfer” for direct transfers from managed business accounts
userUserInformation about the user
affiliateAffiliateInfoOptional. Information about the affiliate that received a commission via this transaction. Can be available only for “invoice_payment” and “paid_media_payment” transactions.
invoice_payloadStringOptional. Bot-specified invoice payload. Can be available only for “invoice_payment” transactions.
subscription_periodIntegerOptional. The duration of the paid subscription. Can be available only for “invoice_payment” transactions.
paid_mediaArray of PaidMediaOptional. Information about the paid media bought by the user; for “paid_media_payment” transactions only
paid_media_payloadStringOptional. Bot-specified paid media payload. Can be available only for “paid_media_payment” transactions.
giftGiftOptional. The gift sent to the user by the bot; for “gift_purchase” transactions only
premium_subscription_durationIntegerOptional. Number of months the gifted Telegram Premium subscription will be active for; for “premium_purchase” transactions only
+

TransactionPartnerChat

+

Describes a transaction with a chat.

+ + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
typeStringType of the transaction partner, always “chat”
chatChatInformation about the chat
giftGiftOptional. The gift sent to the chat by the bot
+

TransactionPartnerAffiliateProgram

+

Describes the affiliate program that issued the affiliate commission received via this transaction.

+ + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
typeStringType of the transaction partner, always “affiliate_program”
sponsor_userUserOptional. Information about the bot that sponsored the affiliate program
commission_per_milleIntegerThe number of Telegram Stars received by the bot for each 1000 Telegram Stars received by the affiliate program sponsor from referred users
+

TransactionPartnerFragment

+

Describes a withdrawal transaction with Fragment.

+ + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
typeStringType of the transaction partner, always “fragment”
withdrawal_stateRevenueWithdrawalStateOptional. State of the transaction if the transaction is outgoing
+

TransactionPartnerTelegramAds

+

Describes a withdrawal transaction to the Telegram Ads platform.

+ + + + + + + + + + + + + + + +
FieldTypeDescription
typeStringType of the transaction partner, always “telegram_ads”
+

TransactionPartnerTelegramApi

+

Describes a transaction with payment for paid broadcasting.

+ + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
typeStringType of the transaction partner, always “telegram_api”
request_countIntegerThe number of successful requests that exceeded regular limits and were therefore billed
+

TransactionPartnerOther

+

Describes a transaction with an unknown source or recipient.

+ + + + + + + + + + + + + + + +
FieldTypeDescription
typeStringType of the transaction partner, always “other”
+

StarTransaction

+

Describes 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 deducted from the bot's balance. This is outside of Telegram's control.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
idStringUnique identifier of the transaction. Coincides with the identifier of the original transaction for refund transactions. Coincides with SuccessfulPayment.telegram_payment_charge_id for successful incoming payments from users.
amountIntegerInteger amount of Telegram Stars transferred by the transaction
nanostar_amountIntegerOptional. The number of 1/1000000000 shares of Telegram Stars transferred by the transaction; from 0 to 999999999
dateIntegerDate the transaction was created in Unix time
sourceTransactionPartnerOptional. Source of an incoming transaction (e.g., a user purchasing goods or services, Fragment refunding a failed withdrawal). Only for incoming transactions.
receiverTransactionPartnerOptional. Receiver of an outgoing transaction (e.g., a user for a purchase refund, Fragment for a withdrawal). Only for outgoing transactions.
+

StarTransactions

+

Contains a list of Telegram Star transactions.

+ + + + + + + + + + + + + + + +
FieldTypeDescription
transactionsArray of StarTransactionThe list of transactions
+

Telegram Passport

+

Telegram 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 (finance, ICOs, etc.). Please see the manual for details.

+

PassportData

+

Describes Telegram Passport data shared with the bot by the user.

+ + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
dataArray of EncryptedPassportElementArray with information shared with the bot about documents and other Telegram Passport elements
credentialsEncryptedCredentialsEncrypted credentials required to decrypt the data
+

PassportFile

+

This object represents a file uploaded to Telegram Passport. Currently all Telegram Passport files are in JPEG format when decrypted and don't exceed 10MB.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
file_idStringIdentifier for this file, which can be used to download or reuse the file
file_unique_idStringUnique identifier for this file, which is supposed to be the same over time and for different bots. Can't be used to download or reuse the file.
file_sizeIntegerFile size in bytes
file_dateIntegerUnix time when the file was uploaded
+

EncryptedPassportElement

+

Describes documents or other Telegram Passport elements shared with the bot by the user.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
typeStringElement type. One of “personal_details”, “passport”, “driver_license”, “identity_card”, “internal_passport”, “address”, “utility_bill”, “bank_statement”, “rental_agreement”, “passport_registration”, “temporary_registration”, “phone_number”, “email”.
dataStringOptional. Base64-encoded encrypted Telegram Passport element data provided by the user; available only for “personal_details”, “passport”, “driver_license”, “identity_card”, “internal_passport” and “address” types. Can be decrypted and verified using the accompanying EncryptedCredentials.
phone_numberStringOptional. User's verified phone number; available only for “phone_number” type
emailStringOptional. User's verified email address; available only for “email” type
filesArray of PassportFileOptional. Array of encrypted files with documents provided by the user; available only for “utility_bill”, “bank_statement”, “rental_agreement”, “passport_registration” and “temporary_registration” types. Files can be decrypted and verified using the accompanying EncryptedCredentials.
front_sidePassportFileOptional. Encrypted file with the front side of the document, provided by the user; available only for “passport”, “driver_license”, “identity_card” and “internal_passport”. The file can be decrypted and verified using the accompanying EncryptedCredentials.
reverse_sidePassportFileOptional. Encrypted file with the reverse side of the document, provided by the user; available only for “driver_license” and “identity_card”. The file can be decrypted and verified using the accompanying EncryptedCredentials.
selfiePassportFileOptional. Encrypted file with the selfie of the user holding a document, provided by the user; available if requested for “passport”, “driver_license”, “identity_card” and “internal_passport”. The file can be decrypted and verified using the accompanying EncryptedCredentials.
translationArray of PassportFileOptional. Array of encrypted files with translated versions of documents provided by the user; available if requested for “passport”, “driver_license”, “identity_card”, “internal_passport”, “utility_bill”, “bank_statement”, “rental_agreement”, “passport_registration” and “temporary_registration” types. Files can be decrypted and verified using the accompanying EncryptedCredentials.
hashStringBase64-encoded element hash for using in PassportElementErrorUnspecified
+

EncryptedCredentials

+

Describes data required for decrypting and authenticating EncryptedPassportElement. See the Telegram Passport Documentation for a complete description of the data decryption and authentication processes.

+ + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
dataStringBase64-encoded encrypted JSON-serialized data with unique user's payload, data hashes and secrets required for EncryptedPassportElement decryption and authentication
hashStringBase64-encoded data hash for data authentication
secretStringBase64-encoded secret, encrypted with the bot's public RSA key, required for data decryption
+

setPassportDataErrors

+

Informs a user that some of the Telegram Passport elements they provided contain 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 returned the error must change). Returns True on success.

+

Use this if the data submitted by the user doesn't satisfy the standards your service requires for any reason. For example, if a birthday date seems invalid, a submitted document is blurry, a scan shows evidence of tampering, etc. Supply some details in the error message to make sure the user knows how to correct the issues.

+ + + + + + + + + + + + + + + + + + + + + + + +
ParameterTypeRequiredDescription
user_idIntegerYesUser identifier
errorsArray of PassportElementErrorYesA JSON-serialized Array describing the errors
+

PassportElementError

+

This object represents an error in the Telegram Passport element which was submitted that should be resolved by the user. It should be one of:

+ +

PassportElementErrorDataField

+

Represents 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.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
sourceStringError source, must be data
typeStringThe section of the user's Telegram Passport which has the error, one of “personal_details”, “passport”, “driver_license”, “identity_card”, “internal_passport”, “address”
field_nameStringName of the data field which has the error
data_hashStringBase64-encoded data hash
messageStringError message
+

PassportElementErrorFrontSide

+

Represents 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.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
sourceStringError source, must be front_side
typeStringThe section of the user's Telegram Passport which has the issue, one of “passport”, “driver_license”, “identity_card”, “internal_passport”
file_hashStringBase64-encoded hash of the file with the front side of the document
messageStringError message
+

PassportElementErrorReverseSide

+

Represents an issue with the reverse side of a document. The error is considered resolved when the file with the reverse side of the document changes.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
sourceStringError source, must be reverse_side
typeStringThe section of the user's Telegram Passport which has the issue, one of “driver_license”, “identity_card”
file_hashStringBase64-encoded hash of the file with the reverse side of the document
messageStringError message
+

PassportElementErrorSelfie

+

Represents an issue with the selfie with a document. The error is considered resolved when the file with the selfie changes.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
sourceStringError source, must be selfie
typeStringThe section of the user's Telegram Passport which has the issue, one of “passport”, “driver_license”, “identity_card”, “internal_passport”
file_hashStringBase64-encoded hash of the file with the selfie
messageStringError message
+

PassportElementErrorFile

+

Represents an issue with a document scan. The error is considered resolved when the file with the document scan changes.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
sourceStringError source, must be file
typeStringThe section of the user's Telegram Passport which has the issue, one of “utility_bill”, “bank_statement”, “rental_agreement”, “passport_registration”, “temporary_registration”
file_hashStringBase64-encoded file hash
messageStringError message
+

PassportElementErrorFiles

+

Represents an issue with a list of scans. The error is considered resolved when the list of files containing the scans changes.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
sourceStringError source, must be files
typeStringThe section of the user's Telegram Passport which has the issue, one of “utility_bill”, “bank_statement”, “rental_agreement”, “passport_registration”, “temporary_registration”
file_hashesArray of StringList of base64-encoded file hashes
messageStringError message
+

PassportElementErrorTranslationFile

+

Represents an issue with one of the files that constitute the translation of a document. The error is considered resolved when the file changes.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
sourceStringError source, must be translation_file
typeStringType of element of the user's Telegram Passport which has the issue, one of “passport”, “driver_license”, “identity_card”, “internal_passport”, “utility_bill”, “bank_statement”, “rental_agreement”, “passport_registration”, “temporary_registration”
file_hashStringBase64-encoded file hash
messageStringError message
+

PassportElementErrorTranslationFiles

+

Represents an issue with the translated version of a document. The error is considered resolved when a file with the document translation changes.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
sourceStringError source, must be translation_files
typeStringType of element of the user's Telegram Passport which has the issue, one of “passport”, “driver_license”, “identity_card”, “internal_passport”, “utility_bill”, “bank_statement”, “rental_agreement”, “passport_registration”, “temporary_registration”
file_hashesArray of StringList of base64-encoded file hashes
messageStringError message
+

PassportElementErrorUnspecified

+

Represents an issue in an unspecified place. The error is considered resolved when new data is added.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
sourceStringError source, must be unspecified
typeStringType of element of the user's Telegram Passport which has the issue
element_hashStringBase64-encoded element hash
messageStringError message
+

Games

+

Your 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 responsibility: you will need to accept the terms for each game that your bots will be offering.

+
    +
  • Games are a new type of content on Telegram, represented by the Game and InlineQueryResultGame objects.
  • +
  • Once you've created a game via BotFather, you can send games to chats as regular messages using the sendGame method, or use inline mode with InlineQueryResultGame.
  • +
  • If you send the game message without any buttons, it will automatically have a 'Play GameName' button. When this button is pressed, your bot gets a CallbackQuery with the game_short_name of the requested game. You provide the correct URL for this particular user and the app opens the game in the in-app browser.
  • +
  • You can manually add multiple buttons to your game message. Please note that the first button in the first row must always launch the game, using the field callback_game in InlineKeyboardButton. You can add extra buttons according to taste: e.g., for a description of the rules, or to open the game's official community.
  • +
  • To make your game more attractive, you can upload a GIF animation that demonstrates the game to the users via BotFather (see Lumberjack for example).
  • +
  • A game message will also display high scores for the current chat. Use setGameScore to post high scores to the chat with the game; add the disable_edit_message parameter to disable automatic update of the message with the current scoreboard.
  • +
  • Use getGameHighScores to get data for in-game high score tables.
  • +
  • You can also add an extra sharing button for users to share their best score to different chats.
  • +
  • For examples of what can be done using this new stuff, check the @gamebot and @gamee bots.
  • +
+

sendGame

+

Use this method to send a game. On success, the sent Message is returned.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ParameterTypeRequiredDescription
business_connection_idStringOptionalUnique identifier of the business connection on behalf of which the message will be sent
chat_idInteger or StringYesUnique identifier for the target chat or username of the target bot in the format @username. Games can't be sent to channel direct messages chats and channel chats.
message_thread_idIntegerOptionalUnique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only
game_short_nameStringYesShort name of the game, serves as the unique identifier for the game. Set up your games via @BotFather.
disable_notificationBooleanOptionalSends the message silently. Users will receive a notification with no sound.
protect_contentBooleanOptionalProtects the contents of the sent message from forwarding and saving
allow_paid_broadcastBooleanOptionalPass True to allow up to 1000 messages per second, ignoring broadcasting limits for a fee of 0.1 Telegram Stars per message. The relevant Stars will be withdrawn from the bot's balance.
message_effect_idStringOptionalUnique identifier of the message effect to be added to the message; for private chats only
reply_parametersReplyParametersOptionalDescription of the message to reply to
reply_markupInlineKeyboardMarkupOptionalA JSON-serialized object for an inline keyboard. If empty, one 'Play game_title' button will be shown. If not empty, the first button must launch the game.
+

Game

+

This object represents a game. Use BotFather to create and edit games; their short names will act as unique identifiers.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
titleStringTitle of the game
descriptionStringDescription of the game
photoArray of PhotoSizePhoto that will be displayed in the game message in chats
textStringOptional. Brief description of the game or high scores included in the game message. Can be automatically edited to include current high scores for the game when the bot calls setGameScore, or manually edited using editMessageText. 0-4096 characters.
text_entitiesArray of MessageEntityOptional. Special entities that appear in text, such as usernames, URLs, bot commands, etc.
animationAnimationOptional. Animation that will be displayed in the game message in chats. Upload via BotFather.
+

CallbackGame

+

A placeholder, currently holds no information. Use BotFather to set up your game.

+

setGameScore

+

Use 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 not greater than the user's current score in the chat and force is False.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ParameterTypeRequiredDescription
user_idIntegerYesUser identifier
scoreIntegerYesNew score, must be non-negative
forceBooleanOptionalPass True if the high score is allowed to decrease. This can be useful when fixing mistakes or banning cheaters.
disable_edit_messageBooleanOptionalPass True if the game message should not be automatically edited to include the current scoreboard
chat_idIntegerOptionalRequired if inline_message_id is not specified. Unique identifier for the target chat.
message_idIntegerOptionalRequired if inline_message_id is not specified. Identifier of the sent message.
inline_message_idStringOptionalRequired if chat_id and message_id are not specified. Identifier of the inline message.
+

getGameHighScores

+

Use 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.

+
+

This method will currently return scores for the target user, plus two of their closest neighbors on each side. Will also return the top three users if the user and their neighbors are not among them. Please note that this behavior is subject to change.

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ParameterTypeRequiredDescription
user_idIntegerYesTarget user id
chat_idIntegerOptionalRequired if inline_message_id is not specified. Unique identifier for the target chat.
message_idIntegerOptionalRequired if inline_message_id is not specified. Identifier of the sent message.
inline_message_idStringOptionalRequired if chat_id and message_id are not specified. Identifier of the inline message.
+

GameHighScore

+

This object represents one row of the high scores table for a game.

+ + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
positionIntegerPosition in high score table for the game
userUserUser
scoreIntegerScore
+
+

And that's about all we've got for now.
If you've got any questions, please check out our Bot FAQ »

+
+ +
+ +
+
+ +
+ + + + + + + + +