Update to TDLib 1.8.47

This commit is contained in:
c0re100 2025-04-13 20:30:45 +08:00
parent 05b67218a9
commit c695d13f46
No known key found for this signature in database
GPG key ID: 7C3B3004FE745AAF
4 changed files with 1664 additions and 249 deletions

File diff suppressed because it is too large Load diff

View file

@ -48,7 +48,7 @@ const (
ClassMessageReplyTo = "MessageReplyTo" ClassMessageReplyTo = "MessageReplyTo"
ClassInputMessageReplyTo = "InputMessageReplyTo" ClassInputMessageReplyTo = "InputMessageReplyTo"
ClassMessageSource = "MessageSource" ClassMessageSource = "MessageSource"
ClassReportChatSponsoredMessageResult = "ReportChatSponsoredMessageResult" ClassReportSponsoredResult = "ReportSponsoredResult"
ClassNotificationSettingsScope = "NotificationSettingsScope" ClassNotificationSettingsScope = "NotificationSettingsScope"
ClassReactionNotificationSource = "ReactionNotificationSource" ClassReactionNotificationSource = "ReactionNotificationSource"
ClassChatType = "ChatType" ClassChatType = "ChatType"
@ -126,6 +126,7 @@ const (
ClassPremiumStoryFeature = "PremiumStoryFeature" ClassPremiumStoryFeature = "PremiumStoryFeature"
ClassPremiumSource = "PremiumSource" ClassPremiumSource = "PremiumSource"
ClassStorePaymentPurpose = "StorePaymentPurpose" ClassStorePaymentPurpose = "StorePaymentPurpose"
ClassStoreTransaction = "StoreTransaction"
ClassTelegramPaymentPurpose = "TelegramPaymentPurpose" ClassTelegramPaymentPurpose = "TelegramPaymentPurpose"
ClassDeviceToken = "DeviceToken" ClassDeviceToken = "DeviceToken"
ClassBackgroundFill = "BackgroundFill" ClassBackgroundFill = "BackgroundFill"
@ -227,6 +228,7 @@ const (
ClassBusinessRecipients = "BusinessRecipients" ClassBusinessRecipients = "BusinessRecipients"
ClassBusinessAwayMessageSettings = "BusinessAwayMessageSettings" ClassBusinessAwayMessageSettings = "BusinessAwayMessageSettings"
ClassBusinessGreetingMessageSettings = "BusinessGreetingMessageSettings" ClassBusinessGreetingMessageSettings = "BusinessGreetingMessageSettings"
ClassBusinessBotRights = "BusinessBotRights"
ClassBusinessConnectedBot = "BusinessConnectedBot" ClassBusinessConnectedBot = "BusinessConnectedBot"
ClassBusinessStartPage = "BusinessStartPage" ClassBusinessStartPage = "BusinessStartPage"
ClassInputBusinessStartPage = "InputBusinessStartPage" ClassInputBusinessStartPage = "InputBusinessStartPage"
@ -267,6 +269,8 @@ const (
ClassStarGiveawayWinnerOption = "StarGiveawayWinnerOption" ClassStarGiveawayWinnerOption = "StarGiveawayWinnerOption"
ClassStarGiveawayPaymentOption = "StarGiveawayPaymentOption" ClassStarGiveawayPaymentOption = "StarGiveawayPaymentOption"
ClassStarGiveawayPaymentOptions = "StarGiveawayPaymentOptions" ClassStarGiveawayPaymentOptions = "StarGiveawayPaymentOptions"
ClassAcceptedGiftTypes = "AcceptedGiftTypes"
ClassGiftSettings = "GiftSettings"
ClassUpgradedGiftModel = "UpgradedGiftModel" ClassUpgradedGiftModel = "UpgradedGiftModel"
ClassUpgradedGiftSymbol = "UpgradedGiftSymbol" ClassUpgradedGiftSymbol = "UpgradedGiftSymbol"
ClassUpgradedGiftBackdropColors = "UpgradedGiftBackdropColors" ClassUpgradedGiftBackdropColors = "UpgradedGiftBackdropColors"
@ -344,6 +348,8 @@ const (
ClassMessageSponsor = "MessageSponsor" ClassMessageSponsor = "MessageSponsor"
ClassSponsoredMessage = "SponsoredMessage" ClassSponsoredMessage = "SponsoredMessage"
ClassSponsoredMessages = "SponsoredMessages" ClassSponsoredMessages = "SponsoredMessages"
ClassSponsoredChat = "SponsoredChat"
ClassSponsoredChats = "SponsoredChats"
ClassReportOption = "ReportOption" ClassReportOption = "ReportOption"
ClassFileDownload = "FileDownload" ClassFileDownload = "FileDownload"
ClassDownloadedFileCounts = "DownloadedFileCounts" ClassDownloadedFileCounts = "DownloadedFileCounts"
@ -630,6 +636,7 @@ const (
TypeTermsOfService = "termsOfService" TypeTermsOfService = "termsOfService"
TypeAuthorizationStateWaitTdlibParameters = "authorizationStateWaitTdlibParameters" TypeAuthorizationStateWaitTdlibParameters = "authorizationStateWaitTdlibParameters"
TypeAuthorizationStateWaitPhoneNumber = "authorizationStateWaitPhoneNumber" TypeAuthorizationStateWaitPhoneNumber = "authorizationStateWaitPhoneNumber"
TypeAuthorizationStateWaitPremiumPurchase = "authorizationStateWaitPremiumPurchase"
TypeAuthorizationStateWaitEmailAddress = "authorizationStateWaitEmailAddress" TypeAuthorizationStateWaitEmailAddress = "authorizationStateWaitEmailAddress"
TypeAuthorizationStateWaitEmailCode = "authorizationStateWaitEmailCode" TypeAuthorizationStateWaitEmailCode = "authorizationStateWaitEmailCode"
TypeAuthorizationStateWaitCode = "authorizationStateWaitCode" TypeAuthorizationStateWaitCode = "authorizationStateWaitCode"
@ -722,6 +729,7 @@ const (
TypeBusinessRecipients = "businessRecipients" TypeBusinessRecipients = "businessRecipients"
TypeBusinessAwayMessageSettings = "businessAwayMessageSettings" TypeBusinessAwayMessageSettings = "businessAwayMessageSettings"
TypeBusinessGreetingMessageSettings = "businessGreetingMessageSettings" TypeBusinessGreetingMessageSettings = "businessGreetingMessageSettings"
TypeBusinessBotRights = "businessBotRights"
TypeBusinessConnectedBot = "businessConnectedBot" TypeBusinessConnectedBot = "businessConnectedBot"
TypeBusinessStartPage = "businessStartPage" TypeBusinessStartPage = "businessStartPage"
TypeInputBusinessStartPage = "inputBusinessStartPage" TypeInputBusinessStartPage = "inputBusinessStartPage"
@ -776,6 +784,8 @@ const (
TypeStarGiveawayWinnerOption = "starGiveawayWinnerOption" TypeStarGiveawayWinnerOption = "starGiveawayWinnerOption"
TypeStarGiveawayPaymentOption = "starGiveawayPaymentOption" TypeStarGiveawayPaymentOption = "starGiveawayPaymentOption"
TypeStarGiveawayPaymentOptions = "starGiveawayPaymentOptions" TypeStarGiveawayPaymentOptions = "starGiveawayPaymentOptions"
TypeAcceptedGiftTypes = "acceptedGiftTypes"
TypeGiftSettings = "giftSettings"
TypeUpgradedGiftModel = "upgradedGiftModel" TypeUpgradedGiftModel = "upgradedGiftModel"
TypeUpgradedGiftSymbol = "upgradedGiftSymbol" TypeUpgradedGiftSymbol = "upgradedGiftSymbol"
TypeUpgradedGiftBackdropColors = "upgradedGiftBackdropColors" TypeUpgradedGiftBackdropColors = "upgradedGiftBackdropColors"
@ -821,6 +831,8 @@ const (
TypeStarTransactionTypePaidMessageSend = "starTransactionTypePaidMessageSend" TypeStarTransactionTypePaidMessageSend = "starTransactionTypePaidMessageSend"
TypeStarTransactionTypePaidMessageReceive = "starTransactionTypePaidMessageReceive" TypeStarTransactionTypePaidMessageReceive = "starTransactionTypePaidMessageReceive"
TypeStarTransactionTypePremiumPurchase = "starTransactionTypePremiumPurchase" TypeStarTransactionTypePremiumPurchase = "starTransactionTypePremiumPurchase"
TypeStarTransactionTypeBusinessBotTransferSend = "starTransactionTypeBusinessBotTransferSend"
TypeStarTransactionTypeBusinessBotTransferReceive = "starTransactionTypeBusinessBotTransferReceive"
TypeStarTransactionTypeUnsupported = "starTransactionTypeUnsupported" TypeStarTransactionTypeUnsupported = "starTransactionTypeUnsupported"
TypeStarTransaction = "starTransaction" TypeStarTransaction = "starTransaction"
TypeStarTransactions = "starTransactions" TypeStarTransactions = "starTransactions"
@ -961,12 +973,14 @@ const (
TypeMessageSponsor = "messageSponsor" TypeMessageSponsor = "messageSponsor"
TypeSponsoredMessage = "sponsoredMessage" TypeSponsoredMessage = "sponsoredMessage"
TypeSponsoredMessages = "sponsoredMessages" TypeSponsoredMessages = "sponsoredMessages"
TypeSponsoredChat = "sponsoredChat"
TypeSponsoredChats = "sponsoredChats"
TypeReportOption = "reportOption" TypeReportOption = "reportOption"
TypeReportChatSponsoredMessageResultOk = "reportChatSponsoredMessageResultOk" TypeReportSponsoredResultOk = "reportSponsoredResultOk"
TypeReportChatSponsoredMessageResultFailed = "reportChatSponsoredMessageResultFailed" TypeReportSponsoredResultFailed = "reportSponsoredResultFailed"
TypeReportChatSponsoredMessageResultOptionRequired = "reportChatSponsoredMessageResultOptionRequired" TypeReportSponsoredResultOptionRequired = "reportSponsoredResultOptionRequired"
TypeReportChatSponsoredMessageResultAdsHidden = "reportChatSponsoredMessageResultAdsHidden" TypeReportSponsoredResultAdsHidden = "reportSponsoredResultAdsHidden"
TypeReportChatSponsoredMessageResultPremiumRequired = "reportChatSponsoredMessageResultPremiumRequired" TypeReportSponsoredResultPremiumRequired = "reportSponsoredResultPremiumRequired"
TypeFileDownload = "fileDownload" TypeFileDownload = "fileDownload"
TypeDownloadedFileCounts = "downloadedFileCounts" TypeDownloadedFileCounts = "downloadedFileCounts"
TypeFoundFileDownloads = "foundFileDownloads" TypeFoundFileDownloads = "foundFileDownloads"
@ -1338,6 +1352,8 @@ const (
TypeMessageGift = "messageGift" TypeMessageGift = "messageGift"
TypeMessageUpgradedGift = "messageUpgradedGift" TypeMessageUpgradedGift = "messageUpgradedGift"
TypeMessageRefundedUpgradedGift = "messageRefundedUpgradedGift" TypeMessageRefundedUpgradedGift = "messageRefundedUpgradedGift"
TypeMessagePaidMessagesRefunded = "messagePaidMessagesRefunded"
TypeMessagePaidMessagePriceChanged = "messagePaidMessagePriceChanged"
TypeMessageContactRegistered = "messageContactRegistered" TypeMessageContactRegistered = "messageContactRegistered"
TypeMessageUsersShared = "messageUsersShared" TypeMessageUsersShared = "messageUsersShared"
TypeMessageChatShared = "messageChatShared" TypeMessageChatShared = "messageChatShared"
@ -1771,6 +1787,8 @@ const (
TypeStorePaymentPurposeStarGiveaway = "storePaymentPurposeStarGiveaway" TypeStorePaymentPurposeStarGiveaway = "storePaymentPurposeStarGiveaway"
TypeStorePaymentPurposeStars = "storePaymentPurposeStars" TypeStorePaymentPurposeStars = "storePaymentPurposeStars"
TypeStorePaymentPurposeGiftedStars = "storePaymentPurposeGiftedStars" TypeStorePaymentPurposeGiftedStars = "storePaymentPurposeGiftedStars"
TypeStoreTransactionAppStore = "storeTransactionAppStore"
TypeStoreTransactionGooglePlay = "storeTransactionGooglePlay"
TypeTelegramPaymentPurposePremiumGift = "telegramPaymentPurposePremiumGift" TypeTelegramPaymentPurposePremiumGift = "telegramPaymentPurposePremiumGift"
TypeTelegramPaymentPurposePremiumGiftCodes = "telegramPaymentPurposePremiumGiftCodes" TypeTelegramPaymentPurposePremiumGiftCodes = "telegramPaymentPurposePremiumGiftCodes"
TypeTelegramPaymentPurposePremiumGiveaway = "telegramPaymentPurposePremiumGiveaway" TypeTelegramPaymentPurposePremiumGiveaway = "telegramPaymentPurposePremiumGiveaway"
@ -2215,6 +2233,7 @@ const (
TypeUpdateQuickReplyShortcuts = "updateQuickReplyShortcuts" TypeUpdateQuickReplyShortcuts = "updateQuickReplyShortcuts"
TypeUpdateQuickReplyShortcutMessages = "updateQuickReplyShortcutMessages" TypeUpdateQuickReplyShortcutMessages = "updateQuickReplyShortcutMessages"
TypeUpdateForumTopicInfo = "updateForumTopicInfo" TypeUpdateForumTopicInfo = "updateForumTopicInfo"
TypeUpdateForumTopic = "updateForumTopic"
TypeUpdateScopeNotificationSettings = "updateScopeNotificationSettings" TypeUpdateScopeNotificationSettings = "updateScopeNotificationSettings"
TypeUpdateReactionNotificationSettings = "updateReactionNotificationSettings" TypeUpdateReactionNotificationSettings = "updateReactionNotificationSettings"
TypeUpdateNotification = "updateNotification" TypeUpdateNotification = "updateNotification"
@ -2269,6 +2288,7 @@ const (
TypeUpdateProfileAccentColors = "updateProfileAccentColors" TypeUpdateProfileAccentColors = "updateProfileAccentColors"
TypeUpdateLanguagePackStrings = "updateLanguagePackStrings" TypeUpdateLanguagePackStrings = "updateLanguagePackStrings"
TypeUpdateConnectionState = "updateConnectionState" TypeUpdateConnectionState = "updateConnectionState"
TypeUpdateFreezeState = "updateFreezeState"
TypeUpdateTermsOfService = "updateTermsOfService" TypeUpdateTermsOfService = "updateTermsOfService"
TypeUpdateUnconfirmedSession = "updateUnconfirmedSession" TypeUpdateUnconfirmedSession = "updateUnconfirmedSession"
TypeUpdateAttachmentMenuBots = "updateAttachmentMenuBots" TypeUpdateAttachmentMenuBots = "updateAttachmentMenuBots"
@ -2532,9 +2552,9 @@ type MessageSource interface {
MessageSourceType() string MessageSourceType() string
} }
// Describes result of sponsored message report // Describes result of sponsored message or chat report
type ReportChatSponsoredMessageResult interface { type ReportSponsoredResult interface {
ReportChatSponsoredMessageResultType() string ReportSponsoredResultType() string
} }
// Describes the types of chats to which notification settings are relevant // Describes the types of chats to which notification settings are relevant
@ -2922,6 +2942,11 @@ type StorePaymentPurpose interface {
StorePaymentPurposeType() string StorePaymentPurposeType() string
} }
// Describes an in-store transaction
type StoreTransaction interface {
StoreTransactionType() string
}
// Describes a purpose of a payment toward Telegram // Describes a purpose of a payment toward Telegram
type TelegramPaymentPurpose interface { type TelegramPaymentPurpose interface {
TelegramPaymentPurposeType() string TelegramPaymentPurposeType() string
@ -3884,6 +3909,33 @@ func (*AuthorizationStateWaitPhoneNumber) AuthorizationStateType() string {
return TypeAuthorizationStateWaitPhoneNumber return TypeAuthorizationStateWaitPhoneNumber
} }
// The user must buy Telegram Premium as an in-store purchase to log in. Call checkAuthenticationPremiumPurchase and then setAuthenticationPremiumPurchaseTransaction
type AuthorizationStateWaitPremiumPurchase struct {
meta
// Identifier of the store product that must be bought
StoreProductId string `json:"store_product_id"`
}
func (entity *AuthorizationStateWaitPremiumPurchase) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub AuthorizationStateWaitPremiumPurchase
return json.Marshal((*stub)(entity))
}
func (*AuthorizationStateWaitPremiumPurchase) GetClass() string {
return ClassAuthorizationState
}
func (*AuthorizationStateWaitPremiumPurchase) GetType() string {
return TypeAuthorizationStateWaitPremiumPurchase
}
func (*AuthorizationStateWaitPremiumPurchase) AuthorizationStateType() string {
return TypeAuthorizationStateWaitPremiumPurchase
}
// TDLib needs the user's email address to authorize. Call setAuthenticationEmailAddress to provide the email address, or directly call checkAuthenticationEmailCode with Apple ID/Google ID token if allowed // TDLib needs the user's email address to authorize. Call setAuthenticationEmailAddress to provide the email address, or directly call checkAuthenticationEmailCode with Apple ID/Google ID token if allowed
type AuthorizationStateWaitEmailAddress struct { type AuthorizationStateWaitEmailAddress struct {
meta meta
@ -6771,6 +6823,55 @@ func (*BusinessGreetingMessageSettings) GetType() string {
return TypeBusinessGreetingMessageSettings return TypeBusinessGreetingMessageSettings
} }
// Describes rights of a business bot
type BusinessBotRights struct {
meta
// True, if the bot can send and edit messages in the private chats that had incoming messages in the last 24 hours
CanReply bool `json:"can_reply"`
// True, if the bot can mark incoming private messages as read
CanReadMessages bool `json:"can_read_messages"`
// True, if the bot can delete sent messages
CanDeleteSentMessages bool `json:"can_delete_sent_messages"`
// True, if the bot can delete any message
CanDeleteAllMessages bool `json:"can_delete_all_messages"`
// True, if the bot can edit name of the business account
CanEditName bool `json:"can_edit_name"`
// True, if the bot can edit bio of the business account
CanEditBio bool `json:"can_edit_bio"`
// True, if the bot can edit profile photo of the business account
CanEditProfilePhoto bool `json:"can_edit_profile_photo"`
// True, if the bot can edit username of the business account
CanEditUsername bool `json:"can_edit_username"`
// True, if the bot can view gifts and amount of Telegram Stars owned by the business account
CanViewGiftsAndStars bool `json:"can_view_gifts_and_stars"`
// True, if the bot can sell regular gifts received by the business account
CanSellGifts bool `json:"can_sell_gifts"`
// True, if the bot can change gift receiving settings of the business account
CanChangeGiftSettings bool `json:"can_change_gift_settings"`
// True, if the bot can transfer and upgrade gifts received by the business account
CanTransferAndUpgradeGifts bool `json:"can_transfer_and_upgrade_gifts"`
// True, if the bot can transfer Telegram Stars received by the business account to account of the bot, or use them to upgrade and transfer gifts
CanTransferStars bool `json:"can_transfer_stars"`
// True, if the bot can send, edit and delete stories
CanManageStories bool `json:"can_manage_stories"`
}
func (entity *BusinessBotRights) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub BusinessBotRights
return json.Marshal((*stub)(entity))
}
func (*BusinessBotRights) GetClass() string {
return ClassBusinessBotRights
}
func (*BusinessBotRights) GetType() string {
return TypeBusinessBotRights
}
// Describes a bot connected to a business account // Describes a bot connected to a business account
type BusinessConnectedBot struct { type BusinessConnectedBot struct {
meta meta
@ -6778,8 +6879,8 @@ type BusinessConnectedBot struct {
BotUserId int64 `json:"bot_user_id"` BotUserId int64 `json:"bot_user_id"`
// Private chats that will be accessible to the bot // Private chats that will be accessible to the bot
Recipients *BusinessRecipients `json:"recipients"` Recipients *BusinessRecipients `json:"recipients"`
// True, if the bot can send messages to the private chats; false otherwise // Rights of the bot
CanReply bool `json:"can_reply"` Rights *BusinessBotRights `json:"rights"`
} }
func (entity *BusinessConnectedBot) MarshalJSON() ([]byte, error) { func (entity *BusinessConnectedBot) MarshalJSON() ([]byte, error) {
@ -8488,6 +8589,60 @@ func (*StarGiveawayPaymentOptions) GetType() string {
return TypeStarGiveawayPaymentOptions return TypeStarGiveawayPaymentOptions
} }
// Describes gift types that are accepted by a user
type AcceptedGiftTypes struct {
meta
// True, if unlimited regular gifts are accepted
UnlimitedGifts bool `json:"unlimited_gifts"`
// True, if limited regular gifts are accepted
LimitedGifts bool `json:"limited_gifts"`
// True, if upgraded gifts and regular gifts that can be upgraded for free are accepted
UpgradedGifts bool `json:"upgraded_gifts"`
// True, if Telegram Premium subscription is accepted
PremiumSubscription bool `json:"premium_subscription"`
}
func (entity *AcceptedGiftTypes) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub AcceptedGiftTypes
return json.Marshal((*stub)(entity))
}
func (*AcceptedGiftTypes) GetClass() string {
return ClassAcceptedGiftTypes
}
func (*AcceptedGiftTypes) GetType() string {
return TypeAcceptedGiftTypes
}
// Contains settings for gift receiving for a user
type GiftSettings struct {
meta
// True, if a button for sending a gift to the user or by the user must always be shown in the input field
ShowGiftButton bool `json:"show_gift_button"`
// Types of gifts accepted by the user; for Telegram Premium users only
AcceptedGiftTypes *AcceptedGiftTypes `json:"accepted_gift_types"`
}
func (entity *GiftSettings) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub GiftSettings
return json.Marshal((*stub)(entity))
}
func (*GiftSettings) GetClass() string {
return ClassGiftSettings
}
func (*GiftSettings) GetType() string {
return TypeGiftSettings
}
// Describes a model of an upgraded gift // Describes a model of an upgraded gift
type UpgradedGiftModel struct { type UpgradedGiftModel struct {
meta meta
@ -8495,7 +8650,7 @@ type UpgradedGiftModel struct {
Name string `json:"name"` Name string `json:"name"`
// The sticker representing the upgraded gift // The sticker representing the upgraded gift
Sticker *Sticker `json:"sticker"` Sticker *Sticker `json:"sticker"`
// The number of upgraded gift that receive this model for each 1000 gifts upgraded // The number of upgraded gifts that receive this model for each 1000 gifts upgraded
RarityPerMille int32 `json:"rarity_per_mille"` RarityPerMille int32 `json:"rarity_per_mille"`
} }
@ -8520,9 +8675,9 @@ type UpgradedGiftSymbol struct {
meta meta
// Name of the symbol // Name of the symbol
Name string `json:"name"` Name string `json:"name"`
// The sticker representing the upgraded gift // The sticker representing the symbol
Sticker *Sticker `json:"sticker"` Sticker *Sticker `json:"sticker"`
// The number of upgraded gift that receive this symbol for each 1000 gifts upgraded // The number of upgraded gifts that receive this symbol for each 1000 gifts upgraded
RarityPerMille int32 `json:"rarity_per_mille"` RarityPerMille int32 `json:"rarity_per_mille"`
} }
@ -8578,7 +8733,7 @@ type UpgradedGiftBackdrop struct {
Name string `json:"name"` Name string `json:"name"`
// Colors of the backdrop // Colors of the backdrop
Colors *UpgradedGiftBackdropColors `json:"colors"` Colors *UpgradedGiftBackdropColors `json:"colors"`
// The number of upgraded gift that receive this backdrop for each 1000 gifts upgraded // The number of upgraded gifts that receive this backdrop for each 1000 gifts upgraded
RarityPerMille int32 `json:"rarity_per_mille"` RarityPerMille int32 `json:"rarity_per_mille"`
} }
@ -8733,11 +8888,11 @@ type UpgradedGift struct {
MaxUpgradedCount int32 `json:"max_upgraded_count"` MaxUpgradedCount int32 `json:"max_upgraded_count"`
// Identifier of the user or the chat that owns the upgraded gift; may be null if none or unknown // Identifier of the user or the chat that owns the upgraded gift; may be null if none or unknown
OwnerId MessageSender `json:"owner_id"` OwnerId MessageSender `json:"owner_id"`
// Address of the gift NFT owner in TON blockchain; may be empty if none // Address of the gift NFT owner in TON blockchain; may be empty if none. Append the address to getOption("ton_blockchain_explorer_url") to get a link with information about the address
OwnerAddress string `json:"owner_address"` OwnerAddress string `json:"owner_address"`
// Name of the owner for the case when owner identifier and address aren't known // Name of the owner for the case when owner identifier and address aren't known
OwnerName string `json:"owner_name"` OwnerName string `json:"owner_name"`
// Address of the gift NFT in TON blockchain; may be empty if none // Address of the gift NFT in TON blockchain; may be empty if none. Append the address to getOption("ton_blockchain_explorer_url") to get a link with information about the address
GiftAddress string `json:"gift_address"` GiftAddress string `json:"gift_address"`
// Model of the upgraded gift // Model of the upgraded gift
Model *UpgradedGiftModel `json:"model"` Model *UpgradedGiftModel `json:"model"`
@ -10072,7 +10227,7 @@ func (starTransactionTypePaidMessageReceive *StarTransactionTypePaidMessageRecei
return nil return nil
} }
// The transaction is a purchase of Telegram Premium subscription; for regular users only // The transaction is a purchase of Telegram Premium subscription; for regular users and bots only
type StarTransactionTypePremiumPurchase struct { type StarTransactionTypePremiumPurchase struct {
meta meta
// Identifier of the user that received the Telegram Premium subscription // Identifier of the user that received the Telegram Premium subscription
@ -10103,6 +10258,60 @@ func (*StarTransactionTypePremiumPurchase) StarTransactionTypeType() string {
return TypeStarTransactionTypePremiumPurchase return TypeStarTransactionTypePremiumPurchase
} }
// The transaction is a transfer of Telegram Stars to a business bot; for regular users only
type StarTransactionTypeBusinessBotTransferSend struct {
meta
// Identifier of the bot that received Telegram Stars
UserId int64 `json:"user_id"`
}
func (entity *StarTransactionTypeBusinessBotTransferSend) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub StarTransactionTypeBusinessBotTransferSend
return json.Marshal((*stub)(entity))
}
func (*StarTransactionTypeBusinessBotTransferSend) GetClass() string {
return ClassStarTransactionType
}
func (*StarTransactionTypeBusinessBotTransferSend) GetType() string {
return TypeStarTransactionTypeBusinessBotTransferSend
}
func (*StarTransactionTypeBusinessBotTransferSend) StarTransactionTypeType() string {
return TypeStarTransactionTypeBusinessBotTransferSend
}
// The transaction is a transfer of Telegram Stars from a business account; for bots only
type StarTransactionTypeBusinessBotTransferReceive struct {
meta
// Identifier of the user that sent Telegram Stars
UserId int64 `json:"user_id"`
}
func (entity *StarTransactionTypeBusinessBotTransferReceive) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub StarTransactionTypeBusinessBotTransferReceive
return json.Marshal((*stub)(entity))
}
func (*StarTransactionTypeBusinessBotTransferReceive) GetClass() string {
return ClassStarTransactionType
}
func (*StarTransactionTypeBusinessBotTransferReceive) GetType() string {
return TypeStarTransactionTypeBusinessBotTransferReceive
}
func (*StarTransactionTypeBusinessBotTransferReceive) StarTransactionTypeType() string {
return TypeStarTransactionTypeBusinessBotTransferReceive
}
// The transaction is a transaction of an unsupported type // The transaction is a transaction of an unsupported type
type StarTransactionTypeUnsupported struct{ type StarTransactionTypeUnsupported struct{
meta meta
@ -11082,6 +11291,8 @@ type UserFullInfo struct {
IncomingPaidMessageStarCount int64 `json:"incoming_paid_message_star_count"` IncomingPaidMessageStarCount int64 `json:"incoming_paid_message_star_count"`
// Number of Telegram Stars that must be paid by the current user for each sent message to the user // Number of Telegram Stars that must be paid by the current user for each sent message to the user
OutgoingPaidMessageStarCount int64 `json:"outgoing_paid_message_star_count"` OutgoingPaidMessageStarCount int64 `json:"outgoing_paid_message_star_count"`
// Settings for gift receiving for the user
GiftSettings *GiftSettings `json:"gift_settings"`
// Information about verification status of the user provided by a bot; may be null if none or unknown // Information about verification status of the user provided by a bot; may be null if none or unknown
BotVerification *BotVerification `json:"bot_verification"` BotVerification *BotVerification `json:"bot_verification"`
// Information about business settings for Telegram Business accounts; may be null if none // Information about business settings for Telegram Business accounts; may be null if none
@ -11128,6 +11339,7 @@ func (userFullInfo *UserFullInfo) UnmarshalJSON(data []byte) error {
GroupInCommonCount int32 `json:"group_in_common_count"` GroupInCommonCount int32 `json:"group_in_common_count"`
IncomingPaidMessageStarCount int64 `json:"incoming_paid_message_star_count"` IncomingPaidMessageStarCount int64 `json:"incoming_paid_message_star_count"`
OutgoingPaidMessageStarCount int64 `json:"outgoing_paid_message_star_count"` OutgoingPaidMessageStarCount int64 `json:"outgoing_paid_message_star_count"`
GiftSettings *GiftSettings `json:"gift_settings"`
BotVerification *BotVerification `json:"bot_verification"` BotVerification *BotVerification `json:"bot_verification"`
BusinessInfo *BusinessInfo `json:"business_info"` BusinessInfo *BusinessInfo `json:"business_info"`
BotInfo *BotInfo `json:"bot_info"` BotInfo *BotInfo `json:"bot_info"`
@ -11157,6 +11369,7 @@ func (userFullInfo *UserFullInfo) UnmarshalJSON(data []byte) error {
userFullInfo.GroupInCommonCount = tmp.GroupInCommonCount userFullInfo.GroupInCommonCount = tmp.GroupInCommonCount
userFullInfo.IncomingPaidMessageStarCount = tmp.IncomingPaidMessageStarCount userFullInfo.IncomingPaidMessageStarCount = tmp.IncomingPaidMessageStarCount
userFullInfo.OutgoingPaidMessageStarCount = tmp.OutgoingPaidMessageStarCount userFullInfo.OutgoingPaidMessageStarCount = tmp.OutgoingPaidMessageStarCount
userFullInfo.GiftSettings = tmp.GiftSettings
userFullInfo.BotVerification = tmp.BotVerification userFullInfo.BotVerification = tmp.BotVerification
userFullInfo.BusinessInfo = tmp.BusinessInfo userFullInfo.BusinessInfo = tmp.BusinessInfo
userFullInfo.BotInfo = tmp.BotInfo userFullInfo.BotInfo = tmp.BotInfo
@ -15072,6 +15285,58 @@ func (*SponsoredMessages) GetType() string {
return TypeSponsoredMessages return TypeSponsoredMessages
} }
// Describes a sponsored chat
type SponsoredChat struct {
meta
// Unique identifier of this result
UniqueId int64 `json:"unique_id"`
// Chat identifier
ChatId int64 `json:"chat_id"`
// Additional optional information about the sponsor to be shown along with the chat
SponsorInfo string `json:"sponsor_info"`
// If non-empty, additional information about the sponsored chat to be shown along with the chat
AdditionalInfo string `json:"additional_info"`
}
func (entity *SponsoredChat) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub SponsoredChat
return json.Marshal((*stub)(entity))
}
func (*SponsoredChat) GetClass() string {
return ClassSponsoredChat
}
func (*SponsoredChat) GetType() string {
return TypeSponsoredChat
}
// Contains a list of sponsored chats
type SponsoredChats struct {
meta
// List of sponsored chats
Chats []*SponsoredChat `json:"chats"`
}
func (entity *SponsoredChats) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub SponsoredChats
return json.Marshal((*stub)(entity))
}
func (*SponsoredChats) GetClass() string {
return ClassSponsoredChats
}
func (*SponsoredChats) GetType() string {
return TypeSponsoredChats
}
// Describes an option to report an entity to Telegram // Describes an option to report an entity to Telegram
type ReportOption struct { type ReportOption struct {
meta meta
@ -15098,57 +15363,57 @@ func (*ReportOption) GetType() string {
} }
// The message was reported successfully // The message was reported successfully
type ReportChatSponsoredMessageResultOk struct{ type ReportSponsoredResultOk struct{
meta meta
} }
func (entity *ReportChatSponsoredMessageResultOk) MarshalJSON() ([]byte, error) { func (entity *ReportSponsoredResultOk) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType() entity.meta.Type = entity.GetType()
type stub ReportChatSponsoredMessageResultOk type stub ReportSponsoredResultOk
return json.Marshal((*stub)(entity)) return json.Marshal((*stub)(entity))
} }
func (*ReportChatSponsoredMessageResultOk) GetClass() string { func (*ReportSponsoredResultOk) GetClass() string {
return ClassReportChatSponsoredMessageResult return ClassReportSponsoredResult
} }
func (*ReportChatSponsoredMessageResultOk) GetType() string { func (*ReportSponsoredResultOk) GetType() string {
return TypeReportChatSponsoredMessageResultOk return TypeReportSponsoredResultOk
} }
func (*ReportChatSponsoredMessageResultOk) ReportChatSponsoredMessageResultType() string { func (*ReportSponsoredResultOk) ReportSponsoredResultType() string {
return TypeReportChatSponsoredMessageResultOk return TypeReportSponsoredResultOk
} }
// The sponsored message is too old or not found // The sponsored message is too old or not found
type ReportChatSponsoredMessageResultFailed struct{ type ReportSponsoredResultFailed struct{
meta meta
} }
func (entity *ReportChatSponsoredMessageResultFailed) MarshalJSON() ([]byte, error) { func (entity *ReportSponsoredResultFailed) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType() entity.meta.Type = entity.GetType()
type stub ReportChatSponsoredMessageResultFailed type stub ReportSponsoredResultFailed
return json.Marshal((*stub)(entity)) return json.Marshal((*stub)(entity))
} }
func (*ReportChatSponsoredMessageResultFailed) GetClass() string { func (*ReportSponsoredResultFailed) GetClass() string {
return ClassReportChatSponsoredMessageResult return ClassReportSponsoredResult
} }
func (*ReportChatSponsoredMessageResultFailed) GetType() string { func (*ReportSponsoredResultFailed) GetType() string {
return TypeReportChatSponsoredMessageResultFailed return TypeReportSponsoredResultFailed
} }
func (*ReportChatSponsoredMessageResultFailed) ReportChatSponsoredMessageResultType() string { func (*ReportSponsoredResultFailed) ReportSponsoredResultType() string {
return TypeReportChatSponsoredMessageResultFailed return TypeReportSponsoredResultFailed
} }
// The user must choose an option to report the message and repeat request with the chosen option // The user must choose an option to report the message and repeat request with the chosen option
type ReportChatSponsoredMessageResultOptionRequired struct { type ReportSponsoredResultOptionRequired struct {
meta meta
// Title for the option choice // Title for the option choice
Title string `json:"title"` Title string `json:"title"`
@ -15156,74 +15421,74 @@ type ReportChatSponsoredMessageResultOptionRequired struct {
Options []*ReportOption `json:"options"` Options []*ReportOption `json:"options"`
} }
func (entity *ReportChatSponsoredMessageResultOptionRequired) MarshalJSON() ([]byte, error) { func (entity *ReportSponsoredResultOptionRequired) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType() entity.meta.Type = entity.GetType()
type stub ReportChatSponsoredMessageResultOptionRequired type stub ReportSponsoredResultOptionRequired
return json.Marshal((*stub)(entity)) return json.Marshal((*stub)(entity))
} }
func (*ReportChatSponsoredMessageResultOptionRequired) GetClass() string { func (*ReportSponsoredResultOptionRequired) GetClass() string {
return ClassReportChatSponsoredMessageResult return ClassReportSponsoredResult
} }
func (*ReportChatSponsoredMessageResultOptionRequired) GetType() string { func (*ReportSponsoredResultOptionRequired) GetType() string {
return TypeReportChatSponsoredMessageResultOptionRequired return TypeReportSponsoredResultOptionRequired
} }
func (*ReportChatSponsoredMessageResultOptionRequired) ReportChatSponsoredMessageResultType() string { func (*ReportSponsoredResultOptionRequired) ReportSponsoredResultType() string {
return TypeReportChatSponsoredMessageResultOptionRequired return TypeReportSponsoredResultOptionRequired
} }
// Sponsored messages were hidden for the user in all chats // Sponsored messages were hidden for the user in all chats
type ReportChatSponsoredMessageResultAdsHidden struct{ type ReportSponsoredResultAdsHidden struct{
meta meta
} }
func (entity *ReportChatSponsoredMessageResultAdsHidden) MarshalJSON() ([]byte, error) { func (entity *ReportSponsoredResultAdsHidden) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType() entity.meta.Type = entity.GetType()
type stub ReportChatSponsoredMessageResultAdsHidden type stub ReportSponsoredResultAdsHidden
return json.Marshal((*stub)(entity)) return json.Marshal((*stub)(entity))
} }
func (*ReportChatSponsoredMessageResultAdsHidden) GetClass() string { func (*ReportSponsoredResultAdsHidden) GetClass() string {
return ClassReportChatSponsoredMessageResult return ClassReportSponsoredResult
} }
func (*ReportChatSponsoredMessageResultAdsHidden) GetType() string { func (*ReportSponsoredResultAdsHidden) GetType() string {
return TypeReportChatSponsoredMessageResultAdsHidden return TypeReportSponsoredResultAdsHidden
} }
func (*ReportChatSponsoredMessageResultAdsHidden) ReportChatSponsoredMessageResultType() string { func (*ReportSponsoredResultAdsHidden) ReportSponsoredResultType() string {
return TypeReportChatSponsoredMessageResultAdsHidden return TypeReportSponsoredResultAdsHidden
} }
// The user asked to hide sponsored messages, but Telegram Premium is required for this // The user asked to hide sponsored messages, but Telegram Premium is required for this
type ReportChatSponsoredMessageResultPremiumRequired struct{ type ReportSponsoredResultPremiumRequired struct{
meta meta
} }
func (entity *ReportChatSponsoredMessageResultPremiumRequired) MarshalJSON() ([]byte, error) { func (entity *ReportSponsoredResultPremiumRequired) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType() entity.meta.Type = entity.GetType()
type stub ReportChatSponsoredMessageResultPremiumRequired type stub ReportSponsoredResultPremiumRequired
return json.Marshal((*stub)(entity)) return json.Marshal((*stub)(entity))
} }
func (*ReportChatSponsoredMessageResultPremiumRequired) GetClass() string { func (*ReportSponsoredResultPremiumRequired) GetClass() string {
return ClassReportChatSponsoredMessageResult return ClassReportSponsoredResult
} }
func (*ReportChatSponsoredMessageResultPremiumRequired) GetType() string { func (*ReportSponsoredResultPremiumRequired) GetType() string {
return TypeReportChatSponsoredMessageResultPremiumRequired return TypeReportSponsoredResultPremiumRequired
} }
func (*ReportChatSponsoredMessageResultPremiumRequired) ReportChatSponsoredMessageResultType() string { func (*ReportSponsoredResultPremiumRequired) ReportSponsoredResultType() string {
return TypeReportChatSponsoredMessageResultPremiumRequired return TypeReportSponsoredResultPremiumRequired
} }
// Describes a file added to file download list // Describes a file added to file download list
@ -18311,6 +18576,8 @@ func (*ForumTopicIcon) GetType() string {
// Contains basic information about a forum topic // Contains basic information about a forum topic
type ForumTopicInfo struct { type ForumTopicInfo struct {
meta meta
// Identifier of the forum chat to which the topic belongs
ChatId int64 `json:"chat_id"`
// Message thread identifier of the topic // Message thread identifier of the topic
MessageThreadId int64 `json:"message_thread_id"` MessageThreadId int64 `json:"message_thread_id"`
// Name of the topic // Name of the topic
@ -18349,6 +18616,7 @@ func (*ForumTopicInfo) GetType() string {
func (forumTopicInfo *ForumTopicInfo) UnmarshalJSON(data []byte) error { func (forumTopicInfo *ForumTopicInfo) UnmarshalJSON(data []byte) error {
var tmp struct { var tmp struct {
ChatId int64 `json:"chat_id"`
MessageThreadId int64 `json:"message_thread_id"` MessageThreadId int64 `json:"message_thread_id"`
Name string `json:"name"` Name string `json:"name"`
Icon *ForumTopicIcon `json:"icon"` Icon *ForumTopicIcon `json:"icon"`
@ -18365,6 +18633,7 @@ func (forumTopicInfo *ForumTopicInfo) UnmarshalJSON(data []byte) error {
return err return err
} }
forumTopicInfo.ChatId = tmp.ChatId
forumTopicInfo.MessageThreadId = tmp.MessageThreadId forumTopicInfo.MessageThreadId = tmp.MessageThreadId
forumTopicInfo.Name = tmp.Name forumTopicInfo.Name = tmp.Name
forumTopicInfo.Icon = tmp.Icon forumTopicInfo.Icon = tmp.Icon
@ -18387,6 +18656,8 @@ type ForumTopic struct {
Info *ForumTopicInfo `json:"info"` Info *ForumTopicInfo `json:"info"`
// Last message in the topic; may be null if unknown // Last message in the topic; may be null if unknown
LastMessage *Message `json:"last_message"` LastMessage *Message `json:"last_message"`
// A parameter used to determine order of the topic in the topic list. Topics must be sorted by the order in descending order
Order JsonInt64 `json:"order"`
// True, if the topic is pinned in the topic list // True, if the topic is pinned in the topic list
IsPinned bool `json:"is_pinned"` IsPinned bool `json:"is_pinned"`
// Number of unread messages in the topic // Number of unread messages in the topic
@ -27826,6 +28097,62 @@ func (messageRefundedUpgradedGift *MessageRefundedUpgradedGift) UnmarshalJSON(da
return nil return nil
} }
// Paid messages were refunded
type MessagePaidMessagesRefunded struct {
meta
// The number of refunded messages
MessageCount int32 `json:"message_count"`
// The number of refunded Telegram Stars
StarCount int64 `json:"star_count"`
}
func (entity *MessagePaidMessagesRefunded) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub MessagePaidMessagesRefunded
return json.Marshal((*stub)(entity))
}
func (*MessagePaidMessagesRefunded) GetClass() string {
return ClassMessageContent
}
func (*MessagePaidMessagesRefunded) GetType() string {
return TypeMessagePaidMessagesRefunded
}
func (*MessagePaidMessagesRefunded) MessageContentType() string {
return TypeMessagePaidMessagesRefunded
}
// A price for paid messages was changed in the supergroup chat
type MessagePaidMessagePriceChanged struct {
meta
// The new number of Telegram Stars that must be paid by non-administrator users of the supergroup chat for each sent message
PaidMessageStarCount int64 `json:"paid_message_star_count"`
}
func (entity *MessagePaidMessagePriceChanged) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub MessagePaidMessagePriceChanged
return json.Marshal((*stub)(entity))
}
func (*MessagePaidMessagePriceChanged) GetClass() string {
return ClassMessageContent
}
func (*MessagePaidMessagePriceChanged) GetType() string {
return TypeMessagePaidMessagePriceChanged
}
func (*MessagePaidMessagePriceChanged) MessageContentType() string {
return TypeMessagePaidMessagePriceChanged
}
// A contact has registered with Telegram // A contact has registered with Telegram
type MessageContactRegistered struct{ type MessageContactRegistered struct{
meta meta
@ -35953,8 +36280,8 @@ type BusinessConnection struct {
UserChatId int64 `json:"user_chat_id"` UserChatId int64 `json:"user_chat_id"`
// Point in time (Unix timestamp) when the connection was established // Point in time (Unix timestamp) when the connection was established
Date int32 `json:"date"` Date int32 `json:"date"`
// True, if the bot can send messages to the connected user; false otherwise // Rights of the bot; may be null if the connection was disabled
CanReply bool `json:"can_reply"` Rights *BusinessBotRights `json:"rights"`
// True, if the connection is enabled; false otherwise // True, if the connection is enabled; false otherwise
IsEnabled bool `json:"is_enabled"` IsEnabled bool `json:"is_enabled"`
} }
@ -42212,10 +42539,68 @@ func (*StorePaymentPurposeGiftedStars) StorePaymentPurposeType() string {
return TypeStorePaymentPurposeGiftedStars return TypeStorePaymentPurposeGiftedStars
} }
// A purchase through App Store
type StoreTransactionAppStore struct {
meta
// App Store receipt
Receipt []byte `json:"receipt"`
}
func (entity *StoreTransactionAppStore) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub StoreTransactionAppStore
return json.Marshal((*stub)(entity))
}
func (*StoreTransactionAppStore) GetClass() string {
return ClassStoreTransaction
}
func (*StoreTransactionAppStore) GetType() string {
return TypeStoreTransactionAppStore
}
func (*StoreTransactionAppStore) StoreTransactionType() string {
return TypeStoreTransactionAppStore
}
// A purchase through Google Play
type StoreTransactionGooglePlay struct {
meta
// Application package name
PackageName string `json:"package_name"`
// Identifier of the purchased store product
StoreProductId string `json:"store_product_id"`
// Google Play purchase token
PurchaseToken string `json:"purchase_token"`
}
func (entity *StoreTransactionGooglePlay) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub StoreTransactionGooglePlay
return json.Marshal((*stub)(entity))
}
func (*StoreTransactionGooglePlay) GetClass() string {
return ClassStoreTransaction
}
func (*StoreTransactionGooglePlay) GetType() string {
return TypeStoreTransactionGooglePlay
}
func (*StoreTransactionGooglePlay) StoreTransactionType() string {
return TypeStoreTransactionGooglePlay
}
// The user gifting Telegram Premium to another user // The user gifting Telegram Premium to another user
type TelegramPaymentPurposePremiumGift struct { type TelegramPaymentPurposePremiumGift struct {
meta meta
// ISO 4217 currency code of the payment currency // ISO 4217 currency code of the payment currency, or "XTR" for payments in Telegram Stars
Currency string `json:"currency"` Currency string `json:"currency"`
// Paid amount, in the smallest units of the currency // Paid amount, in the smallest units of the currency
Amount int64 `json:"amount"` Amount int64 `json:"amount"`
@ -46578,7 +46963,7 @@ type NewChatPrivacySettings struct {
meta meta
// True, if non-contacts users are able to write first to the current user. Telegram Premium subscribers are able to write first regardless of this setting // True, if non-contacts users are able to write first to the current user. Telegram Premium subscribers are able to write first regardless of this setting
AllowNewChatsFromUnknownUsers bool `json:"allow_new_chats_from_unknown_users"` AllowNewChatsFromUnknownUsers bool `json:"allow_new_chats_from_unknown_users"`
// Number of Telegram Stars that must be paid for every incoming private message by non-contacts; 0-getOption("paid_message_star_count_max"). If positive, then allow_new_chats_from_unknown_users must be true. The current user will receive getOption("paid_message_earnings_per_mille") Telegram Stars for each 1000 Telegram Stars paid for message sending // Number of Telegram Stars that must be paid for every incoming private message by non-contacts; 0-getOption("paid_message_star_count_max"). If positive, then allow_new_chats_from_unknown_users must be true. The current user will receive getOption("paid_message_earnings_per_mille") Telegram Stars for each 1000 Telegram Stars paid for message sending. Can be positive, only if getOption("can_enable_paid_messages") is true
IncomingPaidMessageStarCount int64 `json:"incoming_paid_message_star_count"` IncomingPaidMessageStarCount int64 `json:"incoming_paid_message_star_count"`
} }
@ -55269,8 +55654,6 @@ func (*UpdateQuickReplyShortcutMessages) UpdateType() string {
// Basic information about a topic in a forum chat was changed // Basic information about a topic in a forum chat was changed
type UpdateForumTopicInfo struct { type UpdateForumTopicInfo struct {
meta meta
// Chat identifier
ChatId int64 `json:"chat_id"`
// New information about the topic // New information about the topic
Info *ForumTopicInfo `json:"info"` Info *ForumTopicInfo `json:"info"`
} }
@ -55295,6 +55678,41 @@ func (*UpdateForumTopicInfo) UpdateType() string {
return TypeUpdateForumTopicInfo return TypeUpdateForumTopicInfo
} }
// Information about a topic in a forum chat was changed
type UpdateForumTopic struct {
meta
// Chat identifier
ChatId int64 `json:"chat_id"`
// Message thread identifier of the topic
MessageThreadId int64 `json:"message_thread_id"`
// True, if the topic is pinned in the topic list
IsPinned bool `json:"is_pinned"`
// Identifier of the last read outgoing message
LastReadOutboxMessageId int64 `json:"last_read_outbox_message_id"`
// Notification settings for the topic
NotificationSettings *ChatNotificationSettings `json:"notification_settings"`
}
func (entity *UpdateForumTopic) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub UpdateForumTopic
return json.Marshal((*stub)(entity))
}
func (*UpdateForumTopic) GetClass() string {
return ClassUpdate
}
func (*UpdateForumTopic) GetType() string {
return TypeUpdateForumTopic
}
func (*UpdateForumTopic) UpdateType() string {
return TypeUpdateForumTopic
}
// Notification settings for some type of chats were updated // Notification settings for some type of chats were updated
type UpdateScopeNotificationSettings struct { type UpdateScopeNotificationSettings struct {
meta meta
@ -57166,6 +57584,39 @@ func (updateConnectionState *UpdateConnectionState) UnmarshalJSON(data []byte) e
return nil return nil
} }
// The freeze state of the current user's account has changed
type UpdateFreezeState struct {
meta
// True, if the account is frozen
IsFrozen bool `json:"is_frozen"`
// Point in time (Unix timestamp) when the account was frozen; 0 if the account isn't frozen
FreezingDate int32 `json:"freezing_date"`
// Point in time (Unix timestamp) when the account will be deleted and can't be unfrozen; 0 if the account isn't frozen
DeletionDate int32 `json:"deletion_date"`
// The link to open to send an appeal to unfreeze the account
AppealLink string `json:"appeal_link"`
}
func (entity *UpdateFreezeState) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub UpdateFreezeState
return json.Marshal((*stub)(entity))
}
func (*UpdateFreezeState) GetClass() string {
return ClassUpdate
}
func (*UpdateFreezeState) GetType() string {
return TypeUpdateFreezeState
}
func (*UpdateFreezeState) UpdateType() string {
return TypeUpdateFreezeState
}
// New terms of service must be accepted by the user. If the terms of service are declined, then the deleteAccount method must be called with the reason "Decline ToS update" // New terms of service must be accepted by the user. If the terms of service are declined, then the deleteAccount method must be called with the reason "Decline ToS update"
type UpdateTermsOfService struct { type UpdateTermsOfService struct {
meta meta

View file

@ -151,6 +151,9 @@ func UnmarshalAuthorizationState(data json.RawMessage) (AuthorizationState, erro
case TypeAuthorizationStateWaitPhoneNumber: case TypeAuthorizationStateWaitPhoneNumber:
return UnmarshalAuthorizationStateWaitPhoneNumber(data) return UnmarshalAuthorizationStateWaitPhoneNumber(data)
case TypeAuthorizationStateWaitPremiumPurchase:
return UnmarshalAuthorizationStateWaitPremiumPurchase(data)
case TypeAuthorizationStateWaitEmailAddress: case TypeAuthorizationStateWaitEmailAddress:
return UnmarshalAuthorizationStateWaitEmailAddress(data) return UnmarshalAuthorizationStateWaitEmailAddress(data)
@ -931,6 +934,12 @@ func UnmarshalStarTransactionType(data json.RawMessage) (StarTransactionType, er
case TypeStarTransactionTypePremiumPurchase: case TypeStarTransactionTypePremiumPurchase:
return UnmarshalStarTransactionTypePremiumPurchase(data) return UnmarshalStarTransactionTypePremiumPurchase(data)
case TypeStarTransactionTypeBusinessBotTransferSend:
return UnmarshalStarTransactionTypeBusinessBotTransferSend(data)
case TypeStarTransactionTypeBusinessBotTransferReceive:
return UnmarshalStarTransactionTypeBusinessBotTransferReceive(data)
case TypeStarTransactionTypeUnsupported: case TypeStarTransactionTypeUnsupported:
return UnmarshalStarTransactionTypeUnsupported(data) return UnmarshalStarTransactionTypeUnsupported(data)
@ -1707,7 +1716,7 @@ func UnmarshalListOfMessageSource(dataList []json.RawMessage) ([]MessageSource,
return list, nil return list, nil
} }
func UnmarshalReportChatSponsoredMessageResult(data json.RawMessage) (ReportChatSponsoredMessageResult, error) { func UnmarshalReportSponsoredResult(data json.RawMessage) (ReportSponsoredResult, error) {
var meta meta var meta meta
err := json.Unmarshal(data, &meta) err := json.Unmarshal(data, &meta)
@ -1716,31 +1725,31 @@ func UnmarshalReportChatSponsoredMessageResult(data json.RawMessage) (ReportChat
} }
switch meta.Type { switch meta.Type {
case TypeReportChatSponsoredMessageResultOk: case TypeReportSponsoredResultOk:
return UnmarshalReportChatSponsoredMessageResultOk(data) return UnmarshalReportSponsoredResultOk(data)
case TypeReportChatSponsoredMessageResultFailed: case TypeReportSponsoredResultFailed:
return UnmarshalReportChatSponsoredMessageResultFailed(data) return UnmarshalReportSponsoredResultFailed(data)
case TypeReportChatSponsoredMessageResultOptionRequired: case TypeReportSponsoredResultOptionRequired:
return UnmarshalReportChatSponsoredMessageResultOptionRequired(data) return UnmarshalReportSponsoredResultOptionRequired(data)
case TypeReportChatSponsoredMessageResultAdsHidden: case TypeReportSponsoredResultAdsHidden:
return UnmarshalReportChatSponsoredMessageResultAdsHidden(data) return UnmarshalReportSponsoredResultAdsHidden(data)
case TypeReportChatSponsoredMessageResultPremiumRequired: case TypeReportSponsoredResultPremiumRequired:
return UnmarshalReportChatSponsoredMessageResultPremiumRequired(data) return UnmarshalReportSponsoredResultPremiumRequired(data)
default: default:
return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type)
} }
} }
func UnmarshalListOfReportChatSponsoredMessageResult(dataList []json.RawMessage) ([]ReportChatSponsoredMessageResult, error) { func UnmarshalListOfReportSponsoredResult(dataList []json.RawMessage) ([]ReportSponsoredResult, error) {
list := []ReportChatSponsoredMessageResult{} list := []ReportSponsoredResult{}
for _, data := range dataList { for _, data := range dataList {
entity, err := UnmarshalReportChatSponsoredMessageResult(data) entity, err := UnmarshalReportSponsoredResult(data)
if err != nil { if err != nil {
return nil, err return nil, err
} }
@ -3507,6 +3516,12 @@ func UnmarshalMessageContent(data json.RawMessage) (MessageContent, error) {
case TypeMessageRefundedUpgradedGift: case TypeMessageRefundedUpgradedGift:
return UnmarshalMessageRefundedUpgradedGift(data) return UnmarshalMessageRefundedUpgradedGift(data)
case TypeMessagePaidMessagesRefunded:
return UnmarshalMessagePaidMessagesRefunded(data)
case TypeMessagePaidMessagePriceChanged:
return UnmarshalMessagePaidMessagePriceChanged(data)
case TypeMessageContactRegistered: case TypeMessageContactRegistered:
return UnmarshalMessageContactRegistered(data) return UnmarshalMessageContactRegistered(data)
@ -5772,6 +5787,40 @@ func UnmarshalListOfStorePaymentPurpose(dataList []json.RawMessage) ([]StorePaym
return list, nil return list, nil
} }
func UnmarshalStoreTransaction(data json.RawMessage) (StoreTransaction, error) {
var meta meta
err := json.Unmarshal(data, &meta)
if err != nil {
return nil, err
}
switch meta.Type {
case TypeStoreTransactionAppStore:
return UnmarshalStoreTransactionAppStore(data)
case TypeStoreTransactionGooglePlay:
return UnmarshalStoreTransactionGooglePlay(data)
default:
return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type)
}
}
func UnmarshalListOfStoreTransaction(dataList []json.RawMessage) ([]StoreTransaction, error) {
list := []StoreTransaction{}
for _, data := range dataList {
entity, err := UnmarshalStoreTransaction(data)
if err != nil {
return nil, err
}
list = append(list, entity)
}
return list, nil
}
func UnmarshalTelegramPaymentPurpose(data json.RawMessage) (TelegramPaymentPurpose, error) { func UnmarshalTelegramPaymentPurpose(data json.RawMessage) (TelegramPaymentPurpose, error) {
var meta meta var meta meta
@ -8153,6 +8202,9 @@ func UnmarshalUpdate(data json.RawMessage) (Update, error) {
case TypeUpdateForumTopicInfo: case TypeUpdateForumTopicInfo:
return UnmarshalUpdateForumTopicInfo(data) return UnmarshalUpdateForumTopicInfo(data)
case TypeUpdateForumTopic:
return UnmarshalUpdateForumTopic(data)
case TypeUpdateScopeNotificationSettings: case TypeUpdateScopeNotificationSettings:
return UnmarshalUpdateScopeNotificationSettings(data) return UnmarshalUpdateScopeNotificationSettings(data)
@ -8315,6 +8367,9 @@ func UnmarshalUpdate(data json.RawMessage) (Update, error) {
case TypeUpdateConnectionState: case TypeUpdateConnectionState:
return UnmarshalUpdateConnectionState(data) return UnmarshalUpdateConnectionState(data)
case TypeUpdateFreezeState:
return UnmarshalUpdateFreezeState(data)
case TypeUpdateTermsOfService: case TypeUpdateTermsOfService:
return UnmarshalUpdateTermsOfService(data) return UnmarshalUpdateTermsOfService(data)
@ -8697,6 +8752,14 @@ func UnmarshalAuthorizationStateWaitPhoneNumber(data json.RawMessage) (*Authoriz
return &resp, err return &resp, err
} }
func UnmarshalAuthorizationStateWaitPremiumPurchase(data json.RawMessage) (*AuthorizationStateWaitPremiumPurchase, error) {
var resp AuthorizationStateWaitPremiumPurchase
err := json.Unmarshal(data, &resp)
return &resp, err
}
func UnmarshalAuthorizationStateWaitEmailAddress(data json.RawMessage) (*AuthorizationStateWaitEmailAddress, error) { func UnmarshalAuthorizationStateWaitEmailAddress(data json.RawMessage) (*AuthorizationStateWaitEmailAddress, error) {
var resp AuthorizationStateWaitEmailAddress var resp AuthorizationStateWaitEmailAddress
@ -9433,6 +9496,14 @@ func UnmarshalBusinessGreetingMessageSettings(data json.RawMessage) (*BusinessGr
return &resp, err return &resp, err
} }
func UnmarshalBusinessBotRights(data json.RawMessage) (*BusinessBotRights, error) {
var resp BusinessBotRights
err := json.Unmarshal(data, &resp)
return &resp, err
}
func UnmarshalBusinessConnectedBot(data json.RawMessage) (*BusinessConnectedBot, error) { func UnmarshalBusinessConnectedBot(data json.RawMessage) (*BusinessConnectedBot, error) {
var resp BusinessConnectedBot var resp BusinessConnectedBot
@ -9865,6 +9936,22 @@ func UnmarshalStarGiveawayPaymentOptions(data json.RawMessage) (*StarGiveawayPay
return &resp, err return &resp, err
} }
func UnmarshalAcceptedGiftTypes(data json.RawMessage) (*AcceptedGiftTypes, error) {
var resp AcceptedGiftTypes
err := json.Unmarshal(data, &resp)
return &resp, err
}
func UnmarshalGiftSettings(data json.RawMessage) (*GiftSettings, error) {
var resp GiftSettings
err := json.Unmarshal(data, &resp)
return &resp, err
}
func UnmarshalUpgradedGiftModel(data json.RawMessage) (*UpgradedGiftModel, error) { func UnmarshalUpgradedGiftModel(data json.RawMessage) (*UpgradedGiftModel, error) {
var resp UpgradedGiftModel var resp UpgradedGiftModel
@ -10225,6 +10312,22 @@ func UnmarshalStarTransactionTypePremiumPurchase(data json.RawMessage) (*StarTra
return &resp, err return &resp, err
} }
func UnmarshalStarTransactionTypeBusinessBotTransferSend(data json.RawMessage) (*StarTransactionTypeBusinessBotTransferSend, error) {
var resp StarTransactionTypeBusinessBotTransferSend
err := json.Unmarshal(data, &resp)
return &resp, err
}
func UnmarshalStarTransactionTypeBusinessBotTransferReceive(data json.RawMessage) (*StarTransactionTypeBusinessBotTransferReceive, error) {
var resp StarTransactionTypeBusinessBotTransferReceive
err := json.Unmarshal(data, &resp)
return &resp, err
}
func UnmarshalStarTransactionTypeUnsupported(data json.RawMessage) (*StarTransactionTypeUnsupported, error) { func UnmarshalStarTransactionTypeUnsupported(data json.RawMessage) (*StarTransactionTypeUnsupported, error) {
var resp StarTransactionTypeUnsupported var resp StarTransactionTypeUnsupported
@ -11345,6 +11448,22 @@ func UnmarshalSponsoredMessages(data json.RawMessage) (*SponsoredMessages, error
return &resp, err return &resp, err
} }
func UnmarshalSponsoredChat(data json.RawMessage) (*SponsoredChat, error) {
var resp SponsoredChat
err := json.Unmarshal(data, &resp)
return &resp, err
}
func UnmarshalSponsoredChats(data json.RawMessage) (*SponsoredChats, error) {
var resp SponsoredChats
err := json.Unmarshal(data, &resp)
return &resp, err
}
func UnmarshalReportOption(data json.RawMessage) (*ReportOption, error) { func UnmarshalReportOption(data json.RawMessage) (*ReportOption, error) {
var resp ReportOption var resp ReportOption
@ -11353,40 +11472,40 @@ func UnmarshalReportOption(data json.RawMessage) (*ReportOption, error) {
return &resp, err return &resp, err
} }
func UnmarshalReportChatSponsoredMessageResultOk(data json.RawMessage) (*ReportChatSponsoredMessageResultOk, error) { func UnmarshalReportSponsoredResultOk(data json.RawMessage) (*ReportSponsoredResultOk, error) {
var resp ReportChatSponsoredMessageResultOk var resp ReportSponsoredResultOk
err := json.Unmarshal(data, &resp) err := json.Unmarshal(data, &resp)
return &resp, err return &resp, err
} }
func UnmarshalReportChatSponsoredMessageResultFailed(data json.RawMessage) (*ReportChatSponsoredMessageResultFailed, error) { func UnmarshalReportSponsoredResultFailed(data json.RawMessage) (*ReportSponsoredResultFailed, error) {
var resp ReportChatSponsoredMessageResultFailed var resp ReportSponsoredResultFailed
err := json.Unmarshal(data, &resp) err := json.Unmarshal(data, &resp)
return &resp, err return &resp, err
} }
func UnmarshalReportChatSponsoredMessageResultOptionRequired(data json.RawMessage) (*ReportChatSponsoredMessageResultOptionRequired, error) { func UnmarshalReportSponsoredResultOptionRequired(data json.RawMessage) (*ReportSponsoredResultOptionRequired, error) {
var resp ReportChatSponsoredMessageResultOptionRequired var resp ReportSponsoredResultOptionRequired
err := json.Unmarshal(data, &resp) err := json.Unmarshal(data, &resp)
return &resp, err return &resp, err
} }
func UnmarshalReportChatSponsoredMessageResultAdsHidden(data json.RawMessage) (*ReportChatSponsoredMessageResultAdsHidden, error) { func UnmarshalReportSponsoredResultAdsHidden(data json.RawMessage) (*ReportSponsoredResultAdsHidden, error) {
var resp ReportChatSponsoredMessageResultAdsHidden var resp ReportSponsoredResultAdsHidden
err := json.Unmarshal(data, &resp) err := json.Unmarshal(data, &resp)
return &resp, err return &resp, err
} }
func UnmarshalReportChatSponsoredMessageResultPremiumRequired(data json.RawMessage) (*ReportChatSponsoredMessageResultPremiumRequired, error) { func UnmarshalReportSponsoredResultPremiumRequired(data json.RawMessage) (*ReportSponsoredResultPremiumRequired, error) {
var resp ReportChatSponsoredMessageResultPremiumRequired var resp ReportSponsoredResultPremiumRequired
err := json.Unmarshal(data, &resp) err := json.Unmarshal(data, &resp)
@ -14361,6 +14480,22 @@ func UnmarshalMessageRefundedUpgradedGift(data json.RawMessage) (*MessageRefunde
return &resp, err return &resp, err
} }
func UnmarshalMessagePaidMessagesRefunded(data json.RawMessage) (*MessagePaidMessagesRefunded, error) {
var resp MessagePaidMessagesRefunded
err := json.Unmarshal(data, &resp)
return &resp, err
}
func UnmarshalMessagePaidMessagePriceChanged(data json.RawMessage) (*MessagePaidMessagePriceChanged, error) {
var resp MessagePaidMessagePriceChanged
err := json.Unmarshal(data, &resp)
return &resp, err
}
func UnmarshalMessageContactRegistered(data json.RawMessage) (*MessageContactRegistered, error) { func UnmarshalMessageContactRegistered(data json.RawMessage) (*MessageContactRegistered, error) {
var resp MessageContactRegistered var resp MessageContactRegistered
@ -17825,6 +17960,22 @@ func UnmarshalStorePaymentPurposeGiftedStars(data json.RawMessage) (*StorePaymen
return &resp, err return &resp, err
} }
func UnmarshalStoreTransactionAppStore(data json.RawMessage) (*StoreTransactionAppStore, error) {
var resp StoreTransactionAppStore
err := json.Unmarshal(data, &resp)
return &resp, err
}
func UnmarshalStoreTransactionGooglePlay(data json.RawMessage) (*StoreTransactionGooglePlay, error) {
var resp StoreTransactionGooglePlay
err := json.Unmarshal(data, &resp)
return &resp, err
}
func UnmarshalTelegramPaymentPurposePremiumGift(data json.RawMessage) (*TelegramPaymentPurposePremiumGift, error) { func UnmarshalTelegramPaymentPurposePremiumGift(data json.RawMessage) (*TelegramPaymentPurposePremiumGift, error) {
var resp TelegramPaymentPurposePremiumGift var resp TelegramPaymentPurposePremiumGift
@ -21377,6 +21528,14 @@ func UnmarshalUpdateForumTopicInfo(data json.RawMessage) (*UpdateForumTopicInfo,
return &resp, err return &resp, err
} }
func UnmarshalUpdateForumTopic(data json.RawMessage) (*UpdateForumTopic, error) {
var resp UpdateForumTopic
err := json.Unmarshal(data, &resp)
return &resp, err
}
func UnmarshalUpdateScopeNotificationSettings(data json.RawMessage) (*UpdateScopeNotificationSettings, error) { func UnmarshalUpdateScopeNotificationSettings(data json.RawMessage) (*UpdateScopeNotificationSettings, error) {
var resp UpdateScopeNotificationSettings var resp UpdateScopeNotificationSettings
@ -21809,6 +21968,14 @@ func UnmarshalUpdateConnectionState(data json.RawMessage) (*UpdateConnectionStat
return &resp, err return &resp, err
} }
func UnmarshalUpdateFreezeState(data json.RawMessage) (*UpdateFreezeState, error) {
var resp UpdateFreezeState
err := json.Unmarshal(data, &resp)
return &resp, err
}
func UnmarshalUpdateTermsOfService(data json.RawMessage) (*UpdateTermsOfService, error) { func UnmarshalUpdateTermsOfService(data json.RawMessage) (*UpdateTermsOfService, error) {
var resp UpdateTermsOfService var resp UpdateTermsOfService
@ -22341,6 +22508,9 @@ func UnmarshalType(data json.RawMessage) (Type, error) {
case TypeAuthorizationStateWaitPhoneNumber: case TypeAuthorizationStateWaitPhoneNumber:
return UnmarshalAuthorizationStateWaitPhoneNumber(data) return UnmarshalAuthorizationStateWaitPhoneNumber(data)
case TypeAuthorizationStateWaitPremiumPurchase:
return UnmarshalAuthorizationStateWaitPremiumPurchase(data)
case TypeAuthorizationStateWaitEmailAddress: case TypeAuthorizationStateWaitEmailAddress:
return UnmarshalAuthorizationStateWaitEmailAddress(data) return UnmarshalAuthorizationStateWaitEmailAddress(data)
@ -22617,6 +22787,9 @@ func UnmarshalType(data json.RawMessage) (Type, error) {
case TypeBusinessGreetingMessageSettings: case TypeBusinessGreetingMessageSettings:
return UnmarshalBusinessGreetingMessageSettings(data) return UnmarshalBusinessGreetingMessageSettings(data)
case TypeBusinessBotRights:
return UnmarshalBusinessBotRights(data)
case TypeBusinessConnectedBot: case TypeBusinessConnectedBot:
return UnmarshalBusinessConnectedBot(data) return UnmarshalBusinessConnectedBot(data)
@ -22779,6 +22952,12 @@ func UnmarshalType(data json.RawMessage) (Type, error) {
case TypeStarGiveawayPaymentOptions: case TypeStarGiveawayPaymentOptions:
return UnmarshalStarGiveawayPaymentOptions(data) return UnmarshalStarGiveawayPaymentOptions(data)
case TypeAcceptedGiftTypes:
return UnmarshalAcceptedGiftTypes(data)
case TypeGiftSettings:
return UnmarshalGiftSettings(data)
case TypeUpgradedGiftModel: case TypeUpgradedGiftModel:
return UnmarshalUpgradedGiftModel(data) return UnmarshalUpgradedGiftModel(data)
@ -22914,6 +23093,12 @@ func UnmarshalType(data json.RawMessage) (Type, error) {
case TypeStarTransactionTypePremiumPurchase: case TypeStarTransactionTypePremiumPurchase:
return UnmarshalStarTransactionTypePremiumPurchase(data) return UnmarshalStarTransactionTypePremiumPurchase(data)
case TypeStarTransactionTypeBusinessBotTransferSend:
return UnmarshalStarTransactionTypeBusinessBotTransferSend(data)
case TypeStarTransactionTypeBusinessBotTransferReceive:
return UnmarshalStarTransactionTypeBusinessBotTransferReceive(data)
case TypeStarTransactionTypeUnsupported: case TypeStarTransactionTypeUnsupported:
return UnmarshalStarTransactionTypeUnsupported(data) return UnmarshalStarTransactionTypeUnsupported(data)
@ -23334,23 +23519,29 @@ func UnmarshalType(data json.RawMessage) (Type, error) {
case TypeSponsoredMessages: case TypeSponsoredMessages:
return UnmarshalSponsoredMessages(data) return UnmarshalSponsoredMessages(data)
case TypeSponsoredChat:
return UnmarshalSponsoredChat(data)
case TypeSponsoredChats:
return UnmarshalSponsoredChats(data)
case TypeReportOption: case TypeReportOption:
return UnmarshalReportOption(data) return UnmarshalReportOption(data)
case TypeReportChatSponsoredMessageResultOk: case TypeReportSponsoredResultOk:
return UnmarshalReportChatSponsoredMessageResultOk(data) return UnmarshalReportSponsoredResultOk(data)
case TypeReportChatSponsoredMessageResultFailed: case TypeReportSponsoredResultFailed:
return UnmarshalReportChatSponsoredMessageResultFailed(data) return UnmarshalReportSponsoredResultFailed(data)
case TypeReportChatSponsoredMessageResultOptionRequired: case TypeReportSponsoredResultOptionRequired:
return UnmarshalReportChatSponsoredMessageResultOptionRequired(data) return UnmarshalReportSponsoredResultOptionRequired(data)
case TypeReportChatSponsoredMessageResultAdsHidden: case TypeReportSponsoredResultAdsHidden:
return UnmarshalReportChatSponsoredMessageResultAdsHidden(data) return UnmarshalReportSponsoredResultAdsHidden(data)
case TypeReportChatSponsoredMessageResultPremiumRequired: case TypeReportSponsoredResultPremiumRequired:
return UnmarshalReportChatSponsoredMessageResultPremiumRequired(data) return UnmarshalReportSponsoredResultPremiumRequired(data)
case TypeFileDownload: case TypeFileDownload:
return UnmarshalFileDownload(data) return UnmarshalFileDownload(data)
@ -24465,6 +24656,12 @@ func UnmarshalType(data json.RawMessage) (Type, error) {
case TypeMessageRefundedUpgradedGift: case TypeMessageRefundedUpgradedGift:
return UnmarshalMessageRefundedUpgradedGift(data) return UnmarshalMessageRefundedUpgradedGift(data)
case TypeMessagePaidMessagesRefunded:
return UnmarshalMessagePaidMessagesRefunded(data)
case TypeMessagePaidMessagePriceChanged:
return UnmarshalMessagePaidMessagePriceChanged(data)
case TypeMessageContactRegistered: case TypeMessageContactRegistered:
return UnmarshalMessageContactRegistered(data) return UnmarshalMessageContactRegistered(data)
@ -25764,6 +25961,12 @@ func UnmarshalType(data json.RawMessage) (Type, error) {
case TypeStorePaymentPurposeGiftedStars: case TypeStorePaymentPurposeGiftedStars:
return UnmarshalStorePaymentPurposeGiftedStars(data) return UnmarshalStorePaymentPurposeGiftedStars(data)
case TypeStoreTransactionAppStore:
return UnmarshalStoreTransactionAppStore(data)
case TypeStoreTransactionGooglePlay:
return UnmarshalStoreTransactionGooglePlay(data)
case TypeTelegramPaymentPurposePremiumGift: case TypeTelegramPaymentPurposePremiumGift:
return UnmarshalTelegramPaymentPurposePremiumGift(data) return UnmarshalTelegramPaymentPurposePremiumGift(data)
@ -27096,6 +27299,9 @@ func UnmarshalType(data json.RawMessage) (Type, error) {
case TypeUpdateForumTopicInfo: case TypeUpdateForumTopicInfo:
return UnmarshalUpdateForumTopicInfo(data) return UnmarshalUpdateForumTopicInfo(data)
case TypeUpdateForumTopic:
return UnmarshalUpdateForumTopic(data)
case TypeUpdateScopeNotificationSettings: case TypeUpdateScopeNotificationSettings:
return UnmarshalUpdateScopeNotificationSettings(data) return UnmarshalUpdateScopeNotificationSettings(data)
@ -27258,6 +27464,9 @@ func UnmarshalType(data json.RawMessage) (Type, error) {
case TypeUpdateConnectionState: case TypeUpdateConnectionState:
return UnmarshalUpdateConnectionState(data) return UnmarshalUpdateConnectionState(data)
case TypeUpdateFreezeState:
return UnmarshalUpdateFreezeState(data)
case TypeUpdateTermsOfService: case TypeUpdateTermsOfService:
return UnmarshalUpdateTermsOfService(data) return UnmarshalUpdateTermsOfService(data)

View file

@ -129,6 +129,10 @@ authorizationStateWaitTdlibParameters = AuthorizationState;
//@description TDLib needs the user's phone number to authorize. Call setAuthenticationPhoneNumber to provide the phone number, or use requestQrCodeAuthentication or checkAuthenticationBotToken for other authentication options //@description TDLib needs the user's phone number to authorize. Call setAuthenticationPhoneNumber to provide the phone number, or use requestQrCodeAuthentication or checkAuthenticationBotToken for other authentication options
authorizationStateWaitPhoneNumber = AuthorizationState; authorizationStateWaitPhoneNumber = AuthorizationState;
//@description The user must buy Telegram Premium as an in-store purchase to log in. Call checkAuthenticationPremiumPurchase and then setAuthenticationPremiumPurchaseTransaction
//@store_product_id Identifier of the store product that must be bought
authorizationStateWaitPremiumPurchase store_product_id:string = AuthorizationState;
//@description TDLib needs the user's email address to authorize. Call setAuthenticationEmailAddress to provide the email address, or directly call checkAuthenticationEmailCode with Apple ID/Google ID token if allowed //@description TDLib needs the user's email address to authorize. Call setAuthenticationEmailAddress to provide the email address, or directly call checkAuthenticationEmailCode with Apple ID/Google ID token if allowed
//@allow_apple_id True, if authorization through Apple ID is allowed //@allow_apple_id True, if authorization through Apple ID is allowed
//@allow_google_id True, if authorization through Google ID is allowed //@allow_google_id True, if authorization through Google ID is allowed
@ -681,11 +685,28 @@ businessAwayMessageSettings shortcut_id:int32 recipients:businessRecipients sche
//@inactivity_days The number of days after which a chat will be considered as inactive; currently, must be on of 7, 14, 21, or 28 //@inactivity_days The number of days after which a chat will be considered as inactive; currently, must be on of 7, 14, 21, or 28
businessGreetingMessageSettings shortcut_id:int32 recipients:businessRecipients inactivity_days:int32 = BusinessGreetingMessageSettings; businessGreetingMessageSettings shortcut_id:int32 recipients:businessRecipients inactivity_days:int32 = BusinessGreetingMessageSettings;
//@description Describes rights of a business bot
//@can_reply True, if the bot can send and edit messages in the private chats that had incoming messages in the last 24 hours
//@can_read_messages True, if the bot can mark incoming private messages as read
//@can_delete_sent_messages True, if the bot can delete sent messages
//@can_delete_all_messages True, if the bot can delete any message
//@can_edit_name True, if the bot can edit name of the business account
//@can_edit_bio True, if the bot can edit bio of the business account
//@can_edit_profile_photo True, if the bot can edit profile photo of the business account
//@can_edit_username True, if the bot can edit username of the business account
//@can_view_gifts_and_stars True, if the bot can view gifts and amount of Telegram Stars owned by the business account
//@can_sell_gifts True, if the bot can sell regular gifts received by the business account
//@can_change_gift_settings True, if the bot can change gift receiving settings of the business account
//@can_transfer_and_upgrade_gifts True, if the bot can transfer and upgrade gifts received by the business account
//@can_transfer_stars True, if the bot can transfer Telegram Stars received by the business account to account of the bot, or use them to upgrade and transfer gifts
//@can_manage_stories True, if the bot can send, edit and delete stories
businessBotRights can_reply:Bool can_read_messages:Bool can_delete_sent_messages:Bool can_delete_all_messages:Bool can_edit_name:Bool can_edit_bio:Bool can_edit_profile_photo:Bool can_edit_username:Bool can_view_gifts_and_stars:Bool can_sell_gifts:Bool can_change_gift_settings:Bool can_transfer_and_upgrade_gifts:Bool can_transfer_stars:Bool can_manage_stories:Bool = BusinessBotRights;
//@description Describes a bot connected to a business account //@description Describes a bot connected to a business account
//@bot_user_id User identifier of the bot //@bot_user_id User identifier of the bot
//@recipients Private chats that will be accessible to the bot //@recipients Private chats that will be accessible to the bot
//@can_reply True, if the bot can send messages to the private chats; false otherwise //@rights Rights of the bot
businessConnectedBot bot_user_id:int53 recipients:businessRecipients can_reply:Bool = BusinessConnectedBot; businessConnectedBot bot_user_id:int53 recipients:businessRecipients rights:businessBotRights = BusinessConnectedBot;
//@description Describes settings for a business account start page //@description Describes settings for a business account start page
//@title Title text of the start page //@title Title text of the start page
@ -1040,16 +1061,28 @@ starGiveawayPaymentOption currency:string amount:int53 star_count:int53 store_pr
starGiveawayPaymentOptions options:vector<starGiveawayPaymentOption> = StarGiveawayPaymentOptions; starGiveawayPaymentOptions options:vector<starGiveawayPaymentOption> = StarGiveawayPaymentOptions;
//@description Describes gift types that are accepted by a user
//@unlimited_gifts True, if unlimited regular gifts are accepted
//@limited_gifts True, if limited regular gifts are accepted
//@upgraded_gifts True, if upgraded gifts and regular gifts that can be upgraded for free are accepted
//@premium_subscription True, if Telegram Premium subscription is accepted
acceptedGiftTypes unlimited_gifts:Bool limited_gifts:Bool upgraded_gifts:Bool premium_subscription:Bool = AcceptedGiftTypes;
//@description Contains settings for gift receiving for a user
//@show_gift_button True, if a button for sending a gift to the user or by the user must always be shown in the input field
//@accepted_gift_types Types of gifts accepted by the user; for Telegram Premium users only
giftSettings show_gift_button:Bool accepted_gift_types:acceptedGiftTypes = GiftSettings;
//@description Describes a model of an upgraded gift //@description Describes a model of an upgraded gift
//@name Name of the model //@name Name of the model
//@sticker The sticker representing the upgraded gift //@sticker The sticker representing the upgraded gift
//@rarity_per_mille The number of upgraded gift that receive this model for each 1000 gifts upgraded //@rarity_per_mille The number of upgraded gifts that receive this model for each 1000 gifts upgraded
upgradedGiftModel name:string sticker:sticker rarity_per_mille:int32 = UpgradedGiftModel; upgradedGiftModel name:string sticker:sticker rarity_per_mille:int32 = UpgradedGiftModel;
//@description Describes a symbol shown on the pattern of an upgraded gift //@description Describes a symbol shown on the pattern of an upgraded gift
//@name Name of the symbol //@name Name of the symbol
//@sticker The sticker representing the upgraded gift //@sticker The sticker representing the symbol
//@rarity_per_mille The number of upgraded gift that receive this symbol for each 1000 gifts upgraded //@rarity_per_mille The number of upgraded gifts that receive this symbol for each 1000 gifts upgraded
upgradedGiftSymbol name:string sticker:sticker rarity_per_mille:int32 = UpgradedGiftSymbol; upgradedGiftSymbol name:string sticker:sticker rarity_per_mille:int32 = UpgradedGiftSymbol;
//@description Describes colors of a backdrop of an upgraded gift //@description Describes colors of a backdrop of an upgraded gift
@ -1062,7 +1095,7 @@ upgradedGiftBackdropColors center_color:int32 edge_color:int32 symbol_color:int3
//@description Describes a backdrop of an upgraded gift //@description Describes a backdrop of an upgraded gift
//@name Name of the backdrop //@name Name of the backdrop
//@colors Colors of the backdrop //@colors Colors of the backdrop
//@rarity_per_mille The number of upgraded gift that receive this backdrop for each 1000 gifts upgraded //@rarity_per_mille The number of upgraded gifts that receive this backdrop for each 1000 gifts upgraded
upgradedGiftBackdrop name:string colors:upgradedGiftBackdropColors rarity_per_mille:int32 = UpgradedGiftBackdrop; upgradedGiftBackdrop name:string colors:upgradedGiftBackdropColors rarity_per_mille:int32 = UpgradedGiftBackdrop;
//@description Describes the original details about the gift //@description Describes the original details about the gift
@ -1096,9 +1129,9 @@ gifts gifts:vector<gift> = Gifts;
//@total_upgraded_count Total number of gifts that were upgraded from the same gift //@total_upgraded_count Total number of gifts that were upgraded from the same gift
//@max_upgraded_count The maximum number of gifts that can be upgraded from the same gift //@max_upgraded_count The maximum number of gifts that can be upgraded from the same gift
//@owner_id Identifier of the user or the chat that owns the upgraded gift; may be null if none or unknown //@owner_id Identifier of the user or the chat that owns the upgraded gift; may be null if none or unknown
//@owner_address Address of the gift NFT owner in TON blockchain; may be empty if none //@owner_address Address of the gift NFT owner in TON blockchain; may be empty if none. Append the address to getOption("ton_blockchain_explorer_url") to get a link with information about the address
//@owner_name Name of the owner for the case when owner identifier and address aren't known //@owner_name Name of the owner for the case when owner identifier and address aren't known
//@gift_address Address of the gift NFT in TON blockchain; may be empty if none //@gift_address Address of the gift NFT in TON blockchain; may be empty if none. Append the address to getOption("ton_blockchain_explorer_url") to get a link with information about the address
//@model Model of the upgraded gift //@model Model of the upgraded gift
//@symbol Symbol of the upgraded gift //@symbol Symbol of the upgraded gift
//@backdrop Backdrop of the upgraded gift //@backdrop Backdrop of the upgraded gift
@ -1296,12 +1329,18 @@ starTransactionTypePaidMessageSend chat_id:int53 message_count:int32 = StarTrans
//@commission_star_amount The amount of Telegram Stars that were received by Telegram; can be negative for refunds //@commission_star_amount The amount of Telegram Stars that were received by Telegram; can be negative for refunds
starTransactionTypePaidMessageReceive sender_id:MessageSender message_count:int32 commission_per_mille:int32 commission_star_amount:starAmount = StarTransactionType; starTransactionTypePaidMessageReceive sender_id:MessageSender message_count:int32 commission_per_mille:int32 commission_star_amount:starAmount = StarTransactionType;
//@description The transaction is a purchase of Telegram Premium subscription; for regular users only //@description The transaction is a purchase of Telegram Premium subscription; for regular users and bots only
//@user_id Identifier of the user that received the Telegram Premium subscription //@user_id Identifier of the user that received the Telegram Premium subscription
//@month_count Number of months the Telegram Premium subscription will be active //@month_count Number of months the Telegram Premium subscription will be active
//@sticker A sticker to be shown in the transaction information; may be null if unknown //@sticker A sticker to be shown in the transaction information; may be null if unknown
starTransactionTypePremiumPurchase user_id:int53 month_count:int32 sticker:sticker = StarTransactionType; starTransactionTypePremiumPurchase user_id:int53 month_count:int32 sticker:sticker = StarTransactionType;
//@description The transaction is a transfer of Telegram Stars to a business bot; for regular users only @user_id Identifier of the bot that received Telegram Stars
starTransactionTypeBusinessBotTransferSend user_id:int53 = StarTransactionType;
//@description The transaction is a transfer of Telegram Stars from a business account; for bots only @user_id Identifier of the user that sent Telegram Stars
starTransactionTypeBusinessBotTransferReceive user_id:int53 = StarTransactionType;
//@description The transaction is a transaction of an unsupported type //@description The transaction is a transaction of an unsupported type
starTransactionTypeUnsupported = StarTransactionType; starTransactionTypeUnsupported = StarTransactionType;
@ -1507,10 +1546,11 @@ botInfo short_description:string description:string photo:photo animation:animat
//@group_in_common_count Number of group chats where both the other user and the current user are a member; 0 for the current user //@group_in_common_count Number of group chats where both the other user and the current user are a member; 0 for the current user
//@incoming_paid_message_star_count Number of Telegram Stars that must be paid by the user for each sent message to the current user //@incoming_paid_message_star_count Number of Telegram Stars that must be paid by the user for each sent message to the current user
//@outgoing_paid_message_star_count Number of Telegram Stars that must be paid by the current user for each sent message to the user //@outgoing_paid_message_star_count Number of Telegram Stars that must be paid by the current user for each sent message to the user
//@gift_settings Settings for gift receiving for the user
//@bot_verification Information about verification status of the user provided by a bot; may be null if none or unknown //@bot_verification Information about verification status of the user provided by a bot; may be null if none or unknown
//@business_info Information about business settings for Telegram Business accounts; may be null if none //@business_info Information about business settings for Telegram Business accounts; may be null if none
//@bot_info For bots, information about the bot; may be null if the user isn't a bot //@bot_info For bots, information about the bot; may be null if the user isn't a bot
userFullInfo personal_photo:chatPhoto photo:chatPhoto public_photo:chatPhoto block_list:BlockList can_be_called:Bool supports_video_calls:Bool has_private_calls:Bool has_private_forwards:Bool has_restricted_voice_and_video_note_messages:Bool has_posted_to_profile_stories:Bool has_sponsored_messages_enabled:Bool need_phone_number_privacy_exception:Bool set_chat_background:Bool bio:formattedText birthdate:birthdate personal_chat_id:int53 gift_count:int32 group_in_common_count:int32 incoming_paid_message_star_count:int53 outgoing_paid_message_star_count:int53 bot_verification:botVerification business_info:businessInfo bot_info:botInfo = UserFullInfo; userFullInfo personal_photo:chatPhoto photo:chatPhoto public_photo:chatPhoto block_list:BlockList can_be_called:Bool supports_video_calls:Bool has_private_calls:Bool has_private_forwards:Bool has_restricted_voice_and_video_note_messages:Bool has_posted_to_profile_stories:Bool has_sponsored_messages_enabled:Bool need_phone_number_privacy_exception:Bool set_chat_background:Bool bio:formattedText birthdate:birthdate personal_chat_id:int53 gift_count:int32 group_in_common_count:int32 incoming_paid_message_star_count:int53 outgoing_paid_message_star_count:int53 gift_settings:giftSettings bot_verification:botVerification business_info:businessInfo bot_info:botInfo = UserFullInfo;
//@description Represents a list of users @total_count Approximate total number of users found @user_ids A list of user identifiers //@description Represents a list of users @total_count Approximate total number of users found @user_ids A list of user identifiers
users total_count:int32 user_ids:vector<int53> = Users; users total_count:int32 user_ids:vector<int53> = Users;
@ -2193,27 +2233,37 @@ sponsoredMessage message_id:int53 is_recommended:Bool can_be_reported:Bool conte
//@description Contains a list of sponsored messages @messages List of sponsored messages @messages_between The minimum number of messages between shown sponsored messages, or 0 if only one sponsored message must be shown after all ordinary messages //@description Contains a list of sponsored messages @messages List of sponsored messages @messages_between The minimum number of messages between shown sponsored messages, or 0 if only one sponsored message must be shown after all ordinary messages
sponsoredMessages messages:vector<sponsoredMessage> messages_between:int32 = SponsoredMessages; sponsoredMessages messages:vector<sponsoredMessage> messages_between:int32 = SponsoredMessages;
//@description Describes a sponsored chat
//@unique_id Unique identifier of this result
//@chat_id Chat identifier
//@sponsor_info Additional optional information about the sponsor to be shown along with the chat
//@additional_info If non-empty, additional information about the sponsored chat to be shown along with the chat
sponsoredChat unique_id:int53 chat_id:int53 sponsor_info:string additional_info:string = SponsoredChat;
//@description Contains a list of sponsored chats @chats List of sponsored chats
sponsoredChats chats:vector<sponsoredChat> = SponsoredChats;
//@description Describes an option to report an entity to Telegram @id Unique identifier of the option @text Text of the option //@description Describes an option to report an entity to Telegram @id Unique identifier of the option @text Text of the option
reportOption id:bytes text:string = ReportOption; reportOption id:bytes text:string = ReportOption;
//@class ReportChatSponsoredMessageResult @description Describes result of sponsored message report //@class ReportSponsoredResult @description Describes result of sponsored message or chat report
//@description The message was reported successfully //@description The message was reported successfully
reportChatSponsoredMessageResultOk = ReportChatSponsoredMessageResult; reportSponsoredResultOk = ReportSponsoredResult;
//@description The sponsored message is too old or not found //@description The sponsored message is too old or not found
reportChatSponsoredMessageResultFailed = ReportChatSponsoredMessageResult; reportSponsoredResultFailed = ReportSponsoredResult;
//@description The user must choose an option to report the message and repeat request with the chosen option @title Title for the option choice @options List of available options //@description The user must choose an option to report the message and repeat request with the chosen option @title Title for the option choice @options List of available options
reportChatSponsoredMessageResultOptionRequired title:string options:vector<reportOption> = ReportChatSponsoredMessageResult; reportSponsoredResultOptionRequired title:string options:vector<reportOption> = ReportSponsoredResult;
//@description Sponsored messages were hidden for the user in all chats //@description Sponsored messages were hidden for the user in all chats
reportChatSponsoredMessageResultAdsHidden = ReportChatSponsoredMessageResult; reportSponsoredResultAdsHidden = ReportSponsoredResult;
//@description The user asked to hide sponsored messages, but Telegram Premium is required for this //@description The user asked to hide sponsored messages, but Telegram Premium is required for this
reportChatSponsoredMessageResultPremiumRequired = ReportChatSponsoredMessageResult; reportSponsoredResultPremiumRequired = ReportSponsoredResult;
//@description Describes a file added to file download list //@description Describes a file added to file download list
@ -2774,6 +2824,7 @@ savedMessagesTopic id:int53 type:SavedMessagesTopicType is_pinned:Bool order:int
forumTopicIcon color:int32 custom_emoji_id:int64 = ForumTopicIcon; forumTopicIcon color:int32 custom_emoji_id:int64 = ForumTopicIcon;
//@description Contains basic information about a forum topic //@description Contains basic information about a forum topic
//@chat_id Identifier of the forum chat to which the topic belongs
//@message_thread_id Message thread identifier of the topic //@message_thread_id Message thread identifier of the topic
//@name Name of the topic //@name Name of the topic
//@icon Icon of the topic //@icon Icon of the topic
@ -2783,11 +2834,12 @@ forumTopicIcon color:int32 custom_emoji_id:int64 = ForumTopicIcon;
//@is_outgoing True, if the topic was created by the current user //@is_outgoing True, if the topic was created by the current user
//@is_closed True, if the topic is closed //@is_closed True, if the topic is closed
//@is_hidden True, if the topic is hidden above the topic list and closed; for General topic only //@is_hidden True, if the topic is hidden above the topic list and closed; for General topic only
forumTopicInfo message_thread_id:int53 name:string icon:forumTopicIcon creation_date:int32 creator_id:MessageSender is_general:Bool is_outgoing:Bool is_closed:Bool is_hidden:Bool = ForumTopicInfo; forumTopicInfo chat_id:int53 message_thread_id:int53 name:string icon:forumTopicIcon creation_date:int32 creator_id:MessageSender is_general:Bool is_outgoing:Bool is_closed:Bool is_hidden:Bool = ForumTopicInfo;
//@description Describes a forum topic //@description Describes a forum topic
//@info Basic information about the topic //@info Basic information about the topic
//@last_message Last message in the topic; may be null if unknown //@last_message Last message in the topic; may be null if unknown
//@order A parameter used to determine order of the topic in the topic list. Topics must be sorted by the order in descending order
//@is_pinned True, if the topic is pinned in the topic list //@is_pinned True, if the topic is pinned in the topic list
//@unread_count Number of unread messages in the topic //@unread_count Number of unread messages in the topic
//@last_read_inbox_message_id Identifier of the last read incoming message //@last_read_inbox_message_id Identifier of the last read incoming message
@ -2796,7 +2848,7 @@ forumTopicInfo message_thread_id:int53 name:string icon:forumTopicIcon creation_
//@unread_reaction_count Number of messages with unread reactions in the topic //@unread_reaction_count Number of messages with unread reactions in the topic
//@notification_settings Notification settings for the topic //@notification_settings Notification settings for the topic
//@draft_message A draft of a message in the topic; may be null if none //@draft_message A draft of a message in the topic; may be null if none
forumTopic info:forumTopicInfo last_message:message is_pinned:Bool unread_count:int32 last_read_inbox_message_id:int53 last_read_outbox_message_id:int53 unread_mention_count:int32 unread_reaction_count:int32 notification_settings:chatNotificationSettings draft_message:draftMessage = ForumTopic; forumTopic info:forumTopicInfo last_message:message order:int64 is_pinned:Bool unread_count:int32 last_read_inbox_message_id:int53 last_read_outbox_message_id:int53 unread_mention_count:int32 unread_reaction_count:int32 notification_settings:chatNotificationSettings draft_message:draftMessage = ForumTopic;
//@description Describes a list of forum topics //@description Describes a list of forum topics
//@total_count Approximate total number of forum topics found //@total_count Approximate total number of forum topics found
@ -4138,6 +4190,12 @@ messageUpgradedGift gift:upgradedGift sender_id:MessageSender received_gift_id:s
//@is_upgrade True, if the gift was obtained by upgrading of a previously received gift //@is_upgrade True, if the gift was obtained by upgrading of a previously received gift
messageRefundedUpgradedGift gift:gift sender_id:MessageSender is_upgrade:Bool = MessageContent; messageRefundedUpgradedGift gift:gift sender_id:MessageSender is_upgrade:Bool = MessageContent;
//@description Paid messages were refunded @message_count The number of refunded messages @star_count The number of refunded Telegram Stars
messagePaidMessagesRefunded message_count:int32 star_count:int53 = MessageContent;
//@description A price for paid messages was changed in the supergroup chat @paid_message_star_count The new number of Telegram Stars that must be paid by non-administrator users of the supergroup chat for each sent message
messagePaidMessagePriceChanged paid_message_star_count:int53 = MessageContent;
//@description A contact has registered with Telegram //@description A contact has registered with Telegram
messageContactRegistered = MessageContent; messageContactRegistered = MessageContent;
@ -5469,9 +5527,9 @@ speechRecognitionResultError error:error = SpeechRecognitionResult;
//@user_id Identifier of the business user that created the connection //@user_id Identifier of the business user that created the connection
//@user_chat_id Chat identifier of the private chat with the user //@user_chat_id Chat identifier of the private chat with the user
//@date Point in time (Unix timestamp) when the connection was established //@date Point in time (Unix timestamp) when the connection was established
//@can_reply True, if the bot can send messages to the connected user; false otherwise //@rights Rights of the bot; may be null if the connection was disabled
//@is_enabled True, if the connection is enabled; false otherwise //@is_enabled True, if the connection is enabled; false otherwise
businessConnection id:string user_id:int53 user_chat_id:int53 date:int32 can_reply:Bool is_enabled:Bool = BusinessConnection; businessConnection id:string user_id:int53 user_chat_id:int53 date:int32 rights:businessBotRights is_enabled:Bool = BusinessConnection;
//@description Describes a color to highlight a bot added to attachment menu @light_color Color in the RGB format for light themes @dark_color Color in the RGB format for dark themes //@description Describes a color to highlight a bot added to attachment menu @light_color Color in the RGB format for light themes @dark_color Color in the RGB format for dark themes
@ -6350,10 +6408,22 @@ storePaymentPurposeStars currency:string amount:int53 star_count:int53 = StorePa
storePaymentPurposeGiftedStars user_id:int53 currency:string amount:int53 star_count:int53 = StorePaymentPurpose; storePaymentPurposeGiftedStars user_id:int53 currency:string amount:int53 star_count:int53 = StorePaymentPurpose;
//@class StoreTransaction @description Describes an in-store transaction
//@description A purchase through App Store @receipt App Store receipt
storeTransactionAppStore receipt:bytes = StoreTransaction;
//@description A purchase through Google Play
//@package_name Application package name
//@store_product_id Identifier of the purchased store product
//@purchase_token Google Play purchase token
storeTransactionGooglePlay package_name:string store_product_id:string purchase_token:string = StoreTransaction;
//@class TelegramPaymentPurpose @description Describes a purpose of a payment toward Telegram //@class TelegramPaymentPurpose @description Describes a purpose of a payment toward Telegram
//@description The user gifting Telegram Premium to another user //@description The user gifting Telegram Premium to another user
//@currency ISO 4217 currency code of the payment currency //@currency ISO 4217 currency code of the payment currency, or "XTR" for payments in Telegram Stars
//@amount Paid amount, in the smallest units of the currency //@amount Paid amount, in the smallest units of the currency
//@user_id Identifier of the user which will receive Telegram Premium //@user_id Identifier of the user which will receive Telegram Premium
//@month_count Number of months the Telegram Premium subscription will be active for the user //@month_count Number of months the Telegram Premium subscription will be active for the user
@ -6975,7 +7045,8 @@ readDatePrivacySettings show_read_date:Bool = ReadDatePrivacySettings;
//@description Contains privacy settings for chats with non-contacts //@description Contains privacy settings for chats with non-contacts
//@allow_new_chats_from_unknown_users True, if non-contacts users are able to write first to the current user. Telegram Premium subscribers are able to write first regardless of this setting //@allow_new_chats_from_unknown_users True, if non-contacts users are able to write first to the current user. Telegram Premium subscribers are able to write first regardless of this setting
//@incoming_paid_message_star_count Number of Telegram Stars that must be paid for every incoming private message by non-contacts; 0-getOption("paid_message_star_count_max"). //@incoming_paid_message_star_count Number of Telegram Stars that must be paid for every incoming private message by non-contacts; 0-getOption("paid_message_star_count_max").
//-If positive, then allow_new_chats_from_unknown_users must be true. The current user will receive getOption("paid_message_earnings_per_mille") Telegram Stars for each 1000 Telegram Stars paid for message sending //-If positive, then allow_new_chats_from_unknown_users must be true. The current user will receive getOption("paid_message_earnings_per_mille") Telegram Stars for each 1000 Telegram Stars paid for message sending.
//-Can be positive, only if getOption("can_enable_paid_messages") is true
newChatPrivacySettings allow_new_chats_from_unknown_users:Bool incoming_paid_message_star_count:int53 = NewChatPrivacySettings; newChatPrivacySettings allow_new_chats_from_unknown_users:Bool incoming_paid_message_star_count:int53 = NewChatPrivacySettings;
@ -8281,8 +8352,16 @@ updateQuickReplyShortcuts shortcut_ids:vector<int32> = Update;
//@messages The new list of quick reply messages for the shortcut in order from the first to the last sent //@messages The new list of quick reply messages for the shortcut in order from the first to the last sent
updateQuickReplyShortcutMessages shortcut_id:int32 messages:vector<quickReplyMessage> = Update; updateQuickReplyShortcutMessages shortcut_id:int32 messages:vector<quickReplyMessage> = Update;
//@description Basic information about a topic in a forum chat was changed @chat_id Chat identifier @info New information about the topic //@description Basic information about a topic in a forum chat was changed @info New information about the topic
updateForumTopicInfo chat_id:int53 info:forumTopicInfo = Update; updateForumTopicInfo info:forumTopicInfo = Update;
//@description Information about a topic in a forum chat was changed
//@chat_id Chat identifier
//@message_thread_id Message thread identifier of the topic
//@is_pinned True, if the topic is pinned in the topic list
//@last_read_outbox_message_id Identifier of the last read outgoing message
//@notification_settings Notification settings for the topic
updateForumTopic chat_id:int53 message_thread_id:int53 is_pinned:Bool last_read_outbox_message_id:int53 notification_settings:chatNotificationSettings = Update;
//@description Notification settings for some type of chats were updated @scope Types of chats for which notification settings were updated @notification_settings The new notification settings //@description Notification settings for some type of chats were updated @scope Types of chats for which notification settings were updated @notification_settings The new notification settings
updateScopeNotificationSettings scope:NotificationSettingsScope notification_settings:scopeNotificationSettings = Update; updateScopeNotificationSettings scope:NotificationSettingsScope notification_settings:scopeNotificationSettings = Update;
@ -8510,6 +8589,13 @@ updateLanguagePackStrings localization_target:string language_pack_id:string str
//@description The connection state has changed. This update must be used only to show a human-readable description of the connection state @state The new connection state //@description The connection state has changed. This update must be used only to show a human-readable description of the connection state @state The new connection state
updateConnectionState state:ConnectionState = Update; updateConnectionState state:ConnectionState = Update;
//@description The freeze state of the current user's account has changed
//@is_frozen True, if the account is frozen
//@freezing_date Point in time (Unix timestamp) when the account was frozen; 0 if the account isn't frozen
//@deletion_date Point in time (Unix timestamp) when the account will be deleted and can't be unfrozen; 0 if the account isn't frozen
//@appeal_link The link to open to send an appeal to unfreeze the account
updateFreezeState is_frozen:Bool freezing_date:int32 deletion_date:int32 appeal_link:string = Update;
//@description New terms of service must be accepted by the user. If the terms of service are declined, then the deleteAccount method must be called with the reason "Decline ToS update" @terms_of_service_id Identifier of the terms of service @terms_of_service The new terms of service //@description New terms of service must be accepted by the user. If the terms of service are declined, then the deleteAccount method must be called with the reason "Decline ToS update" @terms_of_service_id Identifier of the terms of service @terms_of_service The new terms of service
updateTermsOfService terms_of_service_id:string terms_of_service:termsOfService = Update; updateTermsOfService terms_of_service_id:string terms_of_service:termsOfService = Update;
@ -8773,7 +8859,7 @@ testVectorStringObject value:vector<testString> = TestVectorStringObject;
---functions--- ---functions---
//@description Returns the current authorization state; this is an offline request. For informational purposes only. Use updateAuthorizationState instead to maintain the current authorization state. Can be called before initialization //@description Returns the current authorization state. This is an offline method. For informational purposes only. Use updateAuthorizationState instead to maintain the current authorization state. Can be called before initialization
getAuthorizationState = AuthorizationState; getAuthorizationState = AuthorizationState;
@ -8795,11 +8881,24 @@ getAuthorizationState = AuthorizationState;
setTdlibParameters use_test_dc:Bool database_directory:string files_directory:string database_encryption_key:bytes use_file_database:Bool use_chat_info_database:Bool use_message_database:Bool use_secret_chats:Bool api_id:int32 api_hash:string system_language_code:string device_model:string system_version:string application_version:string = Ok; setTdlibParameters use_test_dc:Bool database_directory:string files_directory:string database_encryption_key:bytes use_file_database:Bool use_chat_info_database:Bool use_message_database:Bool use_secret_chats:Bool api_id:int32 api_hash:string system_language_code:string device_model:string system_version:string application_version:string = Ok;
//@description Sets the phone number of the user and sends an authentication code to the user. Works only when the current authorization state is authorizationStateWaitPhoneNumber, //@description Sets the phone number of the user and sends an authentication code to the user. Works only when the current authorization state is authorizationStateWaitPhoneNumber,
//-or if there is no pending authentication query and the current authorization state is authorizationStateWaitEmailAddress, authorizationStateWaitEmailCode, authorizationStateWaitCode, authorizationStateWaitRegistration, or authorizationStateWaitPassword //-or if there is no pending authentication query and the current authorization state is authorizationStateWaitPremiumPurchase, authorizationStateWaitEmailAddress,
//-authorizationStateWaitEmailCode, authorizationStateWaitCode, authorizationStateWaitRegistration, or authorizationStateWaitPassword
//@phone_number The phone number of the user, in international format //@phone_number The phone number of the user, in international format
//@settings Settings for the authentication of the user's phone number; pass null to use default settings //@settings Settings for the authentication of the user's phone number; pass null to use default settings
setAuthenticationPhoneNumber phone_number:string settings:phoneNumberAuthenticationSettings = Ok; setAuthenticationPhoneNumber phone_number:string settings:phoneNumberAuthenticationSettings = Ok;
//@description Checks whether an in-store purchase of Telegram Premium is possible before authorization. Works only when the current authorization state is authorizationStateWaitPremiumPurchase
//@currency ISO 4217 currency code of the payment currency
//@amount Paid amount, in the smallest units of the currency
checkAuthenticationPremiumPurchase currency:string amount:int53 = Ok;
//@description Informs server about an in-store purchase of Telegram Premium before authorization. Works only when the current authorization state is authorizationStateWaitPremiumPurchase
//@transaction Information about the transaction
//@is_restore Pass true if this is a restore of a Telegram Premium purchase; only for App Store
//@currency ISO 4217 currency code of the payment currency
//@amount Paid amount, in the smallest units of the currency
setAuthenticationPremiumPurchaseTransaction transaction:StoreTransaction is_restore:Bool currency:string amount:int53 = Ok;
//@description Sets the email address of the user and sends an authentication code to the email address. Works only when the current authorization state is authorizationStateWaitEmailAddress @email_address The email address of the user //@description Sets the email address of the user and sends an authentication code to the email address. Works only when the current authorization state is authorizationStateWaitEmailAddress @email_address The email address of the user
setAuthenticationEmailAddress email_address:string = Ok; setAuthenticationEmailAddress email_address:string = Ok;
@ -8815,7 +8914,8 @@ checkAuthenticationEmailCode code:EmailAddressAuthentication = Ok;
checkAuthenticationCode code:string = Ok; checkAuthenticationCode code:string = Ok;
//@description Requests QR code authentication by scanning a QR code on another logged in device. Works only when the current authorization state is authorizationStateWaitPhoneNumber, //@description Requests QR code authentication by scanning a QR code on another logged in device. Works only when the current authorization state is authorizationStateWaitPhoneNumber,
//-or if there is no pending authentication query and the current authorization state is authorizationStateWaitEmailAddress, authorizationStateWaitEmailCode, authorizationStateWaitCode, authorizationStateWaitRegistration, or authorizationStateWaitPassword //-or if there is no pending authentication query and the current authorization state is authorizationStateWaitPremiumPurchase, authorizationStateWaitEmailAddress,
//-authorizationStateWaitEmailCode, authorizationStateWaitCode, authorizationStateWaitRegistration, or authorizationStateWaitPassword
//@other_user_ids List of user identifiers of other users currently using the application //@other_user_ids List of user identifiers of other users currently using the application
requestQrCodeAuthentication other_user_ids:vector<int53> = Ok; requestQrCodeAuthentication other_user_ids:vector<int53> = Ok;
@ -8945,28 +9045,28 @@ getTemporaryPasswordState = TemporaryPasswordState;
//@description Returns the current user //@description Returns the current user
getMe = User; getMe = User;
//@description Returns information about a user by their identifier. This is an offline request if the current user is not a bot @user_id User identifier //@description Returns information about a user by their identifier. This is an offline method if the current user is not a bot @user_id User identifier
getUser user_id:int53 = User; getUser user_id:int53 = User;
//@description Returns full information about a user by their identifier @user_id User identifier //@description Returns full information about a user by their identifier @user_id User identifier
getUserFullInfo user_id:int53 = UserFullInfo; getUserFullInfo user_id:int53 = UserFullInfo;
//@description Returns information about a basic group by its identifier. This is an offline request if the current user is not a bot @basic_group_id Basic group identifier //@description Returns information about a basic group by its identifier. This is an offline method if the current user is not a bot @basic_group_id Basic group identifier
getBasicGroup basic_group_id:int53 = BasicGroup; getBasicGroup basic_group_id:int53 = BasicGroup;
//@description Returns full information about a basic group by its identifier @basic_group_id Basic group identifier //@description Returns full information about a basic group by its identifier @basic_group_id Basic group identifier
getBasicGroupFullInfo basic_group_id:int53 = BasicGroupFullInfo; getBasicGroupFullInfo basic_group_id:int53 = BasicGroupFullInfo;
//@description Returns information about a supergroup or a channel by its identifier. This is an offline request if the current user is not a bot @supergroup_id Supergroup or channel identifier //@description Returns information about a supergroup or a channel by its identifier. This is an offline method if the current user is not a bot @supergroup_id Supergroup or channel identifier
getSupergroup supergroup_id:int53 = Supergroup; getSupergroup supergroup_id:int53 = Supergroup;
//@description Returns full information about a supergroup or a channel by its identifier, cached for up to 1 minute @supergroup_id Supergroup or channel identifier //@description Returns full information about a supergroup or a channel by its identifier, cached for up to 1 minute @supergroup_id Supergroup or channel identifier
getSupergroupFullInfo supergroup_id:int53 = SupergroupFullInfo; getSupergroupFullInfo supergroup_id:int53 = SupergroupFullInfo;
//@description Returns information about a secret chat by its identifier. This is an offline request @secret_chat_id Secret chat identifier //@description Returns information about a secret chat by its identifier. This is an offline method @secret_chat_id Secret chat identifier
getSecretChat secret_chat_id:int32 = SecretChat; getSecretChat secret_chat_id:int32 = SecretChat;
//@description Returns information about a chat by its identifier; this is an offline request if the current user is not a bot @chat_id Chat identifier //@description Returns information about a chat by its identifier. This is an offline method if the current user is not a bot @chat_id Chat identifier
getChat chat_id:int53 = Chat; getChat chat_id:int53 = Chat;
//@description Returns information about a message. Returns a 404 error if the message doesn't exist //@description Returns information about a message. Returns a 404 error if the message doesn't exist
@ -8974,7 +9074,7 @@ getChat chat_id:int53 = Chat;
//@message_id Identifier of the message to get //@message_id Identifier of the message to get
getMessage chat_id:int53 message_id:int53 = Message; getMessage chat_id:int53 message_id:int53 = Message;
//@description Returns information about a message, if it is available without sending network request. Returns a 404 error if message isn't available locally. This is an offline request //@description Returns information about a message, if it is available without sending network request. Returns a 404 error if message isn't available locally. This is an offline method
//@chat_id Identifier of the chat the message belongs to //@chat_id Identifier of the chat the message belongs to
//@message_id Identifier of the message to get //@message_id Identifier of the message to get
getMessageLocally chat_id:int53 message_id:int53 = Message; getMessageLocally chat_id:int53 message_id:int53 = Message;
@ -8996,7 +9096,7 @@ getCallbackQueryMessage chat_id:int53 message_id:int53 callback_query_id:int64 =
//@description Returns information about messages. If a message is not found, returns null on the corresponding position of the result @chat_id Identifier of the chat the messages belong to @message_ids Identifiers of the messages to get //@description Returns information about messages. If a message is not found, returns null on the corresponding position of the result @chat_id Identifier of the chat the messages belong to @message_ids Identifiers of the messages to get
getMessages chat_id:int53 message_ids:vector<int53> = Messages; getMessages chat_id:int53 message_ids:vector<int53> = Messages;
//@description Returns properties of a message; this is an offline request @chat_id Chat identifier @message_id Identifier of the message //@description Returns properties of a message. This is an offline method @chat_id Chat identifier @message_id Identifier of the message
getMessageProperties chat_id:int53 message_id:int53 = MessageProperties; getMessageProperties chat_id:int53 message_id:int53 = MessageProperties;
//@description Returns information about a message thread. Can be used only if messageProperties.can_get_message_thread == true @chat_id Chat identifier @message_id Identifier of the message //@description Returns information about a message thread. Can be used only if messageProperties.can_get_message_thread == true @chat_id Chat identifier @message_id Identifier of the message
@ -9012,10 +9112,10 @@ getMessageReadDate chat_id:int53 message_id:int53 = MessageReadDate;
//@message_id Identifier of the message //@message_id Identifier of the message
getMessageViewers chat_id:int53 message_id:int53 = MessageViewers; getMessageViewers chat_id:int53 message_id:int53 = MessageViewers;
//@description Returns information about a file; this is an offline request @file_id Identifier of the file to get //@description Returns information about a file. This is an offline method @file_id Identifier of the file to get
getFile file_id:int32 = File; getFile file_id:int32 = File;
//@description Returns information about a file by its remote identifier; this is an offline request. Can be used to register a URL as a file for further uploading, or sending as a message. Even the request succeeds, the file can be used only if it is still accessible to the user. //@description Returns information about a file by its remote identifier. This is an offline method. Can be used to register a URL as a file for further uploading, or sending as a message. Even the request succeeds, the file can be used only if it is still accessible to the user.
//-For example, if the file is from a message, then the message must be not deleted and accessible to the user. If the file database is disabled, then the corresponding object with the file must be preloaded by the application //-For example, if the file is from a message, then the message must be not deleted and accessible to the user. If the file database is disabled, then the corresponding object with the file must be preloaded by the application
//@remote_file_id Remote identifier of the file to get //@remote_file_id Remote identifier of the file to get
//@file_type File type; pass null if unknown //@file_type File type; pass null if unknown
@ -9039,7 +9139,7 @@ searchPublicChat username:string = Chat;
//@query Query to search for //@query Query to search for
searchPublicChats query:string = Chats; searchPublicChats query:string = Chats;
//@description Searches for the specified query in the title and username of already known chats; this is an offline request. Returns chats in the order seen in the main chat list //@description Searches for the specified query in the title and username of already known chats. This is an offline method. Returns chats in the order seen in the main chat list
//@query Query to search for. If the query is empty, returns up to 50 recently found chats //@query Query to search for. If the query is empty, returns up to 50 recently found chats
//@limit The maximum number of chats to be returned //@limit The maximum number of chats to be returned
searchChats query:string limit:int32 = Chats; searchChats query:string limit:int32 = Chats;
@ -9082,7 +9182,7 @@ getTopChats category:TopChatCategory limit:int32 = Chats;
//@description Removes a chat from the list of frequently used chats. Supported only if the chat info database is enabled @category Category of frequently used chats @chat_id Chat identifier //@description Removes a chat from the list of frequently used chats. Supported only if the chat info database is enabled @category Category of frequently used chats @chat_id Chat identifier
removeTopChat category:TopChatCategory chat_id:int53 = Ok; removeTopChat category:TopChatCategory chat_id:int53 = Ok;
//@description Searches for the specified query in the title and username of up to 50 recently found chats; this is an offline request //@description Searches for the specified query in the title and username of up to 50 recently found chats. This is an offline method
//@query Query to search for //@query Query to search for
//@limit The maximum number of chats to be returned //@limit The maximum number of chats to be returned
searchRecentlyFoundChats query:string limit:int32 = Chats; searchRecentlyFoundChats query:string limit:int32 = Chats;
@ -9096,7 +9196,7 @@ removeRecentlyFoundChat chat_id:int53 = Ok;
//@description Clears the list of recently found chats //@description Clears the list of recently found chats
clearRecentlyFoundChats = Ok; clearRecentlyFoundChats = Ok;
//@description Returns recently opened chats; this is an offline request. Returns chats in the order of last opening @limit The maximum number of chats to be returned //@description Returns recently opened chats. This is an offline method. Returns chats in the order of last opening @limit The maximum number of chats to be returned
getRecentlyOpenedChats limit:int32 = Chats; getRecentlyOpenedChats limit:int32 = Chats;
//@description Checks whether a username can be set for a chat @chat_id Chat identifier; must be identifier of a supergroup chat, or a channel chat, or a private chat with self, or 0 if the chat is being created @username Username to be checked //@description Checks whether a username can be set for a chat @chat_id Chat identifier; must be identifier of a supergroup chat, or a channel chat, or a private chat with self, or 0 if the chat is being created @username Username to be checked
@ -9162,7 +9262,7 @@ getGroupsInCommon user_id:int53 offset_chat_id:int53 limit:int32 = Chats;
//@description Returns messages in a chat. The messages are returned in reverse chronological order (i.e., in order of decreasing message_id). //@description Returns messages in a chat. The messages are returned in reverse chronological order (i.e., in order of decreasing message_id).
//-For optimal performance, the number of returned messages is chosen by TDLib. This is an offline request if only_local is true //-For optimal performance, the number of returned messages is chosen by TDLib. This is an offline method if only_local is true
//@chat_id Chat identifier //@chat_id Chat identifier
//@from_message_id Identifier of the message starting from which history must be fetched; use 0 to get results from the last message //@from_message_id Identifier of the message starting from which history must be fetched; use 0 to get results from the last message
//@offset Specify 0 to get results from exactly the message from_message_id or a negative offset up to 99 to get additionally some newer messages //@offset Specify 0 to get results from exactly the message from_message_id or a negative offset up to 99 to get additionally some newer messages
@ -9344,7 +9444,21 @@ clickChatSponsoredMessage chat_id:int53 message_id:int53 is_media_click:Bool fro
//@chat_id Chat identifier of the sponsored message //@chat_id Chat identifier of the sponsored message
//@message_id Identifier of the sponsored message //@message_id Identifier of the sponsored message
//@option_id Option identifier chosen by the user; leave empty for the initial request //@option_id Option identifier chosen by the user; leave empty for the initial request
reportChatSponsoredMessage chat_id:int53 message_id:int53 option_id:bytes = ReportChatSponsoredMessageResult; reportChatSponsoredMessage chat_id:int53 message_id:int53 option_id:bytes = ReportSponsoredResult;
//@description Returns sponsored chats to be shown in the search results @query Query the user searches for
getSearchSponsoredChats query:string = SponsoredChats;
//@description Informs TDLib that the user fully viewed a sponsored chat @sponsored_chat_unique_id Unique identifier of the sponsored chat
viewSponsoredChat sponsored_chat_unique_id:int53 = Ok;
//@description Informs TDLib that the user opened a sponsored chat @sponsored_chat_unique_id Unique identifier of the sponsored chat
openSponsoredChat sponsored_chat_unique_id:int53 = Ok;
//@description Reports a sponsored chat to Telegram moderators
//@sponsored_chat_unique_id Unique identifier of the sponsored chat
//@option_id Option identifier chosen by the user; leave empty for the initial request
reportSponsoredChat sponsored_chat_unique_id:int53 option_id:bytes = ReportSponsoredResult;
//@description Removes an active notification from notification list. Needs to be called only if the notification is removed by the current user @notification_group_id Identifier of notification group to which the notification belongs @notification_id Identifier of removed notification //@description Removes an active notification from notification list. Needs to be called only if the notification is removed by the current user @notification_group_id Identifier of notification group to which the notification belongs @notification_id Identifier of removed notification
@ -9354,7 +9468,7 @@ removeNotification notification_group_id:int32 notification_id:int32 = Ok;
removeNotificationGroup notification_group_id:int32 max_notification_id:int32 = Ok; removeNotificationGroup notification_group_id:int32 max_notification_id:int32 = Ok;
//@description Returns an HTTPS link to a message in a chat. Available only if messageProperties.can_get_link, or if messageProperties.can_get_media_timestamp_links and a media timestamp link is generated. This is an offline request //@description Returns an HTTPS link to a message in a chat. Available only if messageProperties.can_get_link, or if messageProperties.can_get_media_timestamp_links and a media timestamp link is generated. This is an offline method
//@chat_id Identifier of the chat to which the message belongs //@chat_id Identifier of the chat to which the message belongs
//@message_id Identifier of the message //@message_id Identifier of the message
//@media_timestamp If not 0, timestamp from which the video/audio/video note/voice note/story playing must start, in seconds. The media can be in the message content or in its link preview //@media_timestamp If not 0, timestamp from which the video/audio/video note/voice note/story playing must start, in seconds. The media can be in the message content or in its link preview
@ -9663,6 +9777,66 @@ stopBusinessPoll business_connection_id:string chat_id:int53 message_id:int53 re
//@is_pinned Pass true to pin the message, pass false to unpin it //@is_pinned Pass true to pin the message, pass false to unpin it
setBusinessMessageIsPinned business_connection_id:string chat_id:int53 message_id:int53 is_pinned:Bool = Ok; setBusinessMessageIsPinned business_connection_id:string chat_id:int53 message_id:int53 is_pinned:Bool = Ok;
//@description Reads a message on behalf of a business account; for bots only
//@business_connection_id Unique identifier of business connection through which the message was received
//@chat_id The chat the message belongs to
//@message_id Identifier of the message
readBusinessMessage business_connection_id:string chat_id:int53 message_id:int53 = Ok;
//@description Deletes messages on behalf of a business account; for bots only
//@business_connection_id Unique identifier of business connection through which the messages were received
//@message_ids Identifier of the messages
deleteBusinessMessages business_connection_id:string message_ids:vector<int53> = Ok;
//@description Changes a story sent by the bot on behalf of a business account; for bots only
//@story_sender_chat_id Identifier of the chat that posted the story
//@story_id Identifier of the story to edit
//@content New content of the story
//@areas New clickable rectangle areas to be shown on the story media
//@caption New story caption
//@privacy_settings The new privacy settings for the story
editBusinessStory story_sender_chat_id:int53 story_id:int32 content:InputStoryContent areas:inputStoryAreas caption:formattedText privacy_settings:StoryPrivacySettings = Story;
//@description Deletes a story sent by the bot on behalf of a business account; for bots only
//@business_connection_id Unique identifier of business connection
//@story_id Identifier of the story to delete
deleteBusinessStory business_connection_id:string story_id:int32 = Ok;
//@description Changes the first and last name of a business account; for bots only
//@business_connection_id Unique identifier of business connection
//@first_name The new value of the first name for the business account; 1-64 characters
//@last_name The new value of the optional last name for the business account; 0-64 characters
setBusinessAccountName business_connection_id:string first_name:string last_name:string = Ok;
//@description Changes the bio of a business account; for bots only
//@business_connection_id Unique identifier of business connection
//@bio The new value of the bio; 0-getOption("bio_length_max") characters without line feeds
setBusinessAccountBio business_connection_id:string bio:string = Ok;
//@description Changes a profile photo of a business account; for bots only
//@business_connection_id Unique identifier of business connection
//@photo Profile photo to set; pass null to remove the photo
//@is_public Pass true to set the public photo, which will be visible even the main photo is hidden by privacy settings
setBusinessAccountProfilePhoto business_connection_id:string photo:InputChatPhoto is_public:Bool = Ok;
//@description Changes the editable username of a business account; for bots only
//@business_connection_id Unique identifier of business connection
//@username The new value of the username
setBusinessAccountUsername business_connection_id:string username:string = Ok;
//@description Changes settings for gift receiving of a business account; for bots only
//@business_connection_id Unique identifier of business connection
//@settings The new settings
setBusinessAccountGiftSettings business_connection_id:string settings:giftSettings = Ok;
//@description Returns the amount of Telegram Stars owned by a business account; for bots only @business_connection_id Unique identifier of business connection
getBusinessAccountStarAmount business_connection_id:string = StarAmount;
//@description Transfer Telegram Stars from the business account to the business bot; for bots only
//@business_connection_id Unique identifier of business connection
//@star_count Number of Telegram Stars to transfer
transferBusinessAccountStars business_connection_id:string star_count:int53 = Ok;
//@description Checks validness of a name for a quick reply shortcut. Can be called synchronously @name The name of the shortcut; 1-32 characters //@description Checks validness of a name for a quick reply shortcut. Can be called synchronously @name The name of the shortcut; 1-32 characters
checkQuickReplyShortcutName name:string = Ok; checkQuickReplyShortcutName name:string = Ok;
@ -9745,7 +9919,7 @@ editForumTopic chat_id:int53 message_thread_id:int53 name:string edit_icon_custo
//@description Returns information about a forum topic @chat_id Identifier of the chat @message_thread_id Message thread identifier of the forum topic //@description Returns information about a forum topic @chat_id Identifier of the chat @message_thread_id Message thread identifier of the forum topic
getForumTopic chat_id:int53 message_thread_id:int53 = ForumTopic; getForumTopic chat_id:int53 message_thread_id:int53 = ForumTopic;
//@description Returns an HTTPS link to a topic in a forum chat. This is an offline request @chat_id Identifier of the chat @message_thread_id Message thread identifier of the forum topic //@description Returns an HTTPS link to a topic in a forum chat. This is an offline method @chat_id Identifier of the chat @message_thread_id Message thread identifier of the forum topic
getForumTopicLink chat_id:int53 message_thread_id:int53 = MessageLink; getForumTopicLink chat_id:int53 message_thread_id:int53 = MessageLink;
//@description Returns found forum topics in a forum chat. This is a temporary method for getting information about topic list from the server //@description Returns found forum topics in a forum chat. This is a temporary method for getting information about topic list from the server
@ -10025,7 +10199,7 @@ getGrossingWebAppBots offset:string limit:int32 = FoundUsers;
//@web_app_short_name Short name of the Web App //@web_app_short_name Short name of the Web App
searchWebApp bot_user_id:int53 web_app_short_name:string = FoundWebApp; searchWebApp bot_user_id:int53 web_app_short_name:string = FoundWebApp;
//@description Returns a default placeholder for Web Apps of a bot; this is an offline request. Returns a 404 error if the placeholder isn't known @bot_user_id Identifier of the target bot //@description Returns a default placeholder for Web Apps of a bot. This is an offline method. Returns a 404 error if the placeholder isn't known @bot_user_id Identifier of the target bot
getWebAppPlaceholder bot_user_id:int53 = Outline; getWebAppPlaceholder bot_user_id:int53 = Outline;
//@description Returns an HTTPS URL of a Web App to open after a link of the type internalLinkTypeWebApp is clicked //@description Returns an HTTPS URL of a Web App to open after a link of the type internalLinkTypeWebApp is clicked
@ -10227,7 +10401,7 @@ createNewSecretChat user_id:int53 = Chat;
upgradeBasicGroupChatToSupergroupChat chat_id:int53 = Chat; upgradeBasicGroupChatToSupergroupChat chat_id:int53 = Chat;
//@description Returns chat lists to which the chat can be added. This is an offline request @chat_id Chat identifier //@description Returns chat lists to which the chat can be added. This is an offline method @chat_id Chat identifier
getChatListsToAddChat chat_id:int53 = ChatLists; getChatListsToAddChat chat_id:int53 = ChatLists;
//@description Adds a chat to a chat list. A chat can't be simultaneously in Main and Archive chat lists, so it is automatically removed from another one if needed //@description Adds a chat to a chat list. A chat can't be simultaneously in Main and Archive chat lists, so it is automatically removed from another one if needed
@ -10692,12 +10866,12 @@ activateStoryStealthMode = Ok;
getStoryPublicForwards story_sender_chat_id:int53 story_id:int32 offset:string limit:int32 = PublicForwards; getStoryPublicForwards story_sender_chat_id:int53 story_id:int32 offset:string limit:int32 = PublicForwards;
//@description Returns the list of features available on the specific chat boost level; this is an offline request //@description Returns the list of features available on the specific chat boost level. This is an offline method
//@is_channel Pass true to get the list of features for channels; pass false to get the list of features for supergroups //@is_channel Pass true to get the list of features for channels; pass false to get the list of features for supergroups
//@level Chat boost level //@level Chat boost level
getChatBoostLevelFeatures is_channel:Bool level:int32 = ChatBoostLevelFeatures; getChatBoostLevelFeatures is_channel:Bool level:int32 = ChatBoostLevelFeatures;
//@description Returns the list of features available for different chat boost levels; this is an offline request //@description Returns the list of features available for different chat boost levels. This is an offline method
//@is_channel Pass true to get the list of features for channels; pass false to get the list of features for supergroups //@is_channel Pass true to get the list of features for channels; pass false to get the list of features for supergroups
getChatBoostFeatures is_channel:Bool = ChatBoostFeatures; getChatBoostFeatures is_channel:Bool = ChatBoostFeatures;
@ -11233,7 +11407,7 @@ sharePhoneNumber user_id:int53 = Ok;
getUserProfilePhotos user_id:int53 offset:int32 limit:int32 = ChatPhotos; getUserProfilePhotos user_id:int53 offset:int32 limit:int32 = ChatPhotos;
//@description Returns outline of a sticker; this is an offline request. Returns a 404 error if the outline isn't known //@description Returns outline of a sticker. This is an offline method. Returns a 404 error if the outline isn't known
//@sticker_file_id File identifier of the sticker //@sticker_file_id File identifier of the sticker
//@for_animated_emoji Pass true to get the outline scaled for animated emoji //@for_animated_emoji Pass true to get the outline scaled for animated emoji
//@for_clicked_animated_emoji_message Pass true to get the outline scaled for clicked animated emoji message //@for_clicked_animated_emoji_message Pass true to get the outline scaled for clicked animated emoji message
@ -11406,7 +11580,7 @@ removeRecentHashtag hashtag:string = Ok;
//@link_preview_options Options to be used for generation of the link preview; pass null to use default link preview options //@link_preview_options Options to be used for generation of the link preview; pass null to use default link preview options
getLinkPreview text:formattedText link_preview_options:linkPreviewOptions = LinkPreview; getLinkPreview text:formattedText link_preview_options:linkPreviewOptions = LinkPreview;
//@description Returns an instant view version of a web page if available. This is an offline request if only_local is true. Returns a 404 error if the web page has no instant view page //@description Returns an instant view version of a web page if available. This is an offline method if only_local is true. Returns a 404 error if the web page has no instant view page
//@url The web page URL //@url The web page URL
//@only_local Pass true to get only locally available information without sending network requests //@only_local Pass true to get only locally available information without sending network requests
getWebPageInstantView url:string only_local:Bool = WebPageInstantView; getWebPageInstantView url:string only_local:Bool = WebPageInstantView;
@ -11414,7 +11588,7 @@ getWebPageInstantView url:string only_local:Bool = WebPageInstantView;
//@description Changes a profile photo for the current user //@description Changes a profile photo for the current user
//@photo Profile photo to set //@photo Profile photo to set
//@is_public Pass true to set a public photo, which will be visible even the main photo is hidden by privacy settings //@is_public Pass true to set the public photo, which will be visible even the main photo is hidden by privacy settings
setProfilePhoto photo:InputChatPhoto is_public:Bool = Ok; setProfilePhoto photo:InputChatPhoto is_public:Bool = Ok;
//@description Deletes a profile photo @profile_photo_id Identifier of the profile photo to delete //@description Deletes a profile photo @profile_photo_id Identifier of the profile photo to delete
@ -11853,6 +12027,9 @@ deleteSavedOrderInfo = Ok;
deleteSavedCredentials = Ok; deleteSavedCredentials = Ok;
//@description Changes settings for gift receiving for the current user @settings The new settings
setGiftSettings settings:giftSettings = Ok;
//@description Returns gifts that can be sent to other users and channel chats //@description Returns gifts that can be sent to other users and channel chats
getAvailableGifts = Gifts; getAvailableGifts = Gifts;
@ -11865,8 +12042,10 @@ getAvailableGifts = Gifts;
//@pay_for_upgrade Pass true to additionally pay for the gift upgrade and allow the receiver to upgrade it for free //@pay_for_upgrade Pass true to additionally pay for the gift upgrade and allow the receiver to upgrade it for free
sendGift gift_id:int64 owner_id:MessageSender text:formattedText is_private:Bool pay_for_upgrade:Bool = Ok; sendGift gift_id:int64 owner_id:MessageSender text:formattedText is_private:Bool pay_for_upgrade:Bool = Ok;
//@description Sells a gift for Telegram Stars @received_gift_id Identifier of the gift //@description Sells a gift for Telegram Stars
sellGift received_gift_id:string = Ok; //@business_connection_id Unique identifier of business connection on behalf of which to send the request; for bots only
//@received_gift_id Identifier of the gift
sellGift business_connection_id:string received_gift_id:string = Ok;
//@description Toggles whether a gift is shown on the current user's or the channel's profile page; requires can_post_messages administrator right in the channel chat //@description Toggles whether a gift is shown on the current user's or the channel's profile page; requires can_post_messages administrator right in the channel chat
//@received_gift_id Identifier of the gift //@received_gift_id Identifier of the gift
@ -11887,18 +12066,21 @@ toggleChatGiftNotifications chat_id:int53 are_enabled:Bool = Ok;
getGiftUpgradePreview gift_id:int64 = GiftUpgradePreview; getGiftUpgradePreview gift_id:int64 = GiftUpgradePreview;
//@description Upgrades a regular gift //@description Upgrades a regular gift
//@business_connection_id Unique identifier of business connection on behalf of which to send the request; for bots only
//@received_gift_id Identifier of the gift //@received_gift_id Identifier of the gift
//@keep_original_details Pass true to keep the original gift text, sender and receiver in the upgraded gift //@keep_original_details Pass true to keep the original gift text, sender and receiver in the upgraded gift
//@star_count The amount of Telegram Stars required to pay for the upgrade. It the gift has prepaid_upgrade_star_count > 0, then pass 0, otherwise, pass gift.upgrade_star_count //@star_count The amount of Telegram Stars required to pay for the upgrade. It the gift has prepaid_upgrade_star_count > 0, then pass 0, otherwise, pass gift.upgrade_star_count
upgradeGift received_gift_id:string keep_original_details:Bool star_count:int53 = UpgradeGiftResult; upgradeGift business_connection_id:string received_gift_id:string keep_original_details:Bool star_count:int53 = UpgradeGiftResult;
//@description Sends an upgraded gift to another user or a channel chat //@description Sends an upgraded gift to another user or a channel chat
//@business_connection_id Unique identifier of business connection on behalf of which to send the request; for bots only
//@received_gift_id Identifier of the gift //@received_gift_id Identifier of the gift
//@new_owner_id Identifier of the user or the channel chat that will receive the gift //@new_owner_id Identifier of the user or the channel chat that will receive the gift
//@star_count The amount of Telegram Stars required to pay for the transfer //@star_count The amount of Telegram Stars required to pay for the transfer
transferGift received_gift_id:string new_owner_id:MessageSender star_count:int53 = Ok; transferGift business_connection_id:string received_gift_id:string new_owner_id:MessageSender star_count:int53 = Ok;
//@description Returns gifts received by the given user or chat //@description Returns gifts received by the given user or chat
//@business_connection_id Unique identifier of business connection on behalf of which to send the request; for bots only
//@owner_id Identifier of the gift receiver //@owner_id Identifier of the gift receiver
//@exclude_unsaved Pass true to exclude gifts that aren't saved to the chat's profile page. Always true for gifts received by other users and channel chats without can_post_messages administrator right //@exclude_unsaved Pass true to exclude gifts that aren't saved to the chat's profile page. Always true for gifts received by other users and channel chats without can_post_messages administrator right
//@exclude_saved Pass true to exclude gifts that are saved to the chat's profile page. Always false for gifts received by other users and channel chats without can_post_messages administrator right //@exclude_saved Pass true to exclude gifts that are saved to the chat's profile page. Always false for gifts received by other users and channel chats without can_post_messages administrator right
@ -11908,7 +12090,7 @@ transferGift received_gift_id:string new_owner_id:MessageSender star_count:int53
//@sort_by_price Pass true to sort results by gift price instead of send date //@sort_by_price Pass true to sort results by gift price instead of send date
//@offset Offset of the first entry to return as received from the previous request; use empty string to get the first chunk of results //@offset Offset of the first entry to return as received from the previous request; use empty string to get the first chunk of results
//@limit The maximum number of gifts to be returned; must be positive and can't be greater than 100. For optimal performance, the number of returned objects is chosen by TDLib and can be smaller than the specified limit //@limit The maximum number of gifts to be returned; must be positive and can't be greater than 100. For optimal performance, the number of returned objects is chosen by TDLib and can be smaller than the specified limit
getReceivedGifts owner_id:MessageSender exclude_unsaved:Bool exclude_saved:Bool exclude_unlimited:Bool exclude_limited:Bool exclude_upgraded:Bool sort_by_price:Bool offset:string limit:int32 = ReceivedGifts; getReceivedGifts business_connection_id:string owner_id:MessageSender exclude_unsaved:Bool exclude_saved:Bool exclude_unlimited:Bool exclude_limited:Bool exclude_upgraded:Bool sort_by_price:Bool offset:string limit:int32 = ReceivedGifts;
//@description Returns information about a received gift @received_gift_id Identifier of the gift //@description Returns information about a received gift @received_gift_id Identifier of the gift
getReceivedGift received_gift_id:string = ReceivedGift; getReceivedGift received_gift_id:string = ReceivedGift;
@ -11962,7 +12144,7 @@ removeInstalledBackground background_id:int64 = Ok;
resetInstalledBackgrounds = Ok; resetInstalledBackgrounds = Ok;
//@description Returns information about the current localization target. This is an offline request if only_local is true. Can be called before authorization @only_local Pass true to get only locally available information without sending network requests //@description Returns information about the current localization target. This is an offline method if only_local is true. Can be called before authorization @only_local Pass true to get only locally available information without sending network requests
getLocalizationTargetInfo only_local:Bool = LocalizationTargetInfo; getLocalizationTargetInfo only_local:Bool = LocalizationTargetInfo;
//@description Returns information about a language pack. Returned language pack identifier may be different from a provided one. Can be called before authorization @language_pack_id Language pack identifier //@description Returns information about a language pack. Returned language pack identifier may be different from a provided one. Can be called before authorization @language_pack_id Language pack identifier
@ -12401,6 +12583,13 @@ checkPremiumGiftCode code:string = PremiumGiftCodeInfo;
//@description Applies a Telegram Premium gift code @code The code to apply //@description Applies a Telegram Premium gift code @code The code to apply
applyPremiumGiftCode code:string = Ok; applyPremiumGiftCode code:string = Ok;
//@description Allows to buy a Telegram Premium subscription for another user with payment in Telegram Stars; for bots only
//@user_id Identifier of the user which will receive Telegram Premium
//@star_count The number of Telegram Stars to pay for subscription
//@month_count Number of months the Telegram Premium subscription will be active for the user
//@text Text to show to the user receiving Telegram Premium; 0-getOption("gift_text_length_max") characters. Only Bold, Italic, Underline, Strikethrough, Spoiler, and CustomEmoji entities are allowed
giftPremiumWithStars user_id:int53 star_count:int53 month_count:int32 text:formattedText = Ok;
//@description Launches a prepaid giveaway //@description Launches a prepaid giveaway
//@giveaway_id Unique identifier of the prepaid giveaway //@giveaway_id Unique identifier of the prepaid giveaway
//@parameters Giveaway parameters //@parameters Giveaway parameters
@ -12436,18 +12625,11 @@ getStarTransactions owner_id:MessageSender subscription_id:string direction:Star
//@offset Offset of the first subscription to return as received from the previous request; use empty string to get the first chunk of results //@offset Offset of the first subscription to return as received from the previous request; use empty string to get the first chunk of results
getStarSubscriptions only_expiring:Bool offset:string = StarSubscriptions; getStarSubscriptions only_expiring:Bool offset:string = StarSubscriptions;
//@description Checks whether an in-store purchase is possible. Must be called before any in-store purchase @purpose Transaction purpose //@description Checks whether an in-store purchase is possible. Must be called before any in-store purchase. For official applications only @purpose Transaction purpose
canPurchaseFromStore purpose:StorePaymentPurpose = Ok; canPurchaseFromStore purpose:StorePaymentPurpose = Ok;
//@description Informs server about a purchase through App Store. For official applications only @receipt App Store receipt @purpose Transaction purpose //@description Informs server about an in-store purchase. For official applications only @transaction Information about the transaction @purpose Transaction purpose
assignAppStoreTransaction receipt:bytes purpose:StorePaymentPurpose = Ok; assignStoreTransaction transaction:StoreTransaction purpose:StorePaymentPurpose = Ok;
//@description Informs server about a purchase through Google Play. For official applications only
//@package_name Application package name
//@store_product_id Identifier of the purchased store product
//@purchase_token Google Play purchase token
//@purpose Transaction purpose
assignGooglePlayTransaction package_name:string store_product_id:string purchase_token:string purpose:StorePaymentPurpose = Ok;
//@description Cancels or re-enables Telegram Star subscription //@description Cancels or re-enables Telegram Star subscription
//@subscription_id Identifier of the subscription to change //@subscription_id Identifier of the subscription to change