diff --git a/client/function.go b/client/function.go index 44e7348..bf2bef8 100755 --- a/client/function.go +++ b/client/function.go @@ -1854,7 +1854,7 @@ type OpenChatSimilarChatRequest struct { OpenedChatId int64 `json:"opened_chat_id"` } -// Informs TDLib that a chat was opened from the list of similar chats. The method is independent from openChat and closeChat methods +// Informs TDLib that a chat was opened from the list of similar chats. The method is independent of openChat and closeChat methods func (client *Client) OpenChatSimilarChat(req *OpenChatSimilarChatRequest) (*Ok, error) { result, err := client.Send(Request{ meta: meta{ @@ -4600,6 +4600,137 @@ func (client *Client) DeleteQuickReplyShortcutMessages(req *DeleteQuickReplyShor return UnmarshalOk(result.Data) } +type AddQuickReplyShortcutMessageRequest struct { + // Name of the target shortcut + ShortcutName string `json:"shortcut_name"` + // Identifier of a quick reply message in the same shortcut to be replied; pass 0 if none + ReplyToMessageId int64 `json:"reply_to_message_id"` + // The content of the message to be added; inputMessagePoll, inputMessageForwarded and inputMessageLocation with live_period aren't supported + InputMessageContent InputMessageContent `json:"input_message_content"` +} + +// Adds a message to a quick reply shortcut. If shortcut doesn't exist and there are less than getOption("quick_reply_shortcut_count_max") shortcuts, then a new shortcut is created. The shortcut must not contain more than getOption("quick_reply_shortcut_message_count_max") messages after adding the new message. Returns the added message +func (client *Client) AddQuickReplyShortcutMessage(req *AddQuickReplyShortcutMessageRequest) (*QuickReplyMessage, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "addQuickReplyShortcutMessage", + }, + Data: map[string]interface{}{ + "shortcut_name": req.ShortcutName, + "reply_to_message_id": req.ReplyToMessageId, + "input_message_content": req.InputMessageContent, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalQuickReplyMessage(result.Data) +} + +type AddQuickReplyShortcutInlineQueryResultMessageRequest struct { + // Name of the target shortcut + ShortcutName string `json:"shortcut_name"` + // Identifier of a quick reply message in the same shortcut to be replied; pass 0 if none + ReplyToMessageId int64 `json:"reply_to_message_id"` + // Identifier of the inline query + QueryId JsonInt64 `json:"query_id"` + // Identifier of the inline query result + ResultId string `json:"result_id"` + // Pass true to hide the bot, via which the message is sent. Can be used only for bots getOption("animation_search_bot_username"), getOption("photo_search_bot_username"), and getOption("venue_search_bot_username") + HideViaBot bool `json:"hide_via_bot"` +} + +// Adds a message to a quick reply shortcut via inline bot. If shortcut doesn't exist and there are less than getOption("quick_reply_shortcut_count_max") shortcuts, then a new shortcut is created. The shortcut must not contain more than getOption("quick_reply_shortcut_message_count_max") messages after adding the new message. Returns the added message +func (client *Client) AddQuickReplyShortcutInlineQueryResultMessage(req *AddQuickReplyShortcutInlineQueryResultMessageRequest) (*QuickReplyMessage, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "addQuickReplyShortcutInlineQueryResultMessage", + }, + Data: map[string]interface{}{ + "shortcut_name": req.ShortcutName, + "reply_to_message_id": req.ReplyToMessageId, + "query_id": req.QueryId, + "result_id": req.ResultId, + "hide_via_bot": req.HideViaBot, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalQuickReplyMessage(result.Data) +} + +type ReaddQuickReplyShortcutMessagesRequest struct { + // Name of the target shortcut + ShortcutName string `json:"shortcut_name"` + // Identifiers of the quick reply messages to readd. Message identifiers must be in a strictly increasing order + MessageIds []int64 `json:"message_ids"` +} + +// Readds quick reply messages which failed to add. Can be called only for messages for which messageSendingStateFailed.can_retry is true and after specified in messageSendingStateFailed.retry_after time passed. If a message is readded, the corresponding failed to send message is deleted. Returns the sent messages in the same order as the message identifiers passed in message_ids. If a message can't be readded, null will be returned instead of the message +func (client *Client) ReaddQuickReplyShortcutMessages(req *ReaddQuickReplyShortcutMessagesRequest) (*QuickReplyMessages, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "readdQuickReplyShortcutMessages", + }, + Data: map[string]interface{}{ + "shortcut_name": req.ShortcutName, + "message_ids": req.MessageIds, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalQuickReplyMessages(result.Data) +} + +type EditQuickReplyMessageRequest struct { + // Unique identifier of the quick reply shortcut with the message + ShortcutId int32 `json:"shortcut_id"` + // Identifier of the message + MessageId int64 `json:"message_id"` + // New content of the message. Must be one of the following types: inputMessageText, inputMessageAnimation, inputMessageAudio, inputMessageDocument, inputMessagePhoto or inputMessageVideo + InputMessageContent InputMessageContent `json:"input_message_content"` +} + +// Asynchronously edits the text, media or caption of a quick reply message. Use quickReplyMessage.can_be_edited to check whether a message can be edited. Text message can be edited only to a text message. The type of message content in an album can't be changed with exception of replacing a photo with a video or vice versa +func (client *Client) EditQuickReplyMessage(req *EditQuickReplyMessageRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "editQuickReplyMessage", + }, + Data: map[string]interface{}{ + "shortcut_id": req.ShortcutId, + "message_id": req.MessageId, + "input_message_content": req.InputMessageContent, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + // Returns list of custom emojis, which can be used as forum topic icon by all users func (client *Client) GetForumTopicDefaultIcons() (*Stickers, error) { result, err := client.Send(Request{ @@ -6883,7 +7014,7 @@ type GetInternalLinkTypeRequest struct { Link string `json:"link"` } -// Returns information about the type of an internal link. Returns a 404 error if the link is not internal. Can be called before authorization +// Returns information about the type of internal link. Returns a 404 error if the link is not internal. Can be called before authorization func (client *Client) GetInternalLinkType(req *GetInternalLinkTypeRequest) (InternalLinkType, error) { result, err := client.Send(Request{ meta: meta{ @@ -6923,6 +7054,9 @@ func (client *Client) GetInternalLinkType(req *GetInternalLinkTypeRequest) (Inte case TypeInternalLinkTypeBotStartInGroup: return UnmarshalInternalLinkTypeBotStartInGroup(result.Data) + case TypeInternalLinkTypeBusinessChat: + return UnmarshalInternalLinkTypeBusinessChat(result.Data) + case TypeInternalLinkTypeChangePhoneNumber: return UnmarshalInternalLinkTypeChangePhoneNumber(result.Data) @@ -7332,8 +7466,8 @@ type CreateNewBasicGroupChatRequest struct { MessageAutoDeleteTime int32 `json:"message_auto_delete_time"` } -// Creates a new basic group and sends a corresponding messageBasicGroupChatCreate. Returns the newly created chat -func (client *Client) CreateNewBasicGroupChat(req *CreateNewBasicGroupChatRequest) (*Chat, error) { +// Creates a new basic group and sends a corresponding messageBasicGroupChatCreate. Returns information about the newly created chat +func (client *Client) CreateNewBasicGroupChat(req *CreateNewBasicGroupChatRequest) (*CreatedBasicGroupChat, error) { result, err := client.Send(Request{ meta: meta{ Type: "createNewBasicGroupChat", @@ -7352,7 +7486,7 @@ func (client *Client) CreateNewBasicGroupChat(req *CreateNewBasicGroupChatReques return nil, buildResponseError(result.Data) } - return UnmarshalChat(result.Data) + return UnmarshalCreatedBasicGroupChat(result.Data) } type CreateNewSupergroupChatRequest struct { @@ -8941,8 +9075,8 @@ type AddChatMemberRequest struct { ForwardLimit int32 `json:"forward_limit"` } -// Adds a new member to a chat; requires can_invite_users member right. Members can't be added to private or secret chats -func (client *Client) AddChatMember(req *AddChatMemberRequest) (*Ok, error) { +// Adds a new member to a chat; requires can_invite_users member right. Members can't be added to private or secret chats. Returns information about members that weren't added +func (client *Client) AddChatMember(req *AddChatMemberRequest) (*FailedToAddMembers, error) { result, err := client.Send(Request{ meta: meta{ Type: "addChatMember", @@ -8961,7 +9095,7 @@ func (client *Client) AddChatMember(req *AddChatMemberRequest) (*Ok, error) { return nil, buildResponseError(result.Data) } - return UnmarshalOk(result.Data) + return UnmarshalFailedToAddMembers(result.Data) } type AddChatMembersRequest struct { @@ -8971,8 +9105,8 @@ type AddChatMembersRequest struct { UserIds []int64 `json:"user_ids"` } -// Adds multiple new members to a chat; requires can_invite_users member right. Currently, this method is only available for supergroups and channels. This method can't be used to join a chat. Members can't be added to a channel if it has more than 200 members -func (client *Client) AddChatMembers(req *AddChatMembersRequest) (*Ok, error) { +// Adds multiple new members to a chat; requires can_invite_users member right. Currently, this method is only available for supergroups and channels. This method can't be used to join a chat. Members can't be added to a channel if it has more than 200 members. Returns information about members that weren't added +func (client *Client) AddChatMembers(req *AddChatMembersRequest) (*FailedToAddMembers, error) { result, err := client.Send(Request{ meta: meta{ Type: "addChatMembers", @@ -8990,7 +9124,7 @@ func (client *Client) AddChatMembers(req *AddChatMembersRequest) (*Ok, error) { return nil, buildResponseError(result.Data) } - return UnmarshalOk(result.Data) + return UnmarshalFailedToAddMembers(result.Data) } type SetChatMemberStatusRequest struct { @@ -10296,7 +10430,7 @@ type GetChatBoostFeaturesRequest struct { IsChannel bool `json:"is_channel"` } -// Returns list of features available on the first 10 chat boost levels; this is an offline request +// Returns list of features available for different chat boost levels; this is an offline request func (client *Client) GetChatBoostFeatures(req *GetChatBoostFeaturesRequest) (*ChatBoostFeatures, error) { result, err := client.Send(Request{ meta: meta{ @@ -11043,7 +11177,7 @@ type AddFileToDownloadsRequest struct { Priority int32 `json:"priority"` } -// Adds a file from a message to the list of file downloads. Download progress and completion of the download will be notified through updateFile updates. If message database is used, the list of file downloads is persistent across application restarts. The downloading is independent from download using downloadFile, i.e. it continues if downloadFile is canceled or is used to download a part of the file +// Adds a file from a message to the list of file downloads. Download progress and completion of the download will be notified through updateFile updates. If message database is used, the list of file downloads is persistent across application restarts. The downloading is independent of download using downloadFile, i.e. it continues if downloadFile is canceled or is used to download a part of the file func (client *Client) AddFileToDownloads(req *AddFileToDownloadsRequest) (*File, error) { result, err := client.Send(Request{ meta: meta{ @@ -13481,6 +13615,25 @@ func (client *Client) SearchStickers(req *SearchStickersRequest) (*Stickers, err return UnmarshalStickers(result.Data) } +// Returns greeting stickers from regular sticker sets that can be used for the start page of other users +func (client *Client) GetGreetingStickers() (*Stickers, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "getGreetingStickers", + }, + Data: map[string]interface{}{}, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalStickers(result.Data) +} + type GetPremiumStickersRequest struct { // The maximum number of stickers to be returned; 0-100 Limit int32 `json:"limit"` @@ -14909,19 +15062,19 @@ func (client *Client) SetBusinessAwayMessageSettings(req *SetBusinessAwayMessage return UnmarshalOk(result.Data) } -type SetBusinessIntroRequest struct { - // The new intro of the business; pass null to remove the intro - Intro *InputBusinessIntro `json:"intro"` +type SetBusinessStartPageRequest struct { + // The new start page of the business; pass null to remove custom start page + StartPage *InputBusinessStartPage `json:"start_page"` } -// Changes the business intro of the current user. Requires Telegram Business subscription -func (client *Client) SetBusinessIntro(req *SetBusinessIntroRequest) (*Ok, error) { +// Changes the business start page of the current user. Requires Telegram Business subscription +func (client *Client) SetBusinessStartPage(req *SetBusinessStartPageRequest) (*Ok, error) { result, err := client.Send(Request{ meta: meta{ - Type: "setBusinessIntro", + Type: "setBusinessStartPage", }, Data: map[string]interface{}{ - "intro": req.Intro, + "start_page": req.StartPage, }, }) if err != nil { @@ -14935,22 +15088,25 @@ func (client *Client) SetBusinessIntro(req *SetBusinessIntroRequest) (*Ok, error return UnmarshalOk(result.Data) } -type ChangePhoneNumberRequest struct { - // The new phone number of the user in international format +type SendPhoneNumberCodeRequest struct { + // The phone number, in international format PhoneNumber string `json:"phone_number"` // Settings for the authentication of the user's phone number; pass null to use default settings Settings *PhoneNumberAuthenticationSettings `json:"settings"` + // Type of the request for which the code is sent + Type PhoneNumberCodeType `json:"type"` } -// Changes the phone number of the user and sends an authentication code to the user's new phone number; for official Android and iOS applications only. On success, returns information about the sent code -func (client *Client) ChangePhoneNumber(req *ChangePhoneNumberRequest) (*AuthenticationCodeInfo, error) { +// Sends a code to the specified phone number. Aborts previous phone number verification if there was one. On success, returns information about the sent code +func (client *Client) SendPhoneNumberCode(req *SendPhoneNumberCodeRequest) (*AuthenticationCodeInfo, error) { result, err := client.Send(Request{ meta: meta{ - Type: "changePhoneNumber", + Type: "sendPhoneNumberCode", }, Data: map[string]interface{}{ "phone_number": req.PhoneNumber, "settings": req.Settings, + "type": req.Type, }, }) if err != nil { @@ -14964,11 +15120,37 @@ func (client *Client) ChangePhoneNumber(req *ChangePhoneNumberRequest) (*Authent return UnmarshalAuthenticationCodeInfo(result.Data) } -// Resends the authentication code sent to confirm a new phone number for the current user. Works only if the previously received authenticationCodeInfo next_code_type was not null and the server-specified timeout has passed -func (client *Client) ResendChangePhoneNumberCode() (*AuthenticationCodeInfo, error) { +type SendPhoneNumberFirebaseSmsRequest struct { + // SafetyNet Attestation API token for the Android application, or secret from push notification for the iOS application + Token string `json:"token"` +} + +// Sends Firebase Authentication SMS to the specified phone number. Works only when received a code of the type authenticationCodeTypeFirebaseAndroid or authenticationCodeTypeFirebaseIos +func (client *Client) SendPhoneNumberFirebaseSms(req *SendPhoneNumberFirebaseSmsRequest) (*Ok, error) { result, err := client.Send(Request{ meta: meta{ - Type: "resendChangePhoneNumberCode", + Type: "sendPhoneNumberFirebaseSms", + }, + Data: map[string]interface{}{ + "token": req.Token, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + +// Resends the authentication code sent to a phone number. Works only if the previously received authenticationCodeInfo next_code_type was not null and the server-specified timeout has passed +func (client *Client) ResendPhoneNumberCode() (*AuthenticationCodeInfo, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "resendPhoneNumberCode", }, Data: map[string]interface{}{}, }) @@ -14983,16 +15165,16 @@ func (client *Client) ResendChangePhoneNumberCode() (*AuthenticationCodeInfo, er return UnmarshalAuthenticationCodeInfo(result.Data) } -type CheckChangePhoneNumberCodeRequest struct { +type CheckPhoneNumberCodeRequest struct { // Authentication code to check Code string `json:"code"` } -// Checks the authentication code sent to confirm a new phone number of the user -func (client *Client) CheckChangePhoneNumberCode(req *CheckChangePhoneNumberCodeRequest) (*Ok, error) { +// Check the authentication code and completes the request for which the code was sent if appropriate +func (client *Client) CheckPhoneNumberCode(req *CheckPhoneNumberCodeRequest) (*Ok, error) { result, err := client.Send(Request{ meta: meta{ - Type: "checkChangePhoneNumberCode", + Type: "checkPhoneNumberCode", }, Data: map[string]interface{}{ "code": req.Code, @@ -15080,6 +15262,187 @@ func (client *Client) DeleteBusinessConnectedBot(req *DeleteBusinessConnectedBot return UnmarshalOk(result.Data) } +type ToggleBusinessConnectedBotChatIsPausedRequest struct { + // Chat identifier + ChatId int64 `json:"chat_id"` + // Pass true to pause the connected bot in the chat; pass false to resume the bot + IsPaused bool `json:"is_paused"` +} + +// Pauses or resumes the connected business bot in a specific chat +func (client *Client) ToggleBusinessConnectedBotChatIsPaused(req *ToggleBusinessConnectedBotChatIsPausedRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "toggleBusinessConnectedBotChatIsPaused", + }, + Data: map[string]interface{}{ + "chat_id": req.ChatId, + "is_paused": req.IsPaused, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + +type RemoveBusinessConnectedBotFromChatRequest struct { + // Chat identifier + ChatId int64 `json:"chat_id"` +} + +// Removes the connected business bot from a specific chat by adding the chat to businessRecipients.excluded_chat_ids +func (client *Client) RemoveBusinessConnectedBotFromChat(req *RemoveBusinessConnectedBotFromChatRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "removeBusinessConnectedBotFromChat", + }, + Data: map[string]interface{}{ + "chat_id": req.ChatId, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + +// Returns business chat links created for the current account +func (client *Client) GetBusinessChatLinks() (*BusinessChatLinks, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "getBusinessChatLinks", + }, + Data: map[string]interface{}{}, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalBusinessChatLinks(result.Data) +} + +type CreateBusinessChatLinkRequest struct { + // Information about the link to create + LinkInfo *InputBusinessChatLink `json:"link_info"` +} + +// Creates a business chat link for the current account. Requires Telegram Business subscription. There can be up to getOption("business_chat_link_count_max") links created. Returns the created link +func (client *Client) CreateBusinessChatLink(req *CreateBusinessChatLinkRequest) (*BusinessChatLink, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "createBusinessChatLink", + }, + Data: map[string]interface{}{ + "link_info": req.LinkInfo, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalBusinessChatLink(result.Data) +} + +type EditBusinessChatLinkRequest struct { + // The link to edit + Link string `json:"link"` + // New description of the link + LinkInfo *InputBusinessChatLink `json:"link_info"` +} + +// Edits a business chat link of the current account. Requires Telegram Business subscription. Returns the edited link +func (client *Client) EditBusinessChatLink(req *EditBusinessChatLinkRequest) (*BusinessChatLink, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "editBusinessChatLink", + }, + Data: map[string]interface{}{ + "link": req.Link, + "link_info": req.LinkInfo, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalBusinessChatLink(result.Data) +} + +type DeleteBusinessChatLinkRequest struct { + // The link to delete + Link string `json:"link"` +} + +// Deletes a business chat link of the current account +func (client *Client) DeleteBusinessChatLink(req *DeleteBusinessChatLinkRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "deleteBusinessChatLink", + }, + Data: map[string]interface{}{ + "link": req.Link, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + +type GetBusinessChatLinkInfoRequest struct { + // Name of the link + LinkName string `json:"link_name"` +} + +// Returns information about a business chat link +func (client *Client) GetBusinessChatLinkInfo(req *GetBusinessChatLinkInfoRequest) (*BusinessChatLinkInfo, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "getBusinessChatLinkInfo", + }, + Data: map[string]interface{}{ + "link_name": req.LinkName, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalBusinessChatLinkInfo(result.Data) +} + // Returns an HTTPS link, which can be used to get information about the current user func (client *Client) GetUserLink() (*UserLink, error) { result, err := client.Send(Request{ @@ -16236,6 +16599,35 @@ func (client *Client) ToggleSupergroupIsAllHistoryAvailable(req *ToggleSupergrou return UnmarshalOk(result.Data) } +type ToggleSupergroupCanHaveSponsoredMessagesRequest struct { + // The identifier of the channel + SupergroupId int64 `json:"supergroup_id"` + // The new value of can_have_sponsored_messages + CanHaveSponsoredMessages bool `json:"can_have_sponsored_messages"` +} + +// Toggles whether sponsored messages are shown in the channel chat; requires owner privileges in the channel. The chat must have at least chatBoostFeatures.min_sponsored_message_disable_boost_level boost level to disable sponsored messages +func (client *Client) ToggleSupergroupCanHaveSponsoredMessages(req *ToggleSupergroupCanHaveSponsoredMessagesRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "toggleSupergroupCanHaveSponsoredMessages", + }, + Data: map[string]interface{}{ + "supergroup_id": req.SupergroupId, + "can_have_sponsored_messages": req.CanHaveSponsoredMessages, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + type ToggleSupergroupHasHiddenMembersRequest struct { // Identifier of the supergroup SupergroupId int64 `json:"supergroup_id"` @@ -16414,7 +16806,7 @@ type GetSupergroupMembersRequest struct { Filter SupergroupMembersFilter `json:"filter"` // Number of users to skip Offset int32 `json:"offset"` - // The maximum number of users be returned; up to 200 + // The maximum number of users to be returned; up to 200 Limit int32 `json:"limit"` } @@ -17808,6 +18200,96 @@ func (client *Client) ReportMessageReactions(req *ReportMessageReactionsRequest) return UnmarshalOk(result.Data) } +type GetChatRevenueStatisticsRequest struct { + // Chat identifier + ChatId int64 `json:"chat_id"` + // Pass true if a dark theme is used by the application + IsDark bool `json:"is_dark"` +} + +// Returns detailed revenue statistics about a chat. Currently, this method can be used only for channels if supergroupFullInfo.can_get_revenue_statistics == true +func (client *Client) GetChatRevenueStatistics(req *GetChatRevenueStatisticsRequest) (*ChatRevenueStatistics, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "getChatRevenueStatistics", + }, + Data: map[string]interface{}{ + "chat_id": req.ChatId, + "is_dark": req.IsDark, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalChatRevenueStatistics(result.Data) +} + +type GetChatRevenueWithdrawalUrlRequest struct { + // Chat identifier + ChatId int64 `json:"chat_id"` + // The 2-step verification password of the current user + Password string `json:"password"` +} + +// Returns URL for chat revenue withdrawal; requires owner privileges in the chat. Currently, this method can be used only for channels if supergroupFullInfo.can_get_revenue_statistics == true and getOption("can_withdraw_chat_revenue") +func (client *Client) GetChatRevenueWithdrawalUrl(req *GetChatRevenueWithdrawalUrlRequest) (*HttpUrl, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "getChatRevenueWithdrawalUrl", + }, + Data: map[string]interface{}{ + "chat_id": req.ChatId, + "password": req.Password, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalHttpUrl(result.Data) +} + +type GetChatRevenueTransactionsRequest struct { + // Chat identifier + ChatId int64 `json:"chat_id"` + // Number of transactions to skip + Offset int32 `json:"offset"` + // The maximum number of transactions to be returned; up to 200 + Limit int32 `json:"limit"` +} + +// Returns list of revenue transactions for a chat. Currently, this method can be used only for channels if supergroupFullInfo.can_get_revenue_statistics == true +func (client *Client) GetChatRevenueTransactions(req *GetChatRevenueTransactionsRequest) (*ChatRevenueTransactions, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "getChatRevenueTransactions", + }, + Data: map[string]interface{}{ + "chat_id": req.ChatId, + "offset": req.Offset, + "limit": req.Limit, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalChatRevenueTransactions(result.Data) +} + type GetChatStatisticsRequest struct { // Chat identifier ChatId int64 `json:"chat_id"` @@ -18590,80 +19072,6 @@ func (client *Client) GetPreferredCountryLanguage(req *GetPreferredCountryLangua return UnmarshalText(result.Data) } -type SendPhoneNumberVerificationCodeRequest struct { - // The phone number of the user, in international format - PhoneNumber string `json:"phone_number"` - // Settings for the authentication of the user's phone number; pass null to use default settings - Settings *PhoneNumberAuthenticationSettings `json:"settings"` -} - -// Sends a code to verify a phone number to be added to a user's Telegram Passport -func (client *Client) SendPhoneNumberVerificationCode(req *SendPhoneNumberVerificationCodeRequest) (*AuthenticationCodeInfo, error) { - result, err := client.Send(Request{ - meta: meta{ - Type: "sendPhoneNumberVerificationCode", - }, - Data: map[string]interface{}{ - "phone_number": req.PhoneNumber, - "settings": req.Settings, - }, - }) - if err != nil { - return nil, err - } - - if result.Type == "error" { - return nil, buildResponseError(result.Data) - } - - return UnmarshalAuthenticationCodeInfo(result.Data) -} - -// Resends the code to verify a phone number to be added to a user's Telegram Passport -func (client *Client) ResendPhoneNumberVerificationCode() (*AuthenticationCodeInfo, error) { - result, err := client.Send(Request{ - meta: meta{ - Type: "resendPhoneNumberVerificationCode", - }, - Data: map[string]interface{}{}, - }) - if err != nil { - return nil, err - } - - if result.Type == "error" { - return nil, buildResponseError(result.Data) - } - - return UnmarshalAuthenticationCodeInfo(result.Data) -} - -type CheckPhoneNumberVerificationCodeRequest struct { - // Verification code to check - Code string `json:"code"` -} - -// Checks the phone number verification code for Telegram Passport -func (client *Client) CheckPhoneNumberVerificationCode(req *CheckPhoneNumberVerificationCodeRequest) (*Ok, error) { - result, err := client.Send(Request{ - meta: meta{ - Type: "checkPhoneNumberVerificationCode", - }, - Data: map[string]interface{}{ - "code": req.Code, - }, - }) - if err != nil { - return nil, err - } - - if result.Type == "error" { - return nil, buildResponseError(result.Data) - } - - return UnmarshalOk(result.Data) -} - type SendEmailAddressVerificationCodeRequest struct { // Email address EmailAddress string `json:"email_address"` @@ -18828,83 +19236,6 @@ func (client *Client) SendPassportAuthorizationForm(req *SendPassportAuthorizati return UnmarshalOk(result.Data) } -type SendPhoneNumberConfirmationCodeRequest struct { - // Hash value from the link - Hash string `json:"hash"` - // Phone number value from the link - PhoneNumber string `json:"phone_number"` - // Settings for the authentication of the user's phone number; pass null to use default settings - Settings *PhoneNumberAuthenticationSettings `json:"settings"` -} - -// Sends phone number confirmation code to handle links of the type internalLinkTypePhoneNumberConfirmation -func (client *Client) SendPhoneNumberConfirmationCode(req *SendPhoneNumberConfirmationCodeRequest) (*AuthenticationCodeInfo, error) { - result, err := client.Send(Request{ - meta: meta{ - Type: "sendPhoneNumberConfirmationCode", - }, - Data: map[string]interface{}{ - "hash": req.Hash, - "phone_number": req.PhoneNumber, - "settings": req.Settings, - }, - }) - if err != nil { - return nil, err - } - - if result.Type == "error" { - return nil, buildResponseError(result.Data) - } - - return UnmarshalAuthenticationCodeInfo(result.Data) -} - -// Resends phone number confirmation code -func (client *Client) ResendPhoneNumberConfirmationCode() (*AuthenticationCodeInfo, error) { - result, err := client.Send(Request{ - meta: meta{ - Type: "resendPhoneNumberConfirmationCode", - }, - Data: map[string]interface{}{}, - }) - if err != nil { - return nil, err - } - - if result.Type == "error" { - return nil, buildResponseError(result.Data) - } - - return UnmarshalAuthenticationCodeInfo(result.Data) -} - -type CheckPhoneNumberConfirmationCodeRequest struct { - // Confirmation code to check - Code string `json:"code"` -} - -// Checks phone number confirmation code -func (client *Client) CheckPhoneNumberConfirmationCode(req *CheckPhoneNumberConfirmationCodeRequest) (*Ok, error) { - result, err := client.Send(Request{ - meta: meta{ - Type: "checkPhoneNumberConfirmationCode", - }, - Data: map[string]interface{}{ - "code": req.Code, - }, - }) - if err != nil { - return nil, err - } - - if result.Type == "error" { - return nil, buildResponseError(result.Data) - } - - return UnmarshalOk(result.Data) -} - type SetBotUpdatesStatusRequest struct { // The number of pending updates PendingUpdateCount int32 `json:"pending_update_count"` @@ -21162,6 +21493,9 @@ func (client *Client) TestUseUpdate() (Update, error) { case TypeUpdateChatActionBar: return UnmarshalUpdateChatActionBar(result.Data) + case TypeUpdateChatBusinessBotManageBar: + return UnmarshalUpdateChatBusinessBotManageBar(result.Data) + case TypeUpdateChatAvailableReactions: return UnmarshalUpdateChatAvailableReactions(result.Data) @@ -21441,12 +21775,12 @@ func (client *Client) TestUseUpdate() (Update, error) { case TypeUpdateSuggestedActions: return UnmarshalUpdateSuggestedActions(result.Data) + case TypeUpdateSpeedLimitNotification: + return UnmarshalUpdateSpeedLimitNotification(result.Data) + case TypeUpdateContactCloseBirthdays: return UnmarshalUpdateContactCloseBirthdays(result.Data) - case TypeUpdateAddChatMembersPrivacyForbidden: - return UnmarshalUpdateAddChatMembersPrivacyForbidden(result.Data) - case TypeUpdateAutosaveSettings: return UnmarshalUpdateAutosaveSettings(result.Data) diff --git a/client/type.go b/client/type.go index 1fe1ffd..3f7c343 100755 --- a/client/type.go +++ b/client/type.go @@ -143,8 +143,11 @@ const ( ClassStatisticalGraph = "StatisticalGraph" ClassChatStatisticsObjectType = "ChatStatisticsObjectType" ClassChatStatistics = "ChatStatistics" + ClassChatRevenueWithdrawalState = "ChatRevenueWithdrawalState" + ClassChatRevenueTransactionType = "ChatRevenueTransactionType" ClassVectorPathCommand = "VectorPathCommand" ClassBotCommandScope = "BotCommandScope" + ClassPhoneNumberCodeType = "PhoneNumberCodeType" ClassUpdate = "Update" ClassLogStream = "LogStream" ClassError = "Error" @@ -198,11 +201,15 @@ const ( ClassBusinessAwayMessageSettings = "BusinessAwayMessageSettings" ClassBusinessGreetingMessageSettings = "BusinessGreetingMessageSettings" ClassBusinessConnectedBot = "BusinessConnectedBot" - ClassBusinessIntro = "BusinessIntro" - ClassInputBusinessIntro = "InputBusinessIntro" + ClassBusinessStartPage = "BusinessStartPage" + ClassInputBusinessStartPage = "InputBusinessStartPage" ClassBusinessOpeningHoursInterval = "BusinessOpeningHoursInterval" ClassBusinessOpeningHours = "BusinessOpeningHours" ClassBusinessInfo = "BusinessInfo" + ClassBusinessChatLink = "BusinessChatLink" + ClassBusinessChatLinks = "BusinessChatLinks" + ClassInputBusinessChatLink = "InputBusinessChatLink" + ClassBusinessChatLinkInfo = "BusinessChatLinkInfo" ClassChatPhotoSticker = "ChatPhotoSticker" ClassAnimatedChatPhoto = "AnimatedChatPhoto" ClassChatPhoto = "ChatPhoto" @@ -291,9 +298,13 @@ const ( ClassChatPosition = "ChatPosition" ClassSavedMessagesTag = "SavedMessagesTag" ClassSavedMessagesTags = "SavedMessagesTags" + ClassBusinessBotManageBar = "BusinessBotManageBar" ClassVideoChat = "VideoChat" ClassChat = "Chat" ClassChats = "Chats" + ClassFailedToAddMember = "FailedToAddMember" + ClassFailedToAddMembers = "FailedToAddMembers" + ClassCreatedBasicGroupChat = "CreatedBasicGroupChat" ClassChatNearby = "ChatNearby" ClassChatsNearby = "ChatsNearby" ClassKeyboardButton = "KeyboardButton" @@ -378,6 +389,7 @@ const ( ClassStoryInteraction = "StoryInteraction" ClassStoryInteractions = "StoryInteractions" ClassQuickReplyMessage = "QuickReplyMessage" + ClassQuickReplyMessages = "QuickReplyMessages" ClassQuickReplyShortcut = "QuickReplyShortcut" ClassPublicForwards = "PublicForwards" ClassChatBoostLevelFeatures = "ChatBoostLevelFeatures" @@ -489,8 +501,11 @@ const ( ClassChatStatisticsMessageSenderInfo = "ChatStatisticsMessageSenderInfo" ClassChatStatisticsAdministratorActionsInfo = "ChatStatisticsAdministratorActionsInfo" ClassChatStatisticsInviterInfo = "ChatStatisticsInviterInfo" + ClassChatRevenueStatistics = "ChatRevenueStatistics" ClassMessageStatistics = "MessageStatistics" ClassStoryStatistics = "StoryStatistics" + ClassChatRevenueTransaction = "ChatRevenueTransaction" + ClassChatRevenueTransactions = "ChatRevenueTransactions" ClassPoint = "Point" ClassUpdates = "Updates" ClassLogVerbosityLevel = "LogVerbosityLevel" @@ -615,11 +630,15 @@ const ( TypeBusinessAwayMessageSettings = "businessAwayMessageSettings" TypeBusinessGreetingMessageSettings = "businessGreetingMessageSettings" TypeBusinessConnectedBot = "businessConnectedBot" - TypeBusinessIntro = "businessIntro" - TypeInputBusinessIntro = "inputBusinessIntro" + TypeBusinessStartPage = "businessStartPage" + TypeInputBusinessStartPage = "inputBusinessStartPage" TypeBusinessOpeningHoursInterval = "businessOpeningHoursInterval" TypeBusinessOpeningHours = "businessOpeningHours" TypeBusinessInfo = "businessInfo" + TypeBusinessChatLink = "businessChatLink" + TypeBusinessChatLinks = "businessChatLinks" + TypeInputBusinessChatLink = "inputBusinessChatLink" + TypeBusinessChatLinkInfo = "businessChatLinkInfo" TypeChatPhotoStickerTypeRegularOrMask = "chatPhotoStickerTypeRegularOrMask" TypeChatPhotoStickerTypeCustomEmoji = "chatPhotoStickerTypeCustomEmoji" TypeChatPhotoSticker = "chatPhotoSticker" @@ -801,9 +820,13 @@ const ( TypeChatAvailableReactionsSome = "chatAvailableReactionsSome" TypeSavedMessagesTag = "savedMessagesTag" TypeSavedMessagesTags = "savedMessagesTags" + TypeBusinessBotManageBar = "businessBotManageBar" TypeVideoChat = "videoChat" TypeChat = "chat" TypeChats = "chats" + TypeFailedToAddMember = "failedToAddMember" + TypeFailedToAddMembers = "failedToAddMembers" + TypeCreatedBasicGroupChat = "createdBasicGroupChat" TypeChatNearby = "chatNearby" TypeChatsNearby = "chatsNearby" TypePublicChatTypeHasUsername = "publicChatTypeHasUsername" @@ -1221,6 +1244,7 @@ const ( TypeStoryInteraction = "storyInteraction" TypeStoryInteractions = "storyInteractions" TypeQuickReplyMessage = "quickReplyMessage" + TypeQuickReplyMessages = "quickReplyMessages" TypeQuickReplyShortcut = "quickReplyShortcut" TypePublicForwardMessage = "publicForwardMessage" TypePublicForwardStory = "publicForwardStory" @@ -1443,7 +1467,7 @@ const ( TypeBusinessFeatureGreetingMessage = "businessFeatureGreetingMessage" TypeBusinessFeatureAwayMessage = "businessFeatureAwayMessage" TypeBusinessFeatureAccountLinks = "businessFeatureAccountLinks" - TypeBusinessFeatureIntro = "businessFeatureIntro" + TypeBusinessFeatureStartPage = "businessFeatureStartPage" TypeBusinessFeatureBots = "businessFeatureBots" TypeBusinessFeatureEmojiStatus = "businessFeatureEmojiStatus" TypeBusinessFeatureChatFolderTags = "businessFeatureChatFolderTags" @@ -1657,6 +1681,7 @@ const ( TypeInternalLinkTypeBotAddToChannel = "internalLinkTypeBotAddToChannel" TypeInternalLinkTypeBotStart = "internalLinkTypeBotStart" TypeInternalLinkTypeBotStartInGroup = "internalLinkTypeBotStartInGroup" + TypeInternalLinkTypeBusinessChat = "internalLinkTypeBusinessChat" TypeInternalLinkTypeChangePhoneNumber = "internalLinkTypeChangePhoneNumber" TypeInternalLinkTypeChatBoost = "internalLinkTypeChatBoost" TypeInternalLinkTypeChatFolderInvite = "internalLinkTypeChatFolderInvite" @@ -1798,8 +1823,17 @@ const ( TypeChatStatisticsInviterInfo = "chatStatisticsInviterInfo" TypeChatStatisticsSupergroup = "chatStatisticsSupergroup" TypeChatStatisticsChannel = "chatStatisticsChannel" + TypeChatRevenueStatistics = "chatRevenueStatistics" TypeMessageStatistics = "messageStatistics" TypeStoryStatistics = "storyStatistics" + TypeChatRevenueWithdrawalStatePending = "chatRevenueWithdrawalStatePending" + TypeChatRevenueWithdrawalStateCompleted = "chatRevenueWithdrawalStateCompleted" + TypeChatRevenueWithdrawalStateFailed = "chatRevenueWithdrawalStateFailed" + TypeChatRevenueTransactionTypeEarnings = "chatRevenueTransactionTypeEarnings" + TypeChatRevenueTransactionTypeWithdrawal = "chatRevenueTransactionTypeWithdrawal" + TypeChatRevenueTransactionTypeRefund = "chatRevenueTransactionTypeRefund" + TypeChatRevenueTransaction = "chatRevenueTransaction" + TypeChatRevenueTransactions = "chatRevenueTransactions" TypePoint = "point" TypeVectorPathCommandLine = "vectorPathCommandLine" TypeVectorPathCommandCubicBezierCurve = "vectorPathCommandCubicBezierCurve" @@ -1810,6 +1844,9 @@ const ( TypeBotCommandScopeChat = "botCommandScopeChat" TypeBotCommandScopeChatAdministrators = "botCommandScopeChatAdministrators" TypeBotCommandScopeChatMember = "botCommandScopeChatMember" + TypePhoneNumberCodeTypeChange = "phoneNumberCodeTypeChange" + TypePhoneNumberCodeTypeVerify = "phoneNumberCodeTypeVerify" + TypePhoneNumberCodeTypeConfirmOwnership = "phoneNumberCodeTypeConfirmOwnership" TypeUpdateAuthorizationState = "updateAuthorizationState" TypeUpdateNewMessage = "updateNewMessage" TypeUpdateMessageSendAcknowledged = "updateMessageSendAcknowledged" @@ -1835,6 +1872,7 @@ const ( TypeUpdateChatReadInbox = "updateChatReadInbox" TypeUpdateChatReadOutbox = "updateChatReadOutbox" TypeUpdateChatActionBar = "updateChatActionBar" + TypeUpdateChatBusinessBotManageBar = "updateChatBusinessBotManageBar" TypeUpdateChatAvailableReactions = "updateChatAvailableReactions" TypeUpdateChatDraftMessage = "updateChatDraftMessage" TypeUpdateChatEmojiStatus = "updateChatEmojiStatus" @@ -1928,8 +1966,8 @@ const ( TypeUpdateAnimatedEmojiMessageClicked = "updateAnimatedEmojiMessageClicked" TypeUpdateAnimationSearchParameters = "updateAnimationSearchParameters" TypeUpdateSuggestedActions = "updateSuggestedActions" + TypeUpdateSpeedLimitNotification = "updateSpeedLimitNotification" TypeUpdateContactCloseBirthdays = "updateContactCloseBirthdays" - TypeUpdateAddChatMembersPrivacyForbidden = "updateAddChatMembersPrivacyForbidden" TypeUpdateAutosaveSettings = "updateAutosaveSettings" TypeUpdateBusinessConnection = "updateBusinessConnection" TypeUpdateNewBusinessMessage = "updateNewBusinessMessage" @@ -2006,7 +2044,7 @@ type StickerFormat interface { StickerFormatType() string } -// Describes type of a sticker +// Describes type of sticker type StickerType interface { StickerTypeType() string } @@ -2016,12 +2054,12 @@ type StickerFullType interface { StickerFullTypeType() string } -// Describes the type of a poll +// Describes the type of poll type PollType interface { PollTypeType() string } -// Represents the type of a user. The following types are possible: regular users, deleted users and bots +// Represents the type of user. The following types are possible: regular users, deleted users and bots type UserType interface { UserTypeType() string } @@ -2031,7 +2069,7 @@ type BusinessAwayMessageSchedule interface { BusinessAwayMessageScheduleType() string } -// Describes type of a sticker, which was used to create a chat photo +// Describes type of sticker, which was used to create a chat photo type ChatPhotoStickerType interface { ChatPhotoStickerTypeType() string } @@ -2066,7 +2104,7 @@ type SupergroupMembersFilter interface { SupergroupMembersFilterType() string } -// Describes the type of a chat to which points an invite link +// Describes the type of chat to which points an invite link type InviteLinkChatType interface { InviteLinkChatTypeType() string } @@ -2116,7 +2154,7 @@ type MessageSource interface { MessageSourceType() string } -// Describes type of a message sponsor +// Describes type of message sponsor type MessageSponsorType interface { MessageSponsorTypeType() string } @@ -2131,7 +2169,7 @@ type NotificationSettingsScope interface { NotificationSettingsScopeType() string } -// Describes the type of a chat +// Describes the type of chat type ChatType interface { ChatTypeType() string } @@ -2166,7 +2204,7 @@ type KeyboardButtonType interface { KeyboardButtonTypeType() string } -// Describes the type of an inline keyboard button +// Describes the type of inline keyboard button type InlineKeyboardButtonType interface { InlineKeyboardButtonTypeType() string } @@ -2181,7 +2219,7 @@ type LoginUrlInfo interface { LoginUrlInfoType() string } -// Describes type of a Saved Messages topic +// Describes type of Saved Messages topic type SavedMessagesTopicType interface { SavedMessagesTopicTypeType() string } @@ -2231,7 +2269,7 @@ type MessageExtendedMedia interface { MessageExtendedMediaType() string } -// Contains the type of a Telegram Passport element +// Contains the type of Telegram Passport element type PassportElementType interface { PassportElementTypeType() string } @@ -2296,17 +2334,17 @@ type UserStatus interface { UserStatusType() string } -// Describes type of an emoji category +// Describes type of emoji category type EmojiCategoryType interface { EmojiCategoryTypeType() string } -// Describes type of a clickable rectangle area on a story media +// Describes type of clickable rectangle area on a story media type StoryAreaType interface { StoryAreaTypeType() string } -// Describes type of a clickable rectangle area on a story media to be added +// Describes type of clickable rectangle area on a story media to be added type InputStoryAreaType interface { InputStoryAreaTypeType() string } @@ -2351,7 +2389,7 @@ type CallDiscardReason interface { CallDiscardReasonType() string } -// Describes the type of a call server +// Describes the type of call server type CallServerType interface { CallServerTypeType() string } @@ -2366,7 +2404,7 @@ type GroupCallVideoQuality interface { GroupCallVideoQualityType() string } -// Describes the exact type of a problem with a call +// Describes the exact type of problem with a call type CallProblem interface { CallProblemType() string } @@ -2406,7 +2444,7 @@ type InlineQueryResult interface { InlineQueryResultType() string } -// Represents a type of a button in results of inline query +// Represents a type of button in results of inline query type InlineQueryResultsButtonType interface { InlineQueryResultsButtonTypeType() string } @@ -2426,7 +2464,7 @@ type LanguagePackStringValue interface { LanguagePackStringValueType() string } -// Describes type of a limit, increased for Premium users +// Describes type of limit, increased for Premium users type PremiumLimitType interface { PremiumLimitTypeType() string } @@ -2471,7 +2509,7 @@ type BackgroundFill interface { BackgroundFillType() string } -// Describes the type of a background +// Describes the type of background type BackgroundType interface { BackgroundTypeType() string } @@ -2556,7 +2594,7 @@ type CanSendMessageToUserResult interface { CanSendMessageToUserResultType() string } -// Represents the type of a session +// Represents the type of session type SessionType interface { SessionTypeType() string } @@ -2576,17 +2614,17 @@ type InternalLinkType interface { InternalLinkTypeType() string } -// Describes a type of a block list +// Describes a type of block list type BlockList interface { BlockListType() string } -// Represents the type of a file +// Represents the type of file type FileType interface { FileTypeType() string } -// Represents the type of a network +// Represents the type of network type NetworkType interface { NetworkTypeType() string } @@ -2611,7 +2649,7 @@ type TopChatCategory interface { TopChatCategoryType() string } -// Describes the type of a URL linking to an internal Telegram entity +// Describes the type of URL linking to an internal Telegram entity type TMeUrlType interface { TMeUrlTypeType() string } @@ -2626,7 +2664,7 @@ type TextParseMode interface { TextParseModeType() string } -// Describes the type of a proxy server +// Describes the type of proxy server type ProxyType interface { ProxyTypeType() string } @@ -2636,7 +2674,7 @@ type StatisticalGraph interface { StatisticalGraphType() string } -// Describes type of an object, for which statistics are provided +// Describes type of object, for which statistics are provided type ChatStatisticsObjectType interface { ChatStatisticsObjectTypeType() string } @@ -2646,6 +2684,16 @@ type ChatStatistics interface { ChatStatisticsType() string } +// Describes state of a chat revenue withdrawal +type ChatRevenueWithdrawalState interface { + ChatRevenueWithdrawalStateType() string +} + +// Describes type of transaction for revenue earned from sponsored messages in a chat +type ChatRevenueTransactionType interface { + ChatRevenueTransactionTypeType() string +} + // Represents a vector path command type VectorPathCommand interface { VectorPathCommandType() string @@ -2656,6 +2704,11 @@ type BotCommandScope interface { BotCommandScopeType() string } +// Describes type of the request for which a code is sent to a phone number +type PhoneNumberCodeType interface { + PhoneNumberCodeTypeType() string +} + // Contains notifications about data changes type Update interface { UpdateType() string @@ -6042,61 +6095,61 @@ func (*BusinessConnectedBot) GetType() string { return TypeBusinessConnectedBot } -// Describes settings for a business account intro -type BusinessIntro struct { +// Describes settings for a business account start page +type BusinessStartPage struct { meta - // Title text of the intro + // Title text of the start page Title string `json:"title"` - // Message text of the intro + // Message text of the start page Message string `json:"message"` - // Greeting sticker of the intro; may be null if none + // Greeting sticker of the start page; may be null if none Sticker *Sticker `json:"sticker"` } -func (entity *BusinessIntro) MarshalJSON() ([]byte, error) { +func (entity *BusinessStartPage) MarshalJSON() ([]byte, error) { entity.meta.Type = entity.GetType() - type stub BusinessIntro + type stub BusinessStartPage return json.Marshal((*stub)(entity)) } -func (*BusinessIntro) GetClass() string { - return ClassBusinessIntro +func (*BusinessStartPage) GetClass() string { + return ClassBusinessStartPage } -func (*BusinessIntro) GetType() string { - return TypeBusinessIntro +func (*BusinessStartPage) GetType() string { + return TypeBusinessStartPage } -// Describes settings for a business account intro to set -type InputBusinessIntro struct { +// Describes settings for a business account start page to set +type InputBusinessStartPage struct { meta - // Title text of the intro; 0-getOption("business_intro_title_length_max") characters + // Title text of the start page; 0-getOption("business_start_page_title_length_max") characters Title string `json:"title"` - // Message text of the intro; 0-getOption("business_intro_message_length_max") characters + // Message text of the start page; 0-getOption("business_start_page_message_length_max") characters Message string `json:"message"` - // Greeting sticker of the intro; pass null if none. The sticker must belong to a sticker set and must not be a custom emoji + // Greeting sticker of the start page; pass null if none. The sticker must belong to a sticker set and must not be a custom emoji Sticker InputFile `json:"sticker"` } -func (entity *InputBusinessIntro) MarshalJSON() ([]byte, error) { +func (entity *InputBusinessStartPage) MarshalJSON() ([]byte, error) { entity.meta.Type = entity.GetType() - type stub InputBusinessIntro + type stub InputBusinessStartPage return json.Marshal((*stub)(entity)) } -func (*InputBusinessIntro) GetClass() string { - return ClassInputBusinessIntro +func (*InputBusinessStartPage) GetClass() string { + return ClassInputBusinessStartPage } -func (*InputBusinessIntro) GetType() string { - return TypeInputBusinessIntro +func (*InputBusinessStartPage) GetType() string { + return TypeInputBusinessStartPage } -func (inputBusinessIntro *InputBusinessIntro) UnmarshalJSON(data []byte) error { +func (inputBusinessStartPage *InputBusinessStartPage) UnmarshalJSON(data []byte) error { var tmp struct { Title string `json:"title"` Message string `json:"message"` @@ -6108,11 +6161,11 @@ func (inputBusinessIntro *InputBusinessIntro) UnmarshalJSON(data []byte) error { return err } - inputBusinessIntro.Title = tmp.Title - inputBusinessIntro.Message = tmp.Message + inputBusinessStartPage.Title = tmp.Title + inputBusinessStartPage.Message = tmp.Message fieldSticker, _ := UnmarshalInputFile(tmp.Sticker) - inputBusinessIntro.Sticker = fieldSticker + inputBusinessStartPage.Sticker = fieldSticker return nil } @@ -6178,8 +6231,8 @@ type BusinessInfo struct { GreetingMessageSettings *BusinessGreetingMessageSettings `json:"greeting_message_settings"` // The away message; may be null if none or the Business account is not of the current user AwayMessageSettings *BusinessAwayMessageSettings `json:"away_message_settings"` - // Information about intro of the business; may be null if none - Intro *BusinessIntro `json:"intro"` + // Information about start page of the account; may be null if none + StartPage *BusinessStartPage `json:"start_page"` } func (entity *BusinessInfo) MarshalJSON() ([]byte, error) { @@ -6198,6 +6251,108 @@ func (*BusinessInfo) GetType() string { return TypeBusinessInfo } +// Contains information about a business chat link +type BusinessChatLink struct { + meta + // The HTTPS link + Link string `json:"link"` + // Message draft text that will be added to the input field + Text *FormattedText `json:"text"` + // Link title + Title string `json:"title"` + // Number of times the link was used + ViewCount int32 `json:"view_count"` +} + +func (entity *BusinessChatLink) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub BusinessChatLink + + return json.Marshal((*stub)(entity)) +} + +func (*BusinessChatLink) GetClass() string { + return ClassBusinessChatLink +} + +func (*BusinessChatLink) GetType() string { + return TypeBusinessChatLink +} + +// Contains a list of business chat links created by the user +type BusinessChatLinks struct { + meta + // List of links + Links []*BusinessChatLink `json:"links"` +} + +func (entity *BusinessChatLinks) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub BusinessChatLinks + + return json.Marshal((*stub)(entity)) +} + +func (*BusinessChatLinks) GetClass() string { + return ClassBusinessChatLinks +} + +func (*BusinessChatLinks) GetType() string { + return TypeBusinessChatLinks +} + +// Describes a business chat link to create or edit +type InputBusinessChatLink struct { + meta + // Message draft text that will be added to the input field + Text *FormattedText `json:"text"` + // Link title + Title string `json:"title"` +} + +func (entity *InputBusinessChatLink) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub InputBusinessChatLink + + return json.Marshal((*stub)(entity)) +} + +func (*InputBusinessChatLink) GetClass() string { + return ClassInputBusinessChatLink +} + +func (*InputBusinessChatLink) GetType() string { + return TypeInputBusinessChatLink +} + +// Contains information about a business chat link +type BusinessChatLinkInfo struct { + meta + // Identifier of the private chat that created the link + ChatId int64 `json:"chat_id"` + // Message draft text that must be added to the input field + Text *FormattedText `json:"text"` +} + +func (entity *BusinessChatLinkInfo) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub BusinessChatLinkInfo + + return json.Marshal((*stub)(entity)) +} + +func (*BusinessChatLinkInfo) GetClass() string { + return ClassBusinessChatLinkInfo +} + +func (*BusinessChatLinkInfo) GetType() string { + return TypeBusinessChatLinkInfo +} + // Information about the sticker, which was used to create the chat photo type ChatPhotoStickerTypeRegularOrMask struct { meta @@ -8971,10 +9126,14 @@ type SupergroupFullInfo struct { CanSetLocation bool `json:"can_set_location"` // True, if the supergroup or channel statistics are available CanGetStatistics bool `json:"can_get_statistics"` + // True, if the supergroup or channel revenue statistics are available + CanGetRevenueStatistics bool `json:"can_get_revenue_statistics"` // True, if aggressive anti-spam checks can be enabled or disabled in the supergroup CanToggleAggressiveAntiSpam bool `json:"can_toggle_aggressive_anti_spam"` // True, if new chat members will have access to old messages. In public, discussion, of forum groups and all channels, old messages are always available, so this option affects only private non-forum supergroups without a linked chat. The value of this field is only available to chat administrators IsAllHistoryAvailable bool `json:"is_all_history_available"` + // True, if the chat can have sponsored messages. The value of this field is only available to the owner of the chat + CanHaveSponsoredMessages bool `json:"can_have_sponsored_messages"` // True, if aggressive anti-spam checks are enabled in the supergroup. The value of this field is only available to chat administrators HasAggressiveAntiSpamEnabled bool `json:"has_aggressive_anti_spam_enabled"` // True, if the supergroup or channel has pinned stories @@ -9727,7 +9886,7 @@ type MessageForwardInfo struct { Date int32 `json:"date"` // For messages forwarded to the chat with the current user (Saved Messages), to the Replies bot chat, or to the channel's discussion group, information about the source message from which the message was forwarded last time; may be null for other forwards or if unknown Source *ForwardSource `json:"source"` - // The type of a public service announcement for the forwarded message + // The type of public service announcement for the forwarded message PublicServiceAnnouncementType string `json:"public_service_announcement_type"` } @@ -10371,7 +10530,7 @@ type Message struct { SenderBoostCount int32 `json:"sender_boost_count"` // For channel posts and anonymous group messages, optional author signature AuthorSignature string `json:"author_signature"` - // Unique identifier of an album this message belongs to. Only audios, documents, photos and videos can be grouped together in albums + // Unique identifier of an album this message belongs to; 0 if none. Only audios, documents, photos and videos can be grouped together in albums MediaAlbumId JsonInt64 `json:"media_album_id"` // If non-empty, contains a human-readable description of the reason why access to this message must be restricted RestrictionReason string `json:"restriction_reason"` @@ -11930,7 +12089,7 @@ type ChatFolder struct { Title string `json:"title"` // The chosen icon for the chat folder; may be null. If null, use getChatFolderDefaultIconName to get default icon name for the folder Icon *ChatFolderIcon `json:"icon"` - // The identifier of the chosen color for the chat folder icon; from -1 to 6. If -1, then color is didabled. Can't be changed if folder tags are disabled or the current user doesn't have Telegram Premium subscription + // The identifier of the chosen color for the chat folder icon; from -1 to 6. If -1, then color is disabled. Can't be changed if folder tags are disabled or the current user doesn't have Telegram Premium subscription ColorId int32 `json:"color_id"` // True, if at least one link has been created for the folder IsShareable bool `json:"is_shareable"` @@ -11983,7 +12142,7 @@ type ChatFolderInfo struct { Title string `json:"title"` // The chosen or default icon for the chat folder Icon *ChatFolderIcon `json:"icon"` - // The identifier of the chosen color for the chat folder icon; from -1 to 6. If -1, then color is didabled + // The identifier of the chosen color for the chat folder icon; from -1 to 6. If -1, then color is disabled ColorId int32 `json:"color_id"` // True, if at least one link has been created for the folder IsShareable bool `json:"is_shareable"` @@ -12522,6 +12681,35 @@ func (*SavedMessagesTags) GetType() string { return TypeSavedMessagesTags } +// Contains information about a business bot that manages the chat +type BusinessBotManageBar struct { + meta + // User identifier of the bot + BotUserId int64 `json:"bot_user_id"` + // URL to be opened to manage the bot + ManageUrl string `json:"manage_url"` + // True, if the bot is paused. Use toggleBusinessConnectedBotChatIsPaused to change the value of the field + IsBotPaused bool `json:"is_bot_paused"` + // True, if the bot can reply + CanBotReply bool `json:"can_bot_reply"` +} + +func (entity *BusinessBotManageBar) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub BusinessBotManageBar + + return json.Marshal((*stub)(entity)) +} + +func (*BusinessBotManageBar) GetClass() string { + return ClassBusinessBotManageBar +} + +func (*BusinessBotManageBar) GetType() string { + return TypeBusinessBotManageBar +} + // Describes a video chat type VideoChat struct { meta @@ -12643,6 +12831,8 @@ type Chat struct { ThemeName string `json:"theme_name"` // Information about actions which must be possible to do through the chat action bar; may be null if none ActionBar ChatActionBar `json:"action_bar"` + // Information about bar for managing a business bot in the chat; may be null if none + BusinessBotManageBar *BusinessBotManageBar `json:"business_bot_manage_bar"` // Information about video chat of the chat VideoChat *VideoChat `json:"video_chat"` // Information about pending join requests; may be null if none @@ -12708,6 +12898,7 @@ func (chat *Chat) UnmarshalJSON(data []byte) error { Background *ChatBackground `json:"background"` ThemeName string `json:"theme_name"` ActionBar json.RawMessage `json:"action_bar"` + BusinessBotManageBar *BusinessBotManageBar `json:"business_bot_manage_bar"` VideoChat *VideoChat `json:"video_chat"` PendingJoinRequests *ChatJoinRequestsInfo `json:"pending_join_requests"` ReplyMarkupMessageId int64 `json:"reply_markup_message_id"` @@ -12749,6 +12940,7 @@ func (chat *Chat) UnmarshalJSON(data []byte) error { chat.EmojiStatus = tmp.EmojiStatus chat.Background = tmp.Background chat.ThemeName = tmp.ThemeName + chat.BusinessBotManageBar = tmp.BusinessBotManageBar chat.VideoChat = tmp.VideoChat chat.PendingJoinRequests = tmp.PendingJoinRequests chat.ReplyMarkupMessageId = tmp.ReplyMarkupMessageId @@ -12801,6 +12993,81 @@ func (*Chats) GetType() string { return TypeChats } +// Contains information about a user that has failed to be added to a chat +type FailedToAddMember struct { + meta + // User identifier + UserId int64 `json:"user_id"` + // True, if subscription to Telegram Premium would have allowed to add the user to the chat + PremiumWouldAllowInvite bool `json:"premium_would_allow_invite"` + // True, if subscription to Telegram Premium is required to send the user chat invite link + PremiumRequiredToSendMessages bool `json:"premium_required_to_send_messages"` +} + +func (entity *FailedToAddMember) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub FailedToAddMember + + return json.Marshal((*stub)(entity)) +} + +func (*FailedToAddMember) GetClass() string { + return ClassFailedToAddMember +} + +func (*FailedToAddMember) GetType() string { + return TypeFailedToAddMember +} + +// Represents a list of users that has failed to be added to a chat +type FailedToAddMembers struct { + meta + // Information about users that weren't added to the chat + FailedToAddMembers []*FailedToAddMember `json:"failed_to_add_members"` +} + +func (entity *FailedToAddMembers) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub FailedToAddMembers + + return json.Marshal((*stub)(entity)) +} + +func (*FailedToAddMembers) GetClass() string { + return ClassFailedToAddMembers +} + +func (*FailedToAddMembers) GetType() string { + return TypeFailedToAddMembers +} + +// Contains information about a newly created basic group chat +type CreatedBasicGroupChat struct { + meta + // Chat identifier + ChatId int64 `json:"chat_id"` + // Information about failed to add members + FailedToAddMembers *FailedToAddMembers `json:"failed_to_add_members"` +} + +func (entity *CreatedBasicGroupChat) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub CreatedBasicGroupChat + + return json.Marshal((*stub)(entity)) +} + +func (*CreatedBasicGroupChat) GetClass() string { + return ClassCreatedBasicGroupChat +} + +func (*CreatedBasicGroupChat) GetType() string { + return TypeCreatedBasicGroupChat +} + // Describes a chat located nearby type ChatNearby struct { meta @@ -20845,7 +21112,7 @@ func (*MessageVideoChatEnded) MessageContentType() string { return TypeMessageVideoChatEnded } -// A message with information about an invite to a video chat +// A message with information about an invitation to a video chat type MessageInviteVideoChatParticipants struct { meta // Identifier of the video chat. The video chat can be received through the method getGroupCall @@ -26657,11 +26924,11 @@ type QuickReplyMessage struct { SendingState MessageSendingState `json:"sending_state"` // True, if the message can be edited CanBeEdited bool `json:"can_be_edited"` - // Information about the identifier of the quick reply message to which the message replies + // The identifier of the quick reply message to which the message replies; 0 if none ReplyToMessageId int64 `json:"reply_to_message_id"` // If non-zero, the user identifier of the bot through which this message was sent ViaBotUserId int64 `json:"via_bot_user_id"` - // Unique identifier of an album this message belongs to. Only audios, documents, photos and videos can be grouped together in albums + // Unique identifier of an album this message belongs to; 0 if none. Only audios, documents, photos and videos can be grouped together in albums MediaAlbumId JsonInt64 `json:"media_album_id"` // Content of the message Content MessageContent `json:"content"` @@ -26720,6 +26987,29 @@ func (quickReplyMessage *QuickReplyMessage) UnmarshalJSON(data []byte) error { return nil } +// Contains a list of quick reply messages +type QuickReplyMessages struct { + meta + // List of quick reply messages; messages may be null + Messages []*QuickReplyMessage `json:"messages"` +} + +func (entity *QuickReplyMessages) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub QuickReplyMessages + + return json.Marshal((*stub)(entity)) +} + +func (*QuickReplyMessages) GetClass() string { + return ClassQuickReplyMessages +} + +func (*QuickReplyMessages) GetType() string { + return TypeQuickReplyMessages +} + // Describes a shortcut that can be used for a quick reply type QuickReplyShortcut struct { meta @@ -26880,6 +27170,8 @@ type ChatBoostLevelFeatures struct { CanSetCustomEmojiStickerSet bool `json:"can_set_custom_emoji_sticker_set"` // True, if speech recognition can be used for video note and voice note messages by all users CanRecognizeSpeech bool `json:"can_recognize_speech"` + // True, if sponsored messages can be disabled in the chat + CanDisableSponsoredMessages bool `json:"can_disable_sponsored_messages"` } func (entity *ChatBoostLevelFeatures) MarshalJSON() ([]byte, error) { @@ -26917,6 +27209,8 @@ type ChatBoostFeatures struct { MinCustomEmojiStickerSetBoostLevel int32 `json:"min_custom_emoji_sticker_set_boost_level"` // The minimum boost level allowing to recognize speech in video note and voice note messages for non-Premium users; for supergroup chats only MinSpeechRecognitionBoostLevel int32 `json:"min_speech_recognition_boost_level"` + // The minimum boost level allowing to disable sponsored messages in the chat; for channel chats only + MinSponsoredMessageDisableBoostLevel int32 `json:"min_sponsored_message_disable_boost_level"` } func (entity *ChatBoostFeatures) MarshalJSON() ([]byte, error) { @@ -27620,6 +27914,8 @@ type CallStateReady struct { Emojis []string `json:"emojis"` // True, if peer-to-peer connection is allowed by users privacy settings AllowP2p bool `json:"allow_p2p"` + // Custom JSON-encoded call parameters to be passed to tgcalls + CustomParameters string `json:"custom_parameters"` } func (entity *CallStateReady) MarshalJSON() ([]byte, error) { @@ -33995,29 +34291,29 @@ func (*BusinessFeatureAccountLinks) BusinessFeatureType() string { return TypeBusinessFeatureAccountLinks } -// The ability to customize intro -type BusinessFeatureIntro struct{ +// The ability to customize start page +type BusinessFeatureStartPage struct{ meta } -func (entity *BusinessFeatureIntro) MarshalJSON() ([]byte, error) { +func (entity *BusinessFeatureStartPage) MarshalJSON() ([]byte, error) { entity.meta.Type = entity.GetType() - type stub BusinessFeatureIntro + type stub BusinessFeatureStartPage return json.Marshal((*stub)(entity)) } -func (*BusinessFeatureIntro) GetClass() string { +func (*BusinessFeatureStartPage) GetClass() string { return ClassBusinessFeature } -func (*BusinessFeatureIntro) GetType() string { - return TypeBusinessFeatureIntro +func (*BusinessFeatureStartPage) GetType() string { + return TypeBusinessFeatureStartPage } -func (*BusinessFeatureIntro) BusinessFeatureType() string { - return TypeBusinessFeatureIntro +func (*BusinessFeatureStartPage) BusinessFeatureType() string { + return TypeBusinessFeatureStartPage } // The ability to connect a bot to the account @@ -40207,6 +40503,33 @@ func (*InternalLinkTypeBotStartInGroup) InternalLinkTypeType() string { return TypeInternalLinkTypeBotStartInGroup } +// The link is a link to a business chat. Use getBusinessChatLinkInfo with the provided link name to get information about the link, then open received private chat and replace chat draft with the provided text +type InternalLinkTypeBusinessChat struct { + meta + // Name of the link + LinkName string `json:"link_name"` +} + +func (entity *InternalLinkTypeBusinessChat) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub InternalLinkTypeBusinessChat + + return json.Marshal((*stub)(entity)) +} + +func (*InternalLinkTypeBusinessChat) GetClass() string { + return ClassInternalLinkType +} + +func (*InternalLinkTypeBusinessChat) GetType() string { + return TypeInternalLinkTypeBusinessChat +} + +func (*InternalLinkTypeBusinessChat) InternalLinkTypeType() string { + return TypeInternalLinkTypeBusinessChat +} + // The link is a link to the change phone number section of the app type InternalLinkTypeChangePhoneNumber struct{ meta @@ -40616,7 +40939,7 @@ func (*InternalLinkTypePassportDataRequest) InternalLinkTypeType() string { return TypeInternalLinkTypePassportDataRequest } -// The link can be used to confirm ownership of a phone number to prevent account deletion. Call sendPhoneNumberConfirmationCode with the given hash and phone number to process the link. If succeeded, call checkPhoneNumberConfirmationCode to check entered by the user code, or resendPhoneNumberConfirmationCode to resend it +// The link can be used to confirm ownership of a phone number to prevent account deletion. Call sendPhoneNumberCode with the given phone number and with phoneNumberCodeTypeConfirmOwnership with the given hash to process the link. If succeeded, call checkPhoneNumberCode to check entered by the user code, or resendPhoneNumberCode to resend it type InternalLinkTypePhoneNumberConfirmation struct { meta // Hash value from the link @@ -40803,11 +41126,13 @@ func (internalLinkTypeProxy *InternalLinkTypeProxy) UnmarshalJSON(data []byte) e return nil } -// The link is a link to a chat by its username. Call searchPublicChat with the given chat username to process the link If the chat is found, open its profile information screen or the chat itself +// The link is a link to a chat by its username. Call searchPublicChat with the given chat username to process the link If the chat is found, open its profile information screen or the chat itself. If draft text isn't empty and the chat is a private chat, then put the draft text in the input field type InternalLinkTypePublicChat struct { meta // Username of the chat ChatUsername string `json:"chat_username"` + // Draft text for message to send in the chat + DraftText string `json:"draft_text"` } func (entity *InternalLinkTypePublicChat) MarshalJSON() ([]byte, error) { @@ -41096,11 +41421,13 @@ func (*InternalLinkTypeUnsupportedProxy) InternalLinkTypeType() string { return TypeInternalLinkTypeUnsupportedProxy } -// The link is a link to a user by its phone number. Call searchUserByPhoneNumber with the given phone number to process the link. If the user is found, then call createPrivateChat and open the chat +// The link is a link to a user by its phone number. Call searchUserByPhoneNumber with the given phone number to process the link. If the user is found, then call createPrivateChat and open the chat. If draft text isn't empty, then put the draft text in the input field type InternalLinkTypeUserPhoneNumber struct { meta // Phone number of the user PhoneNumber string `json:"phone_number"` + // Draft text for message to send in the chat + DraftText string `json:"draft_text"` } func (entity *InternalLinkTypeUserPhoneNumber) MarshalJSON() ([]byte, error) { @@ -44347,6 +44674,72 @@ func (chatStatisticsChannel *ChatStatisticsChannel) UnmarshalJSON(data []byte) e return nil } +// A detailed statistics about revenue earned from sponsored messages in a chat +type ChatRevenueStatistics struct { + meta + // A graph containing amount of revenue in a given hour + RevenueByHourGraph StatisticalGraph `json:"revenue_by_hour_graph"` + // A graph containing amount of revenue + RevenueGraph StatisticalGraph `json:"revenue_graph"` + // Cryptocurrency in which revenue is calculated + Cryptocurrency string `json:"cryptocurrency"` + // Total amount of the cryptocurrency earned, in the smallest units of the cryptocurrency + CryptocurrencyTotalAmount JsonInt64 `json:"cryptocurrency_total_amount"` + // Amount of the cryptocurrency that isn't withdrawn yet, in the smallest units of the cryptocurrency + CryptocurrencyBalanceAmount JsonInt64 `json:"cryptocurrency_balance_amount"` + // Amount of the cryptocurrency available for withdrawal, in the smallest units of the cryptocurrency + CryptocurrencyAvailableAmount JsonInt64 `json:"cryptocurrency_available_amount"` + // Current conversion rate of the cryptocurrency to USD + UsdRate float64 `json:"usd_rate"` +} + +func (entity *ChatRevenueStatistics) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ChatRevenueStatistics + + return json.Marshal((*stub)(entity)) +} + +func (*ChatRevenueStatistics) GetClass() string { + return ClassChatRevenueStatistics +} + +func (*ChatRevenueStatistics) GetType() string { + return TypeChatRevenueStatistics +} + +func (chatRevenueStatistics *ChatRevenueStatistics) UnmarshalJSON(data []byte) error { + var tmp struct { + RevenueByHourGraph json.RawMessage `json:"revenue_by_hour_graph"` + RevenueGraph json.RawMessage `json:"revenue_graph"` + Cryptocurrency string `json:"cryptocurrency"` + CryptocurrencyTotalAmount JsonInt64 `json:"cryptocurrency_total_amount"` + CryptocurrencyBalanceAmount JsonInt64 `json:"cryptocurrency_balance_amount"` + CryptocurrencyAvailableAmount JsonInt64 `json:"cryptocurrency_available_amount"` + UsdRate float64 `json:"usd_rate"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + chatRevenueStatistics.Cryptocurrency = tmp.Cryptocurrency + chatRevenueStatistics.CryptocurrencyTotalAmount = tmp.CryptocurrencyTotalAmount + chatRevenueStatistics.CryptocurrencyBalanceAmount = tmp.CryptocurrencyBalanceAmount + chatRevenueStatistics.CryptocurrencyAvailableAmount = tmp.CryptocurrencyAvailableAmount + chatRevenueStatistics.UsdRate = tmp.UsdRate + + fieldRevenueByHourGraph, _ := UnmarshalStatisticalGraph(tmp.RevenueByHourGraph) + chatRevenueStatistics.RevenueByHourGraph = fieldRevenueByHourGraph + + fieldRevenueGraph, _ := UnmarshalStatisticalGraph(tmp.RevenueGraph) + chatRevenueStatistics.RevenueGraph = fieldRevenueGraph + + return nil +} + // A detailed statistics about a message type MessageStatistics struct { meta @@ -44437,6 +44830,268 @@ func (storyStatistics *StoryStatistics) UnmarshalJSON(data []byte) error { return nil } +// Withdrawal is pending +type ChatRevenueWithdrawalStatePending struct{ + meta +} + +func (entity *ChatRevenueWithdrawalStatePending) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ChatRevenueWithdrawalStatePending + + return json.Marshal((*stub)(entity)) +} + +func (*ChatRevenueWithdrawalStatePending) GetClass() string { + return ClassChatRevenueWithdrawalState +} + +func (*ChatRevenueWithdrawalStatePending) GetType() string { + return TypeChatRevenueWithdrawalStatePending +} + +func (*ChatRevenueWithdrawalStatePending) ChatRevenueWithdrawalStateType() string { + return TypeChatRevenueWithdrawalStatePending +} + +// Withdrawal was completed +type ChatRevenueWithdrawalStateCompleted struct { + meta + // Point in time (Unix timestamp) when the withdrawal was completed + Date int32 `json:"date"` + // The URL where the withdrawal transaction can be viewed + Url string `json:"url"` +} + +func (entity *ChatRevenueWithdrawalStateCompleted) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ChatRevenueWithdrawalStateCompleted + + return json.Marshal((*stub)(entity)) +} + +func (*ChatRevenueWithdrawalStateCompleted) GetClass() string { + return ClassChatRevenueWithdrawalState +} + +func (*ChatRevenueWithdrawalStateCompleted) GetType() string { + return TypeChatRevenueWithdrawalStateCompleted +} + +func (*ChatRevenueWithdrawalStateCompleted) ChatRevenueWithdrawalStateType() string { + return TypeChatRevenueWithdrawalStateCompleted +} + +// Withdrawal has_failed +type ChatRevenueWithdrawalStateFailed struct{ + meta +} + +func (entity *ChatRevenueWithdrawalStateFailed) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ChatRevenueWithdrawalStateFailed + + return json.Marshal((*stub)(entity)) +} + +func (*ChatRevenueWithdrawalStateFailed) GetClass() string { + return ClassChatRevenueWithdrawalState +} + +func (*ChatRevenueWithdrawalStateFailed) GetType() string { + return TypeChatRevenueWithdrawalStateFailed +} + +func (*ChatRevenueWithdrawalStateFailed) ChatRevenueWithdrawalStateType() string { + return TypeChatRevenueWithdrawalStateFailed +} + +// Describes earnings from sponsored messages in a chat in some time frame +type ChatRevenueTransactionTypeEarnings struct { + meta + // Point in time (Unix timestamp) when the earnings started + StartDate int32 `json:"start_date"` + // Point in time (Unix timestamp) when the earnings ended + EndDate int32 `json:"end_date"` +} + +func (entity *ChatRevenueTransactionTypeEarnings) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ChatRevenueTransactionTypeEarnings + + return json.Marshal((*stub)(entity)) +} + +func (*ChatRevenueTransactionTypeEarnings) GetClass() string { + return ClassChatRevenueTransactionType +} + +func (*ChatRevenueTransactionTypeEarnings) GetType() string { + return TypeChatRevenueTransactionTypeEarnings +} + +func (*ChatRevenueTransactionTypeEarnings) ChatRevenueTransactionTypeType() string { + return TypeChatRevenueTransactionTypeEarnings +} + +// Describes a withdrawal of earnings +type ChatRevenueTransactionTypeWithdrawal struct { + meta + // Point in time (Unix timestamp) when the earnings withdrawal started + WithdrawalDate int32 `json:"withdrawal_date"` + // Name of the payment provider + Provider string `json:"provider"` + // State of the withdrawal + State ChatRevenueWithdrawalState `json:"state"` +} + +func (entity *ChatRevenueTransactionTypeWithdrawal) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ChatRevenueTransactionTypeWithdrawal + + return json.Marshal((*stub)(entity)) +} + +func (*ChatRevenueTransactionTypeWithdrawal) GetClass() string { + return ClassChatRevenueTransactionType +} + +func (*ChatRevenueTransactionTypeWithdrawal) GetType() string { + return TypeChatRevenueTransactionTypeWithdrawal +} + +func (*ChatRevenueTransactionTypeWithdrawal) ChatRevenueTransactionTypeType() string { + return TypeChatRevenueTransactionTypeWithdrawal +} + +func (chatRevenueTransactionTypeWithdrawal *ChatRevenueTransactionTypeWithdrawal) UnmarshalJSON(data []byte) error { + var tmp struct { + WithdrawalDate int32 `json:"withdrawal_date"` + Provider string `json:"provider"` + State json.RawMessage `json:"state"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + chatRevenueTransactionTypeWithdrawal.WithdrawalDate = tmp.WithdrawalDate + chatRevenueTransactionTypeWithdrawal.Provider = tmp.Provider + + fieldState, _ := UnmarshalChatRevenueWithdrawalState(tmp.State) + chatRevenueTransactionTypeWithdrawal.State = fieldState + + return nil +} + +// Describes a refund for failed withdrawal of earnings +type ChatRevenueTransactionTypeRefund struct { + meta + // Point in time (Unix timestamp) when the transaction was refunded + RefundDate int32 `json:"refund_date"` + // Name of the payment provider + Provider string `json:"provider"` +} + +func (entity *ChatRevenueTransactionTypeRefund) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ChatRevenueTransactionTypeRefund + + return json.Marshal((*stub)(entity)) +} + +func (*ChatRevenueTransactionTypeRefund) GetClass() string { + return ClassChatRevenueTransactionType +} + +func (*ChatRevenueTransactionTypeRefund) GetType() string { + return TypeChatRevenueTransactionTypeRefund +} + +func (*ChatRevenueTransactionTypeRefund) ChatRevenueTransactionTypeType() string { + return TypeChatRevenueTransactionTypeRefund +} + +// Contains a chat revenue transactions +type ChatRevenueTransaction struct { + meta + // Cryptocurrency in which revenue is calculated + Cryptocurrency string `json:"cryptocurrency"` + // The withdrawn amount, in the smallest units of the cryptocurrency + CryptocurrencyAmount JsonInt64 `json:"cryptocurrency_amount"` + // Type of the transaction + Type ChatRevenueTransactionType `json:"type"` +} + +func (entity *ChatRevenueTransaction) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ChatRevenueTransaction + + return json.Marshal((*stub)(entity)) +} + +func (*ChatRevenueTransaction) GetClass() string { + return ClassChatRevenueTransaction +} + +func (*ChatRevenueTransaction) GetType() string { + return TypeChatRevenueTransaction +} + +func (chatRevenueTransaction *ChatRevenueTransaction) UnmarshalJSON(data []byte) error { + var tmp struct { + Cryptocurrency string `json:"cryptocurrency"` + CryptocurrencyAmount JsonInt64 `json:"cryptocurrency_amount"` + Type json.RawMessage `json:"type"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + chatRevenueTransaction.Cryptocurrency = tmp.Cryptocurrency + chatRevenueTransaction.CryptocurrencyAmount = tmp.CryptocurrencyAmount + + fieldType, _ := UnmarshalChatRevenueTransactionType(tmp.Type) + chatRevenueTransaction.Type = fieldType + + return nil +} + +// Contains a list of chat revenue transactions +type ChatRevenueTransactions struct { + meta + // Total number of transactions + TotalCount int32 `json:"total_count"` + // List of transactions + Transactions []*ChatRevenueTransaction `json:"transactions"` +} + +func (entity *ChatRevenueTransactions) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ChatRevenueTransactions + + return json.Marshal((*stub)(entity)) +} + +func (*ChatRevenueTransactions) GetClass() string { + return ClassChatRevenueTransactions +} + +func (*ChatRevenueTransactions) GetType() string { + return TypeChatRevenueTransactions +} + // A point on a Cartesian plane type Point struct { meta @@ -44703,6 +45358,83 @@ func (*BotCommandScopeChatMember) BotCommandScopeType() string { return TypeBotCommandScopeChatMember } +// Checks ownership of a new phone number to change the user's authentication phone number; for official Android and iOS applications only. +type PhoneNumberCodeTypeChange struct{ + meta +} + +func (entity *PhoneNumberCodeTypeChange) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub PhoneNumberCodeTypeChange + + return json.Marshal((*stub)(entity)) +} + +func (*PhoneNumberCodeTypeChange) GetClass() string { + return ClassPhoneNumberCodeType +} + +func (*PhoneNumberCodeTypeChange) GetType() string { + return TypePhoneNumberCodeTypeChange +} + +func (*PhoneNumberCodeTypeChange) PhoneNumberCodeTypeType() string { + return TypePhoneNumberCodeTypeChange +} + +// Verifies ownership of a phone number to be added to the user's Telegram Passport +type PhoneNumberCodeTypeVerify struct{ + meta +} + +func (entity *PhoneNumberCodeTypeVerify) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub PhoneNumberCodeTypeVerify + + return json.Marshal((*stub)(entity)) +} + +func (*PhoneNumberCodeTypeVerify) GetClass() string { + return ClassPhoneNumberCodeType +} + +func (*PhoneNumberCodeTypeVerify) GetType() string { + return TypePhoneNumberCodeTypeVerify +} + +func (*PhoneNumberCodeTypeVerify) PhoneNumberCodeTypeType() string { + return TypePhoneNumberCodeTypeVerify +} + +// Confirms ownership of a phone number to prevent account deletion while handling links of the type internalLinkTypePhoneNumberConfirmation +type PhoneNumberCodeTypeConfirmOwnership struct { + meta + // Hash value from the link + Hash string `json:"hash"` +} + +func (entity *PhoneNumberCodeTypeConfirmOwnership) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub PhoneNumberCodeTypeConfirmOwnership + + return json.Marshal((*stub)(entity)) +} + +func (*PhoneNumberCodeTypeConfirmOwnership) GetClass() string { + return ClassPhoneNumberCodeType +} + +func (*PhoneNumberCodeTypeConfirmOwnership) GetType() string { + return TypePhoneNumberCodeTypeConfirmOwnership +} + +func (*PhoneNumberCodeTypeConfirmOwnership) PhoneNumberCodeTypeType() string { + return TypePhoneNumberCodeTypeConfirmOwnership +} + // The user authorization state has changed type UpdateAuthorizationState struct { meta @@ -45567,6 +46299,35 @@ func (updateChatActionBar *UpdateChatActionBar) UnmarshalJSON(data []byte) error return nil } +// The bar for managing business bot was changed in a chat +type UpdateChatBusinessBotManageBar struct { + meta + // Chat identifier + ChatId int64 `json:"chat_id"` + // The new value of the business bot manage bar; may be null + BusinessBotManageBar *BusinessBotManageBar `json:"business_bot_manage_bar"` +} + +func (entity *UpdateChatBusinessBotManageBar) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub UpdateChatBusinessBotManageBar + + return json.Marshal((*stub)(entity)) +} + +func (*UpdateChatBusinessBotManageBar) GetClass() string { + return ClassUpdate +} + +func (*UpdateChatBusinessBotManageBar) GetType() string { + return TypeUpdateChatBusinessBotManageBar +} + +func (*UpdateChatBusinessBotManageBar) UpdateType() string { + return TypeUpdateChatBusinessBotManageBar +} + // The chat available reactions were changed type UpdateChatAvailableReactions struct { meta @@ -48646,6 +49407,33 @@ func (updateSuggestedActions *UpdateSuggestedActions) UnmarshalJSON(data []byte) return nil } +// Download or upload file speed for the user was limited, but it can be restored by subscription to Telegram Premium. The notification can be postponed until a being downloaded or uploaded file is visible to the user Use getOption("premium_download_speedup") or getOption("premium_upload_speedup") to get expected speedup after subscription to Telegram Premium +type UpdateSpeedLimitNotification struct { + meta + // True, if upload speed was limited; false, if download speed was limited + IsUpload bool `json:"is_upload"` +} + +func (entity *UpdateSpeedLimitNotification) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub UpdateSpeedLimitNotification + + return json.Marshal((*stub)(entity)) +} + +func (*UpdateSpeedLimitNotification) GetClass() string { + return ClassUpdate +} + +func (*UpdateSpeedLimitNotification) GetType() string { + return TypeUpdateSpeedLimitNotification +} + +func (*UpdateSpeedLimitNotification) UpdateType() string { + return TypeUpdateSpeedLimitNotification +} + // The list of contacts that had birthdays recently or will have birthday soon has changed type UpdateContactCloseBirthdays struct { meta @@ -48673,35 +49461,6 @@ func (*UpdateContactCloseBirthdays) UpdateType() string { return TypeUpdateContactCloseBirthdays } -// Adding users to a chat has failed because of their privacy settings. An invite link can be shared with the users if appropriate -type UpdateAddChatMembersPrivacyForbidden struct { - meta - // Chat identifier - ChatId int64 `json:"chat_id"` - // Identifiers of users, which weren't added because of their privacy settings - UserIds []int64 `json:"user_ids"` -} - -func (entity *UpdateAddChatMembersPrivacyForbidden) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub UpdateAddChatMembersPrivacyForbidden - - return json.Marshal((*stub)(entity)) -} - -func (*UpdateAddChatMembersPrivacyForbidden) GetClass() string { - return ClassUpdate -} - -func (*UpdateAddChatMembersPrivacyForbidden) GetType() string { - return TypeUpdateAddChatMembersPrivacyForbidden -} - -func (*UpdateAddChatMembersPrivacyForbidden) UpdateType() string { - return TypeUpdateAddChatMembersPrivacyForbidden -} - // Autosave settings for some type of chats were updated type UpdateAutosaveSettings struct { meta diff --git a/client/unmarshaler.go b/client/unmarshaler.go index 25f7d9f..2f68e92 100755 --- a/client/unmarshaler.go +++ b/client/unmarshaler.go @@ -4616,8 +4616,8 @@ func UnmarshalBusinessFeature(data json.RawMessage) (BusinessFeature, error) { case TypeBusinessFeatureAccountLinks: return UnmarshalBusinessFeatureAccountLinks(data) - case TypeBusinessFeatureIntro: - return UnmarshalBusinessFeatureIntro(data) + case TypeBusinessFeatureStartPage: + return UnmarshalBusinessFeatureStartPage(data) case TypeBusinessFeatureBots: return UnmarshalBusinessFeatureBots(data) @@ -5933,6 +5933,9 @@ func UnmarshalInternalLinkType(data json.RawMessage) (InternalLinkType, error) { case TypeInternalLinkTypeBotStartInGroup: return UnmarshalInternalLinkTypeBotStartInGroup(data) + case TypeInternalLinkTypeBusinessChat: + return UnmarshalInternalLinkTypeBusinessChat(data) + case TypeInternalLinkTypeChangePhoneNumber: return UnmarshalInternalLinkTypeChangePhoneNumber(data) @@ -6665,6 +6668,80 @@ func UnmarshalListOfChatStatistics(dataList []json.RawMessage) ([]ChatStatistics return list, nil } +func UnmarshalChatRevenueWithdrawalState(data json.RawMessage) (ChatRevenueWithdrawalState, error) { + var meta meta + + err := json.Unmarshal(data, &meta) + if err != nil { + return nil, err + } + + switch meta.Type { + case TypeChatRevenueWithdrawalStatePending: + return UnmarshalChatRevenueWithdrawalStatePending(data) + + case TypeChatRevenueWithdrawalStateCompleted: + return UnmarshalChatRevenueWithdrawalStateCompleted(data) + + case TypeChatRevenueWithdrawalStateFailed: + return UnmarshalChatRevenueWithdrawalStateFailed(data) + + default: + return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) + } +} + +func UnmarshalListOfChatRevenueWithdrawalState(dataList []json.RawMessage) ([]ChatRevenueWithdrawalState, error) { + list := []ChatRevenueWithdrawalState{} + + for _, data := range dataList { + entity, err := UnmarshalChatRevenueWithdrawalState(data) + if err != nil { + return nil, err + } + list = append(list, entity) + } + + return list, nil +} + +func UnmarshalChatRevenueTransactionType(data json.RawMessage) (ChatRevenueTransactionType, error) { + var meta meta + + err := json.Unmarshal(data, &meta) + if err != nil { + return nil, err + } + + switch meta.Type { + case TypeChatRevenueTransactionTypeEarnings: + return UnmarshalChatRevenueTransactionTypeEarnings(data) + + case TypeChatRevenueTransactionTypeWithdrawal: + return UnmarshalChatRevenueTransactionTypeWithdrawal(data) + + case TypeChatRevenueTransactionTypeRefund: + return UnmarshalChatRevenueTransactionTypeRefund(data) + + default: + return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) + } +} + +func UnmarshalListOfChatRevenueTransactionType(dataList []json.RawMessage) ([]ChatRevenueTransactionType, error) { + list := []ChatRevenueTransactionType{} + + for _, data := range dataList { + entity, err := UnmarshalChatRevenueTransactionType(data) + if err != nil { + return nil, err + } + list = append(list, entity) + } + + return list, nil +} + func UnmarshalVectorPathCommand(data json.RawMessage) (VectorPathCommand, error) { var meta meta @@ -6748,6 +6825,43 @@ func UnmarshalListOfBotCommandScope(dataList []json.RawMessage) ([]BotCommandSco return list, nil } +func UnmarshalPhoneNumberCodeType(data json.RawMessage) (PhoneNumberCodeType, error) { + var meta meta + + err := json.Unmarshal(data, &meta) + if err != nil { + return nil, err + } + + switch meta.Type { + case TypePhoneNumberCodeTypeChange: + return UnmarshalPhoneNumberCodeTypeChange(data) + + case TypePhoneNumberCodeTypeVerify: + return UnmarshalPhoneNumberCodeTypeVerify(data) + + case TypePhoneNumberCodeTypeConfirmOwnership: + return UnmarshalPhoneNumberCodeTypeConfirmOwnership(data) + + default: + return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) + } +} + +func UnmarshalListOfPhoneNumberCodeType(dataList []json.RawMessage) ([]PhoneNumberCodeType, error) { + list := []PhoneNumberCodeType{} + + for _, data := range dataList { + entity, err := UnmarshalPhoneNumberCodeType(data) + if err != nil { + return nil, err + } + list = append(list, entity) + } + + return list, nil +} + func UnmarshalUpdate(data json.RawMessage) (Update, error) { var meta meta @@ -6832,6 +6946,9 @@ func UnmarshalUpdate(data json.RawMessage) (Update, error) { case TypeUpdateChatActionBar: return UnmarshalUpdateChatActionBar(data) + case TypeUpdateChatBusinessBotManageBar: + return UnmarshalUpdateChatBusinessBotManageBar(data) + case TypeUpdateChatAvailableReactions: return UnmarshalUpdateChatAvailableReactions(data) @@ -7111,12 +7228,12 @@ func UnmarshalUpdate(data json.RawMessage) (Update, error) { case TypeUpdateSuggestedActions: return UnmarshalUpdateSuggestedActions(data) + case TypeUpdateSpeedLimitNotification: + return UnmarshalUpdateSpeedLimitNotification(data) + case TypeUpdateContactCloseBirthdays: return UnmarshalUpdateContactCloseBirthdays(data) - case TypeUpdateAddChatMembersPrivacyForbidden: - return UnmarshalUpdateAddChatMembersPrivacyForbidden(data) - case TypeUpdateAutosaveSettings: return UnmarshalUpdateAutosaveSettings(data) @@ -8105,16 +8222,16 @@ func UnmarshalBusinessConnectedBot(data json.RawMessage) (*BusinessConnectedBot, return &resp, err } -func UnmarshalBusinessIntro(data json.RawMessage) (*BusinessIntro, error) { - var resp BusinessIntro +func UnmarshalBusinessStartPage(data json.RawMessage) (*BusinessStartPage, error) { + var resp BusinessStartPage err := json.Unmarshal(data, &resp) return &resp, err } -func UnmarshalInputBusinessIntro(data json.RawMessage) (*InputBusinessIntro, error) { - var resp InputBusinessIntro +func UnmarshalInputBusinessStartPage(data json.RawMessage) (*InputBusinessStartPage, error) { + var resp InputBusinessStartPage err := json.Unmarshal(data, &resp) @@ -8145,6 +8262,38 @@ func UnmarshalBusinessInfo(data json.RawMessage) (*BusinessInfo, error) { return &resp, err } +func UnmarshalBusinessChatLink(data json.RawMessage) (*BusinessChatLink, error) { + var resp BusinessChatLink + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalBusinessChatLinks(data json.RawMessage) (*BusinessChatLinks, error) { + var resp BusinessChatLinks + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalInputBusinessChatLink(data json.RawMessage) (*InputBusinessChatLink, error) { + var resp InputBusinessChatLink + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalBusinessChatLinkInfo(data json.RawMessage) (*BusinessChatLinkInfo, error) { + var resp BusinessChatLinkInfo + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalChatPhotoStickerTypeRegularOrMask(data json.RawMessage) (*ChatPhotoStickerTypeRegularOrMask, error) { var resp ChatPhotoStickerTypeRegularOrMask @@ -9593,6 +9742,14 @@ func UnmarshalSavedMessagesTags(data json.RawMessage) (*SavedMessagesTags, error return &resp, err } +func UnmarshalBusinessBotManageBar(data json.RawMessage) (*BusinessBotManageBar, error) { + var resp BusinessBotManageBar + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalVideoChat(data json.RawMessage) (*VideoChat, error) { var resp VideoChat @@ -9617,6 +9774,30 @@ func UnmarshalChats(data json.RawMessage) (*Chats, error) { return &resp, err } +func UnmarshalFailedToAddMember(data json.RawMessage) (*FailedToAddMember, error) { + var resp FailedToAddMember + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalFailedToAddMembers(data json.RawMessage) (*FailedToAddMembers, error) { + var resp FailedToAddMembers + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalCreatedBasicGroupChat(data json.RawMessage) (*CreatedBasicGroupChat, error) { + var resp CreatedBasicGroupChat + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalChatNearby(data json.RawMessage) (*ChatNearby, error) { var resp ChatNearby @@ -12953,6 +13134,14 @@ func UnmarshalQuickReplyMessage(data json.RawMessage) (*QuickReplyMessage, error return &resp, err } +func UnmarshalQuickReplyMessages(data json.RawMessage) (*QuickReplyMessages, error) { + var resp QuickReplyMessages + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalQuickReplyShortcut(data json.RawMessage) (*QuickReplyShortcut, error) { var resp QuickReplyShortcut @@ -14729,8 +14918,8 @@ func UnmarshalBusinessFeatureAccountLinks(data json.RawMessage) (*BusinessFeatur return &resp, err } -func UnmarshalBusinessFeatureIntro(data json.RawMessage) (*BusinessFeatureIntro, error) { - var resp BusinessFeatureIntro +func UnmarshalBusinessFeatureStartPage(data json.RawMessage) (*BusinessFeatureStartPage, error) { + var resp BusinessFeatureStartPage err := json.Unmarshal(data, &resp) @@ -16441,6 +16630,14 @@ func UnmarshalInternalLinkTypeBotStartInGroup(data json.RawMessage) (*InternalLi return &resp, err } +func UnmarshalInternalLinkTypeBusinessChat(data json.RawMessage) (*InternalLinkTypeBusinessChat, error) { + var resp InternalLinkTypeBusinessChat + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalInternalLinkTypeChangePhoneNumber(data json.RawMessage) (*InternalLinkTypeChangePhoneNumber, error) { var resp InternalLinkTypeChangePhoneNumber @@ -17569,6 +17766,14 @@ func UnmarshalChatStatisticsChannel(data json.RawMessage) (*ChatStatisticsChanne return &resp, err } +func UnmarshalChatRevenueStatistics(data json.RawMessage) (*ChatRevenueStatistics, error) { + var resp ChatRevenueStatistics + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalMessageStatistics(data json.RawMessage) (*MessageStatistics, error) { var resp MessageStatistics @@ -17585,6 +17790,70 @@ func UnmarshalStoryStatistics(data json.RawMessage) (*StoryStatistics, error) { return &resp, err } +func UnmarshalChatRevenueWithdrawalStatePending(data json.RawMessage) (*ChatRevenueWithdrawalStatePending, error) { + var resp ChatRevenueWithdrawalStatePending + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalChatRevenueWithdrawalStateCompleted(data json.RawMessage) (*ChatRevenueWithdrawalStateCompleted, error) { + var resp ChatRevenueWithdrawalStateCompleted + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalChatRevenueWithdrawalStateFailed(data json.RawMessage) (*ChatRevenueWithdrawalStateFailed, error) { + var resp ChatRevenueWithdrawalStateFailed + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalChatRevenueTransactionTypeEarnings(data json.RawMessage) (*ChatRevenueTransactionTypeEarnings, error) { + var resp ChatRevenueTransactionTypeEarnings + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalChatRevenueTransactionTypeWithdrawal(data json.RawMessage) (*ChatRevenueTransactionTypeWithdrawal, error) { + var resp ChatRevenueTransactionTypeWithdrawal + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalChatRevenueTransactionTypeRefund(data json.RawMessage) (*ChatRevenueTransactionTypeRefund, error) { + var resp ChatRevenueTransactionTypeRefund + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalChatRevenueTransaction(data json.RawMessage) (*ChatRevenueTransaction, error) { + var resp ChatRevenueTransaction + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalChatRevenueTransactions(data json.RawMessage) (*ChatRevenueTransactions, error) { + var resp ChatRevenueTransactions + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalPoint(data json.RawMessage) (*Point, error) { var resp Point @@ -17665,6 +17934,30 @@ func UnmarshalBotCommandScopeChatMember(data json.RawMessage) (*BotCommandScopeC return &resp, err } +func UnmarshalPhoneNumberCodeTypeChange(data json.RawMessage) (*PhoneNumberCodeTypeChange, error) { + var resp PhoneNumberCodeTypeChange + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalPhoneNumberCodeTypeVerify(data json.RawMessage) (*PhoneNumberCodeTypeVerify, error) { + var resp PhoneNumberCodeTypeVerify + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalPhoneNumberCodeTypeConfirmOwnership(data json.RawMessage) (*PhoneNumberCodeTypeConfirmOwnership, error) { + var resp PhoneNumberCodeTypeConfirmOwnership + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalUpdateAuthorizationState(data json.RawMessage) (*UpdateAuthorizationState, error) { var resp UpdateAuthorizationState @@ -17865,6 +18158,14 @@ func UnmarshalUpdateChatActionBar(data json.RawMessage) (*UpdateChatActionBar, e return &resp, err } +func UnmarshalUpdateChatBusinessBotManageBar(data json.RawMessage) (*UpdateChatBusinessBotManageBar, error) { + var resp UpdateChatBusinessBotManageBar + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalUpdateChatAvailableReactions(data json.RawMessage) (*UpdateChatAvailableReactions, error) { var resp UpdateChatAvailableReactions @@ -18609,16 +18910,16 @@ func UnmarshalUpdateSuggestedActions(data json.RawMessage) (*UpdateSuggestedActi return &resp, err } -func UnmarshalUpdateContactCloseBirthdays(data json.RawMessage) (*UpdateContactCloseBirthdays, error) { - var resp UpdateContactCloseBirthdays +func UnmarshalUpdateSpeedLimitNotification(data json.RawMessage) (*UpdateSpeedLimitNotification, error) { + var resp UpdateSpeedLimitNotification err := json.Unmarshal(data, &resp) return &resp, err } -func UnmarshalUpdateAddChatMembersPrivacyForbidden(data json.RawMessage) (*UpdateAddChatMembersPrivacyForbidden, error) { - var resp UpdateAddChatMembersPrivacyForbidden +func UnmarshalUpdateContactCloseBirthdays(data json.RawMessage) (*UpdateContactCloseBirthdays, error) { + var resp UpdateContactCloseBirthdays err := json.Unmarshal(data, &resp) @@ -19233,11 +19534,11 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeBusinessConnectedBot: return UnmarshalBusinessConnectedBot(data) - case TypeBusinessIntro: - return UnmarshalBusinessIntro(data) + case TypeBusinessStartPage: + return UnmarshalBusinessStartPage(data) - case TypeInputBusinessIntro: - return UnmarshalInputBusinessIntro(data) + case TypeInputBusinessStartPage: + return UnmarshalInputBusinessStartPage(data) case TypeBusinessOpeningHoursInterval: return UnmarshalBusinessOpeningHoursInterval(data) @@ -19248,6 +19549,18 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeBusinessInfo: return UnmarshalBusinessInfo(data) + case TypeBusinessChatLink: + return UnmarshalBusinessChatLink(data) + + case TypeBusinessChatLinks: + return UnmarshalBusinessChatLinks(data) + + case TypeInputBusinessChatLink: + return UnmarshalInputBusinessChatLink(data) + + case TypeBusinessChatLinkInfo: + return UnmarshalBusinessChatLinkInfo(data) + case TypeChatPhotoStickerTypeRegularOrMask: return UnmarshalChatPhotoStickerTypeRegularOrMask(data) @@ -19791,6 +20104,9 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeSavedMessagesTags: return UnmarshalSavedMessagesTags(data) + case TypeBusinessBotManageBar: + return UnmarshalBusinessBotManageBar(data) + case TypeVideoChat: return UnmarshalVideoChat(data) @@ -19800,6 +20116,15 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeChats: return UnmarshalChats(data) + case TypeFailedToAddMember: + return UnmarshalFailedToAddMember(data) + + case TypeFailedToAddMembers: + return UnmarshalFailedToAddMembers(data) + + case TypeCreatedBasicGroupChat: + return UnmarshalCreatedBasicGroupChat(data) + case TypeChatNearby: return UnmarshalChatNearby(data) @@ -21051,6 +21376,9 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeQuickReplyMessage: return UnmarshalQuickReplyMessage(data) + case TypeQuickReplyMessages: + return UnmarshalQuickReplyMessages(data) + case TypeQuickReplyShortcut: return UnmarshalQuickReplyShortcut(data) @@ -21717,8 +22045,8 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeBusinessFeatureAccountLinks: return UnmarshalBusinessFeatureAccountLinks(data) - case TypeBusinessFeatureIntro: - return UnmarshalBusinessFeatureIntro(data) + case TypeBusinessFeatureStartPage: + return UnmarshalBusinessFeatureStartPage(data) case TypeBusinessFeatureBots: return UnmarshalBusinessFeatureBots(data) @@ -22359,6 +22687,9 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeInternalLinkTypeBotStartInGroup: return UnmarshalInternalLinkTypeBotStartInGroup(data) + case TypeInternalLinkTypeBusinessChat: + return UnmarshalInternalLinkTypeBusinessChat(data) + case TypeInternalLinkTypeChangePhoneNumber: return UnmarshalInternalLinkTypeChangePhoneNumber(data) @@ -22782,12 +23113,39 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeChatStatisticsChannel: return UnmarshalChatStatisticsChannel(data) + case TypeChatRevenueStatistics: + return UnmarshalChatRevenueStatistics(data) + case TypeMessageStatistics: return UnmarshalMessageStatistics(data) case TypeStoryStatistics: return UnmarshalStoryStatistics(data) + case TypeChatRevenueWithdrawalStatePending: + return UnmarshalChatRevenueWithdrawalStatePending(data) + + case TypeChatRevenueWithdrawalStateCompleted: + return UnmarshalChatRevenueWithdrawalStateCompleted(data) + + case TypeChatRevenueWithdrawalStateFailed: + return UnmarshalChatRevenueWithdrawalStateFailed(data) + + case TypeChatRevenueTransactionTypeEarnings: + return UnmarshalChatRevenueTransactionTypeEarnings(data) + + case TypeChatRevenueTransactionTypeWithdrawal: + return UnmarshalChatRevenueTransactionTypeWithdrawal(data) + + case TypeChatRevenueTransactionTypeRefund: + return UnmarshalChatRevenueTransactionTypeRefund(data) + + case TypeChatRevenueTransaction: + return UnmarshalChatRevenueTransaction(data) + + case TypeChatRevenueTransactions: + return UnmarshalChatRevenueTransactions(data) + case TypePoint: return UnmarshalPoint(data) @@ -22818,6 +23176,15 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeBotCommandScopeChatMember: return UnmarshalBotCommandScopeChatMember(data) + case TypePhoneNumberCodeTypeChange: + return UnmarshalPhoneNumberCodeTypeChange(data) + + case TypePhoneNumberCodeTypeVerify: + return UnmarshalPhoneNumberCodeTypeVerify(data) + + case TypePhoneNumberCodeTypeConfirmOwnership: + return UnmarshalPhoneNumberCodeTypeConfirmOwnership(data) + case TypeUpdateAuthorizationState: return UnmarshalUpdateAuthorizationState(data) @@ -22893,6 +23260,9 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeUpdateChatActionBar: return UnmarshalUpdateChatActionBar(data) + case TypeUpdateChatBusinessBotManageBar: + return UnmarshalUpdateChatBusinessBotManageBar(data) + case TypeUpdateChatAvailableReactions: return UnmarshalUpdateChatAvailableReactions(data) @@ -23172,12 +23542,12 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeUpdateSuggestedActions: return UnmarshalUpdateSuggestedActions(data) + case TypeUpdateSpeedLimitNotification: + return UnmarshalUpdateSpeedLimitNotification(data) + case TypeUpdateContactCloseBirthdays: return UnmarshalUpdateContactCloseBirthdays(data) - case TypeUpdateAddChatMembersPrivacyForbidden: - return UnmarshalUpdateAddChatMembersPrivacyForbidden(data) - case TypeUpdateAutosaveSettings: return UnmarshalUpdateAutosaveSettings(data) diff --git a/data/td_api.tl b/data/td_api.tl index 7cc4ddc..dabbcea 100644 --- a/data/td_api.tl +++ b/data/td_api.tl @@ -312,7 +312,7 @@ stickerFormatTgs = StickerFormat; stickerFormatWebm = StickerFormat; -//@class StickerType @description Describes type of a sticker +//@class StickerType @description Describes type of sticker //@description The sticker is a regular sticker stickerTypeRegular = StickerType; @@ -351,7 +351,7 @@ closedVectorPath commands:vector = ClosedVectorPath; pollOption text:string voter_count:int32 vote_percentage:int32 is_chosen:Bool is_being_chosen:Bool = PollOption; -//@class PollType @description Describes the type of a poll +//@class PollType @description Describes the type of poll //@description A regular poll @allow_multiple_answers True, if multiple answer options can be chosen simultaneously pollTypeRegular allow_multiple_answers:Bool = PollType; @@ -541,7 +541,7 @@ profilePhoto id:int64 small:file big:file minithumbnail:minithumbnail has_animat chatPhotoInfo small:file big:file minithumbnail:minithumbnail has_animation:Bool is_personal:Bool = ChatPhotoInfo; -//@class UserType @description Represents the type of a user. The following types are possible: regular users, deleted users and bots +//@class UserType @description Represents the type of user. The following types are possible: regular users, deleted users and bots //@description A regular user userTypeRegular = UserType; @@ -631,17 +631,17 @@ businessGreetingMessageSettings shortcut_id:int32 recipients:businessRecipients //@can_reply True, if the bot can send messages to the private chats; false otherwise businessConnectedBot bot_user_id:int53 recipients:businessRecipients can_reply:Bool = BusinessConnectedBot; -//@description Describes settings for a business account intro -//@title Title text of the intro -//@message Message text of the intro -//@sticker Greeting sticker of the intro; may be null if none -businessIntro title:string message:string sticker:sticker = BusinessIntro; +//@description Describes settings for a business account start page +//@title Title text of the start page +//@message Message text of the start page +//@sticker Greeting sticker of the start page; may be null if none +businessStartPage title:string message:string sticker:sticker = BusinessStartPage; -//@description Describes settings for a business account intro to set -//@title Title text of the intro; 0-getOption("business_intro_title_length_max") characters -//@message Message text of the intro; 0-getOption("business_intro_message_length_max") characters -//@sticker Greeting sticker of the intro; pass null if none. The sticker must belong to a sticker set and must not be a custom emoji -inputBusinessIntro title:string message:string sticker:InputFile = InputBusinessIntro; +//@description Describes settings for a business account start page to set +//@title Title text of the start page; 0-getOption("business_start_page_title_length_max") characters +//@message Message text of the start page; 0-getOption("business_start_page_message_length_max") characters +//@sticker Greeting sticker of the start page; pass null if none. The sticker must belong to a sticker set and must not be a custom emoji +inputBusinessStartPage title:string message:string sticker:InputFile = InputBusinessStartPage; //@description Describes an interval of time when the business is open //@start_minute The first minute of the interval since start of the week; 0-7*24*60 @@ -656,11 +656,32 @@ businessOpeningHours time_zone_id:string opening_hours:vector = BusinessChatLinks; + +//@description Describes a business chat link to create or edit +//@text Message draft text that will be added to the input field +//@title Link title +inputBusinessChatLink text:formattedText title:string = InputBusinessChatLink; + +//@description Contains information about a business chat link +//@chat_id Identifier of the private chat that created the link +//@text Message draft text that must be added to the input field +businessChatLinkInfo chat_id:int53 text:formattedText = BusinessChatLinkInfo; + + +//@class ChatPhotoStickerType @description Describes type of sticker, which was used to create a chat photo //@description Information about the sticker, which was used to create the chat photo //@sticker_set_id Sticker set identifier @@ -1084,7 +1105,7 @@ chatInviteLinkMember user_id:int53 joined_chat_date:int32 via_chat_folder_invite chatInviteLinkMembers total_count:int32 members:vector = ChatInviteLinkMembers; -//@class InviteLinkChatType @description Describes the type of a chat to which points an invite link +//@class InviteLinkChatType @description Describes the type of chat to which points an invite link //@description The link is an invite link for a basic group inviteLinkChatTypeBasicGroup = InviteLinkChatType; @@ -1191,9 +1212,11 @@ supergroup id:int53 access_hash:int64 usernames:usernames date:int32 status:Chat //@can_set_sticker_set True, if the supergroup sticker set can be changed //@can_set_location True, if the supergroup location can be changed //@can_get_statistics True, if the supergroup or channel statistics are available +//@can_get_revenue_statistics True, if the supergroup or channel revenue statistics are available //@can_toggle_aggressive_anti_spam True, if aggressive anti-spam checks can be enabled or disabled in the supergroup //@is_all_history_available True, if new chat members will have access to old messages. In public, discussion, of forum groups and all channels, old messages are always available, //-so this option affects only private non-forum supergroups without a linked chat. The value of this field is only available to chat administrators +//@can_have_sponsored_messages True, if the chat can have sponsored messages. The value of this field is only available to the owner of the chat //@has_aggressive_anti_spam_enabled True, if aggressive anti-spam checks are enabled in the supergroup. The value of this field is only available to chat administrators //@has_pinned_stories True, if the supergroup or channel has pinned stories //@my_boost_count Number of times the current user boosted the supergroup or channel @@ -1205,7 +1228,7 @@ supergroup id:int53 access_hash:int64 usernames:usernames date:int32 status:Chat //@bot_commands List of commands of bots in the group //@upgraded_from_basic_group_id Identifier of the basic group from which supergroup was upgraded; 0 if none //@upgraded_from_max_message_id Identifier of the last message in the basic group from which supergroup was upgraded; 0 if none -supergroupFullInfo photo:chatPhoto description:string member_count:int32 administrator_count:int32 restricted_count:int32 banned_count:int32 linked_chat_id:int53 slow_mode_delay:int32 slow_mode_delay_expires_in:double can_get_members:Bool has_hidden_members:Bool can_hide_members:Bool can_set_sticker_set:Bool can_set_location:Bool can_get_statistics:Bool can_toggle_aggressive_anti_spam:Bool is_all_history_available:Bool has_aggressive_anti_spam_enabled:Bool has_pinned_stories:Bool my_boost_count:int32 unrestrict_boost_count:int32 sticker_set_id:int64 custom_emoji_sticker_set_id:int64 location:chatLocation invite_link:chatInviteLink bot_commands:vector upgraded_from_basic_group_id:int53 upgraded_from_max_message_id:int53 = SupergroupFullInfo; +supergroupFullInfo photo:chatPhoto description:string member_count:int32 administrator_count:int32 restricted_count:int32 banned_count:int32 linked_chat_id:int53 slow_mode_delay:int32 slow_mode_delay_expires_in:double can_get_members:Bool has_hidden_members:Bool can_hide_members:Bool can_set_sticker_set:Bool can_set_location:Bool can_get_statistics:Bool can_get_revenue_statistics:Bool can_toggle_aggressive_anti_spam:Bool is_all_history_available:Bool can_have_sponsored_messages:Bool has_aggressive_anti_spam_enabled:Bool has_pinned_stories:Bool my_boost_count:int32 unrestrict_boost_count:int32 sticker_set_id:int64 custom_emoji_sticker_set_id:int64 location:chatLocation invite_link:chatInviteLink bot_commands:vector upgraded_from_basic_group_id:int53 upgraded_from_max_message_id:int53 = SupergroupFullInfo; //@class SecretChatState @description Describes the current secret chat state @@ -1320,7 +1343,7 @@ reactionTypeCustomEmoji custom_emoji_id:int64 = ReactionType; //@origin Origin of the forwarded message //@date Point in time (Unix timestamp) when the message was originally sent //@source For messages forwarded to the chat with the current user (Saved Messages), to the Replies bot chat, or to the channel's discussion group, information about the source message from which the message was forwarded last time; may be null for other forwards or if unknown -//@public_service_announcement_type The type of a public service announcement for the forwarded message +//@public_service_announcement_type The type of public service announcement for the forwarded message messageForwardInfo origin:MessageOrigin date:int32 source:forwardSource public_service_announcement_type:string = MessageForwardInfo; //@description Contains information about a message created with importMessages @@ -1463,7 +1486,7 @@ inputMessageReplyToStory story_sender_chat_id:int53 story_id:int32 = InputMessag //@sender_business_bot_user_id If non-zero, the user identifier of the business bot that sent this message //@sender_boost_count Number of times the sender of the message boosted the supergroup at the time the message was sent; 0 if none or unknown. For messages sent by the current user, supergroupFullInfo.my_boost_count must be used instead //@author_signature For channel posts and anonymous group messages, optional author signature -//@media_album_id Unique identifier of an album this message belongs to. Only audios, documents, photos and videos can be grouped together in albums +//@media_album_id Unique identifier of an album this message belongs to; 0 if none. Only audios, documents, photos and videos can be grouped together in albums //@restriction_reason If non-empty, contains a human-readable description of the reason why access to this message must be restricted //@content Content of the message //@reply_markup Reply markup for the message; may be null if none @@ -1531,7 +1554,7 @@ messageSourceScreenshot = MessageSource; messageSourceOther = MessageSource; -//@class MessageSponsorType @description Describes type of a message sponsor +//@class MessageSponsorType @description Describes type of message sponsor //@description The sponsor is a bot @bot_user_id User identifier of the bot @link An internal link to be opened when the sponsored message is clicked messageSponsorTypeBot bot_user_id:int53 link:InternalLinkType = MessageSponsorType; @@ -1662,7 +1685,7 @@ scopeNotificationSettings mute_for:int32 sound_id:int64 show_preview:Bool use_de draftMessage reply_to:InputMessageReplyTo date:int32 input_message_text:InputMessageContent = DraftMessage; -//@class ChatType @description Describes the type of a chat +//@class ChatType @description Describes the type of chat //@description An ordinary chat with a user @user_id User identifier chatTypePrivate user_id:int53 = ChatType; @@ -1684,7 +1707,7 @@ chatFolderIcon name:string = ChatFolderIcon; //@description Represents a folder for user chats //@title The title of the folder; 1-12 characters without line feeds //@icon The chosen icon for the chat folder; may be null. If null, use getChatFolderDefaultIconName to get default icon name for the folder -//@color_id The identifier of the chosen color for the chat folder icon; from -1 to 6. If -1, then color is didabled. Can't be changed if folder tags are disabled or the current user doesn't have Telegram Premium subscription +//@color_id The identifier of the chosen color for the chat folder icon; from -1 to 6. If -1, then color is disabled. Can't be changed if folder tags are disabled or the current user doesn't have Telegram Premium subscription //@is_shareable True, if at least one link has been created for the folder //@pinned_chat_ids The chat identifiers of pinned chats in the folder. There can be up to getOption("chat_folder_chosen_chat_count_max") pinned and always included non-secret chats and the same number of secret chats, but the limit can be increased with Telegram Premium //@included_chat_ids The chat identifiers of always included chats in the folder. There can be up to getOption("chat_folder_chosen_chat_count_max") pinned and always included non-secret chats and the same number of secret chats, but the limit can be increased with Telegram Premium @@ -1703,7 +1726,7 @@ chatFolder title:string icon:chatFolderIcon color_id:int32 is_shareable:Bool pin //@id Unique chat folder identifier //@title The title of the folder; 1-12 characters without line feeds //@icon The chosen or default icon for the chat folder -//@color_id The identifier of the chosen color for the chat folder icon; from -1 to 6. If -1, then color is didabled +//@color_id The identifier of the chosen color for the chat folder icon; from -1 to 6. If -1, then color is disabled //@is_shareable True, if at least one link has been created for the folder //@has_my_invite_links True, if the chat folder has invite links created by the current user chatFolderInfo id:int32 title:string icon:chatFolderIcon color_id:int32 is_shareable:Bool has_my_invite_links:Bool = ChatFolderInfo; @@ -1787,6 +1810,14 @@ savedMessagesTag tag:ReactionType label:string count:int32 = SavedMessagesTag; savedMessagesTags tags:vector = SavedMessagesTags; +//@description Contains information about a business bot that manages the chat +//@bot_user_id User identifier of the bot +//@manage_url URL to be opened to manage the bot +//@is_bot_paused True, if the bot is paused. Use toggleBusinessConnectedBotChatIsPaused to change the value of the field +//@can_bot_reply True, if the bot can reply +businessBotManageBar bot_user_id:int53 manage_url:string is_bot_paused:Bool can_bot_reply:Bool = BusinessBotManageBar; + + //@description Describes a video chat //@group_call_id Group call identifier of an active video chat; 0 if none. Full information about the video chat can be received through the method getGroupCall //@has_participants True, if the video chat has participants @@ -1830,17 +1861,32 @@ videoChat group_call_id:int32 has_participants:Bool default_participant_id:Messa //@background Background set for the chat; may be null if none //@theme_name If non-empty, name of a theme, set for the chat //@action_bar Information about actions which must be possible to do through the chat action bar; may be null if none +//@business_bot_manage_bar Information about bar for managing a business bot in the chat; may be null if none //@video_chat Information about video chat of the chat //@pending_join_requests Information about pending join requests; may be null if none //@reply_markup_message_id Identifier of the message from which reply markup needs to be used; 0 if there is no default custom reply markup in the chat //@draft_message A draft of a message in the chat; may be null if none //@client_data Application-specific data associated with the chat. (For example, the chat scroll position or local chat notification settings can be stored here.) Persistent if the message database is used -chat id:int53 type:ChatType title:string photo:chatPhotoInfo accent_color_id:int32 background_custom_emoji_id:int64 profile_accent_color_id:int32 profile_background_custom_emoji_id:int64 permissions:chatPermissions last_message:message positions:vector chat_lists:vector message_sender_id:MessageSender block_list:BlockList has_protected_content:Bool is_translatable:Bool is_marked_as_unread:Bool view_as_topics:Bool has_scheduled_messages:Bool can_be_deleted_only_for_self:Bool can_be_deleted_for_all_users:Bool can_be_reported:Bool default_disable_notification: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 available_reactions:ChatAvailableReactions message_auto_delete_time:int32 emoji_status:emojiStatus background:chatBackground theme_name:string action_bar:ChatActionBar video_chat:videoChat pending_join_requests:chatJoinRequestsInfo reply_markup_message_id:int53 draft_message:draftMessage client_data:string = Chat; +chat id:int53 type:ChatType title:string photo:chatPhotoInfo accent_color_id:int32 background_custom_emoji_id:int64 profile_accent_color_id:int32 profile_background_custom_emoji_id:int64 permissions:chatPermissions last_message:message positions:vector chat_lists:vector message_sender_id:MessageSender block_list:BlockList has_protected_content:Bool is_translatable:Bool is_marked_as_unread:Bool view_as_topics:Bool has_scheduled_messages:Bool can_be_deleted_only_for_self:Bool can_be_deleted_for_all_users:Bool can_be_reported:Bool default_disable_notification: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 available_reactions:ChatAvailableReactions message_auto_delete_time:int32 emoji_status:emojiStatus background:chatBackground theme_name:string action_bar:ChatActionBar business_bot_manage_bar:businessBotManageBar video_chat:videoChat pending_join_requests:chatJoinRequestsInfo reply_markup_message_id:int53 draft_message:draftMessage client_data:string = Chat; //@description Represents a list of chats @total_count Approximate total number of chats found @chat_ids List of chat identifiers chats total_count:int32 chat_ids:vector = Chats; +//@description Contains information about a user that has failed to be added to a chat +//@user_id User identifier +//@premium_would_allow_invite True, if subscription to Telegram Premium would have allowed to add the user to the chat +//@premium_required_to_send_messages True, if subscription to Telegram Premium is required to send the user chat invite link +failedToAddMember user_id:int53 premium_would_allow_invite:Bool premium_required_to_send_messages:Bool = FailedToAddMember; + +//@description Represents a list of users that has failed to be added to a chat @failed_to_add_members Information about users that weren't added to the chat +failedToAddMembers failed_to_add_members:vector = FailedToAddMembers; + + +//@description Contains information about a newly created basic group chat @chat_id Chat identifier @failed_to_add_members Information about failed to add members +createdBasicGroupChat chat_id:int53 failed_to_add_members:failedToAddMembers = CreatedBasicGroupChat; + + //@description Describes a chat located nearby @chat_id Chat identifier @distance Distance to the chat location, in meters chatNearby chat_id:int53 distance:int32 = ChatNearby; @@ -1938,7 +1984,7 @@ keyboardButtonTypeWebApp url:string = KeyboardButtonType; keyboardButton text:string type:KeyboardButtonType = KeyboardButton; -//@class InlineKeyboardButtonType @description Describes the type of an inline keyboard button +//@class InlineKeyboardButtonType @description Describes the type of inline keyboard button //@description A button that opens a specified URL @url HTTP or tg:// URL to open inlineKeyboardButtonTypeUrl url:string = InlineKeyboardButtonType; @@ -2030,7 +2076,7 @@ webAppInfo launch_id:int64 url:string = WebAppInfo; messageThreadInfo chat_id:int53 message_thread_id:int53 reply_info:messageReplyInfo unread_message_count:int32 messages:vector draft_message:draftMessage = MessageThreadInfo; -//@class SavedMessagesTopicType @description Describes type of a Saved Messages topic +//@class SavedMessagesTopicType @description Describes type of Saved Messages topic //@description Topic containing messages sent by the current user of forwarded from an unknown chat savedMessagesTopicTypeMyNotes = SavedMessagesTopicType; @@ -2634,7 +2680,7 @@ premiumGiveawayParameters boosted_chat_id:int53 additional_chat_ids:vector = MessageContent; //@description A newly created basic group @title Title of the basic group @member_user_ids User identifiers of members in the basic group @@ -3651,7 +3697,7 @@ emojiCategory name:string icon:sticker emojis:vector = EmojiCategory; emojiCategories categories:vector = EmojiCategories; -//@class EmojiCategoryType @description Describes type of an emoji category +//@class EmojiCategoryType @description Describes type of emoji category //@description The category must be used by default emojiCategoryTypeDefault = EmojiCategoryType; @@ -3672,7 +3718,7 @@ emojiCategoryTypeChatPhoto = EmojiCategoryType; storyAreaPosition x_percentage:double y_percentage:double width_percentage:double height_percentage:double rotation_angle:double = StoryAreaPosition; -//@class StoryAreaType @description Describes type of a clickable rectangle area on a story media +//@class StoryAreaType @description Describes type of clickable rectangle area on a story media //@description An area pointing to a location @location The location storyAreaTypeLocation location:location = StoryAreaType; @@ -3695,7 +3741,7 @@ storyAreaTypeMessage chat_id:int53 message_id:int53 = StoryAreaType; storyArea position:storyAreaPosition type:StoryAreaType = StoryArea; -//@class InputStoryAreaType @description Describes type of a clickable rectangle area on a story media to be added +//@class InputStoryAreaType @description Describes type of clickable rectangle area on a story media to be added //@description An area pointing to a location @location The location inputStoryAreaTypeLocation location:location = InputStoryAreaType; @@ -3883,13 +3929,16 @@ storyInteractions total_count:int32 total_forward_count:int32 total_reaction_cou //@id Unique message identifier among all quick replies //@sending_state The sending state of the message; may be null if the message isn't being sent and didn't fail to be sent //@can_be_edited True, if the message can be edited -//@reply_to_message_id Information about the identifier of the quick reply message to which the message replies +//@reply_to_message_id The identifier of the quick reply message to which the message replies; 0 if none //@via_bot_user_id If non-zero, the user identifier of the bot through which this message was sent -//@media_album_id Unique identifier of an album this message belongs to. Only audios, documents, photos and videos can be grouped together in albums +//@media_album_id Unique identifier of an album this message belongs to; 0 if none. Only audios, documents, photos and videos can be grouped together in albums //@content Content of the message //@reply_markup Inline keyboard reply markup for the message; may be null if none quickReplyMessage id:int53 sending_state:MessageSendingState can_be_edited:Bool reply_to_message_id:int53 via_bot_user_id:int53 media_album_id:int64 content:MessageContent reply_markup:ReplyMarkup = QuickReplyMessage; +//@description Contains a list of quick reply messages @messages List of quick reply messages; messages may be null +quickReplyMessages messages:vector = QuickReplyMessages; + //@description Describes a shortcut that can be used for a quick reply //@id Unique shortcut identifier //@name The name of the shortcut that can be used to use the shortcut @@ -3928,7 +3977,8 @@ publicForwards total_count:int32 forwards:vector next_offset:stri //@can_set_custom_background True, if custom background can be set in the chat for all users //@can_set_custom_emoji_sticker_set True, if custom emoji sticker set can be set for the chat //@can_recognize_speech True, if speech recognition can be used for video note and voice note messages by all users -chatBoostLevelFeatures level:int32 story_per_day_count:int32 custom_emoji_reaction_count:int32 title_color_count:int32 profile_accent_color_count:int32 can_set_profile_background_custom_emoji:Bool accent_color_count:int32 can_set_background_custom_emoji:Bool can_set_emoji_status:Bool chat_theme_background_count:int32 can_set_custom_background:Bool can_set_custom_emoji_sticker_set:Bool can_recognize_speech:Bool = ChatBoostLevelFeatures; +//@can_disable_sponsored_messages True, if sponsored messages can be disabled in the chat +chatBoostLevelFeatures level:int32 story_per_day_count:int32 custom_emoji_reaction_count:int32 title_color_count:int32 profile_accent_color_count:int32 can_set_profile_background_custom_emoji:Bool accent_color_count:int32 can_set_background_custom_emoji:Bool can_set_emoji_status:Bool chat_theme_background_count:int32 can_set_custom_background:Bool can_set_custom_emoji_sticker_set:Bool can_recognize_speech:Bool can_disable_sponsored_messages:Bool = ChatBoostLevelFeatures; //@description Contains a list of features available on the first chat boost levels //@features The list of features @@ -3939,7 +3989,8 @@ chatBoostLevelFeatures level:int32 story_per_day_count:int32 custom_emoji_reacti //@min_custom_background_boost_level The minimum boost level required to set custom chat background //@min_custom_emoji_sticker_set_boost_level The minimum boost level required to set custom emoji sticker set for the chat; for supergroup chats only //@min_speech_recognition_boost_level The minimum boost level allowing to recognize speech in video note and voice note messages for non-Premium users; for supergroup chats only -chatBoostFeatures features:vector min_profile_background_custom_emoji_boost_level:int32 min_background_custom_emoji_boost_level:int32 min_emoji_status_boost_level:int32 min_chat_theme_background_boost_level:int32 min_custom_background_boost_level:int32 min_custom_emoji_sticker_set_boost_level:int32 min_speech_recognition_boost_level:int32 = ChatBoostFeatures; +//@min_sponsored_message_disable_boost_level The minimum boost level allowing to disable sponsored messages in the chat; for channel chats only +chatBoostFeatures features:vector min_profile_background_custom_emoji_boost_level:int32 min_background_custom_emoji_boost_level:int32 min_emoji_status_boost_level:int32 min_chat_theme_background_boost_level:int32 min_custom_background_boost_level:int32 min_custom_emoji_sticker_set_boost_level:int32 min_speech_recognition_boost_level:int32 min_sponsored_message_disable_boost_level:int32 = ChatBoostFeatures; //@class ChatBoostSource @description Describes source of a chat boost @@ -4034,7 +4085,7 @@ callDiscardReasonHungUp = CallDiscardReason; callProtocol udp_p2p:Bool udp_reflector:Bool min_layer:int32 max_layer:int32 library_versions:vector = CallProtocol; -//@class CallServerType @description Describes the type of a call server +//@class CallServerType @description Describes the type of call server //@description A Telegram call reflector @peer_tag A peer tag to be used with the reflector @is_tcp True, if the server uses TCP instead of UDP callServerTypeTelegramReflector peer_tag:bytes is_tcp:Bool = CallServerType; @@ -4078,7 +4129,8 @@ callStateExchangingKeys = CallState; //@encryption_key Call encryption key //@emojis Encryption key emojis fingerprint //@allow_p2p True, if peer-to-peer connection is allowed by users privacy settings -callStateReady protocol:callProtocol servers:vector config:string encryption_key:bytes emojis:vector allow_p2p:Bool = CallState; +//@custom_parameters Custom JSON-encoded call parameters to be passed to tgcalls +callStateReady protocol:callProtocol servers:vector config:string encryption_key:bytes emojis:vector allow_p2p:Bool custom_parameters:string = CallState; //@description The call is hanging up after discardCall has been called callStateHangingUp = CallState; @@ -4177,7 +4229,7 @@ groupCallParticipantVideoInfo source_groups:vector en groupCallParticipant participant_id:MessageSender audio_source_id:int32 screen_sharing_audio_source_id:int32 video_info:groupCallParticipantVideoInfo screen_sharing_video_info:groupCallParticipantVideoInfo bio:string is_current_user:Bool is_speaking:Bool is_hand_raised:Bool can_be_muted_for_all_users:Bool can_be_unmuted_for_all_users:Bool can_be_muted_for_current_user:Bool can_be_unmuted_for_current_user:Bool is_muted_for_all_users:Bool is_muted_for_current_user:Bool can_unmute_self:Bool volume_level:int32 order:string = GroupCallParticipant; -//@class CallProblem @description Describes the exact type of a problem with a call +//@class CallProblem @description Describes the exact type of problem with a call //@description The user heard their own voice callProblemEcho = CallProblem; @@ -4597,7 +4649,7 @@ inlineQueryResultVideo id:string video:video title:string description:string = I inlineQueryResultVoiceNote id:string voice_note:voiceNote title:string = InlineQueryResult; -//@class InlineQueryResultsButtonType @description Represents a type of a button in results of inline query +//@class InlineQueryResultsButtonType @description Represents a type of button in results of inline query //@description Describes the button that opens a private chat with the bot and sends a start message to the bot with the given parameter @parameter The parameter for the bot start message inlineQueryResultsButtonTypeStartBot parameter:string = InlineQueryResultsButtonType; @@ -4873,7 +4925,7 @@ languagePackInfo id:string base_language_pack_id:string name:string native_name: localizationTargetInfo language_packs:vector = LocalizationTargetInfo; -//@class PremiumLimitType @description Describes type of a limit, increased for Premium users +//@class PremiumLimitType @description Describes type of limit, increased for Premium users //@description The maximum number of joined supergroups and channels premiumLimitTypeSupergroupCount = PremiumLimitType; @@ -5026,8 +5078,8 @@ businessFeatureAwayMessage = BusinessFeature; //@description The ability to create links to the business account with predefined message text businessFeatureAccountLinks = BusinessFeature; -//@description The ability to customize intro -businessFeatureIntro = BusinessFeature; +//@description The ability to customize start page +businessFeatureStartPage = BusinessFeature; //@description The ability to connect a bot to the account businessFeatureBots = BusinessFeature; @@ -5216,7 +5268,7 @@ backgroundFillGradient top_color:int32 bottom_color:int32 rotation_angle:int32 = backgroundFillFreeformGradient colors:vector = BackgroundFill; -//@class BackgroundType @description Describes the type of a background +//@class BackgroundType @description Describes the type of background //@description A wallpaper in JPEG format //@is_blurred True, if the wallpaper must be downscaled to fit in 450x450 square and then box-blurred with radius 12 @@ -5722,7 +5774,7 @@ accountTtl days:int32 = AccountTtl; messageAutoDeleteTime time:int32 = MessageAutoDeleteTime; -//@class SessionType @description Represents the type of a session +//@class SessionType @description Represents the type of session //@description The session is running on an Android device sessionTypeAndroid = SessionType; @@ -5921,6 +5973,11 @@ internalLinkTypeBotStart bot_username:string start_parameter:string autostart:Bo //@administrator_rights Expected administrator rights for the bot; may be null internalLinkTypeBotStartInGroup bot_username:string start_parameter:string administrator_rights:chatAdministratorRights = InternalLinkType; +//@description The link is a link to a business chat. Use getBusinessChatLinkInfo with the provided link name to get information about the link, +//-then open received private chat and replace chat draft with the provided text +//@link_name Name of the link +internalLinkTypeBusinessChat link_name:string = InternalLinkType; + //@description The link is a link to the change phone number section of the app internalLinkTypeChangePhoneNumber = InternalLinkType; @@ -5991,8 +6048,8 @@ internalLinkTypeMessageDraft text:formattedText contains_link:Bool = InternalLin //-If empty, then onActivityResult method must be used to return response on Android, or the link tgbot{bot_user_id}://passport/success or tgbot{bot_user_id}://passport/cancel must be opened otherwise internalLinkTypePassportDataRequest bot_user_id:int53 scope:string public_key:string nonce:string callback_url:string = InternalLinkType; -//@description The link can be used to confirm ownership of a phone number to prevent account deletion. Call sendPhoneNumberConfirmationCode with the given hash and phone number to process the link. -//-If succeeded, call checkPhoneNumberConfirmationCode to check entered by the user code, or resendPhoneNumberConfirmationCode to resend it +//@description The link can be used to confirm ownership of a phone number to prevent account deletion. Call sendPhoneNumberCode with the given phone number and with phoneNumberCodeTypeConfirmOwnership with the given hash to process the link. +//-If succeeded, call checkPhoneNumberCode to check entered by the user code, or resendPhoneNumberCode to resend it //@hash Hash value from the link //@phone_number Phone number value from the link internalLinkTypePhoneNumberConfirmation hash:string phone_number:string = InternalLinkType; @@ -6019,9 +6076,11 @@ internalLinkTypePrivacyAndSecuritySettings = InternalLinkType; internalLinkTypeProxy server:string port:int32 type:ProxyType = InternalLinkType; //@description The link is a link to a chat by its username. Call searchPublicChat with the given chat username to process the link -//-If the chat is found, open its profile information screen or the chat itself +//-If the chat is found, open its profile information screen or the chat itself. +//-If draft text isn't empty and the chat is a private chat, then put the draft text in the input field //@chat_username Username of the chat -internalLinkTypePublicChat chat_username:string = InternalLinkType; +//@draft_text Draft text for message to send in the chat +internalLinkTypePublicChat chat_username:string draft_text:string = InternalLinkType; //@description The link can be used to login the current user on another device, but it must be scanned from QR-code using in-app camera. An alert similar to //-"This code can be used to allow someone to log in to your Telegram account. To confirm Telegram login, please go to Settings > Devices > Scan QR and scan the code" needs to be shown @@ -6065,9 +6124,10 @@ internalLinkTypeUnknownDeepLink link:string = InternalLinkType; internalLinkTypeUnsupportedProxy = InternalLinkType; //@description The link is a link to a user by its phone number. Call searchUserByPhoneNumber with the given phone number to process the link. -//-If the user is found, then call createPrivateChat and open the chat +//-If the user is found, then call createPrivateChat and open the chat. If draft text isn't empty, then put the draft text in the input field //@phone_number Phone number of the user -internalLinkTypeUserPhoneNumber phone_number:string = InternalLinkType; +//@draft_text Draft text for message to send in the chat +internalLinkTypeUserPhoneNumber phone_number:string draft_text:string = InternalLinkType; //@description The link is a link to a user by a temporary token. Call searchUserByToken with the given token to process the link. //-If the user is found, then call createPrivateChat and open the chat @@ -6112,7 +6172,7 @@ chatBoostLink link:string is_public:Bool = ChatBoostLink; chatBoostLinkInfo is_public:Bool chat_id:int53 = ChatBoostLinkInfo; -//@class BlockList @description Describes a type of a block list +//@class BlockList @description Describes a type of block list //@description The main block list that disallows writing messages to the current user, receiving their status and photo, viewing of stories, and some other actions blockListMain = BlockList; @@ -6125,7 +6185,7 @@ blockListStories = BlockList; filePart data:bytes = FilePart; -//@class FileType @description Represents the type of a file +//@class FileType @description Represents the type of file //@description The data is not a file fileTypeNone = FileType; @@ -6217,7 +6277,7 @@ storageStatisticsFast files_size:int53 file_count:int32 database_size:int53 lang databaseStatistics statistics:string = DatabaseStatistics; -//@class NetworkType @description Represents the type of a network +//@class NetworkType @description Represents the type of network //@description The network is not available networkTypeNone = NetworkType; @@ -6357,7 +6417,7 @@ foundPosition position:int32 = FoundPosition; foundPositions total_count:int32 positions:vector = FoundPositions; -//@class TMeUrlType @description Describes the type of a URL linking to an internal Telegram entity +//@class TMeUrlType @description Describes the type of URL linking to an internal Telegram entity //@description A URL linking to a user @user_id Identifier of the user tMeUrlTypeUser user_id:int53 = TMeUrlType; @@ -6442,7 +6502,7 @@ textParseModeMarkdown version:int32 = TextParseMode; textParseModeHTML = TextParseMode; -//@class ProxyType @description Describes the type of a proxy server +//@class ProxyType @description Describes the type of proxy server //@description A SOCKS5 proxy server @username Username for logging in; may be empty @password Password for logging in; may be empty proxyTypeSocks5 username:string password:string = ProxyType; @@ -6497,7 +6557,7 @@ statisticalGraphAsync token:string = StatisticalGraph; statisticalGraphError error_message:string = StatisticalGraph; -//@class ChatStatisticsObjectType @description Describes type of an object, for which statistics are provided +//@class ChatStatisticsObjectType @description Describes type of object, for which statistics are provided //@description Describes a message sent in the chat @message_id Message identifier chatStatisticsObjectTypeMessage message_id:int53 = ChatStatisticsObjectType; @@ -6579,6 +6639,16 @@ chatStatisticsSupergroup period:dateRange member_count:statisticalValue message_ chatStatisticsChannel period:dateRange member_count:statisticalValue mean_message_view_count:statisticalValue mean_message_share_count:statisticalValue mean_message_reaction_count:statisticalValue mean_story_view_count:statisticalValue mean_story_share_count:statisticalValue mean_story_reaction_count:statisticalValue enabled_notifications_percentage:double member_count_graph:StatisticalGraph join_graph:StatisticalGraph mute_graph:StatisticalGraph view_count_by_hour_graph:StatisticalGraph view_count_by_source_graph:StatisticalGraph join_by_source_graph:StatisticalGraph language_graph:StatisticalGraph message_interaction_graph:StatisticalGraph message_reaction_graph:StatisticalGraph story_interaction_graph:StatisticalGraph story_reaction_graph:StatisticalGraph instant_view_interaction_graph:StatisticalGraph recent_interactions:vector = ChatStatistics; +//@description A detailed statistics about revenue earned from sponsored messages in a chat +//@revenue_by_hour_graph A graph containing amount of revenue in a given hour +//@revenue_graph A graph containing amount of revenue +//@cryptocurrency Cryptocurrency in which revenue is calculated +//@cryptocurrency_total_amount Total amount of the cryptocurrency earned, in the smallest units of the cryptocurrency +//@cryptocurrency_balance_amount Amount of the cryptocurrency that isn't withdrawn yet, in the smallest units of the cryptocurrency +//@cryptocurrency_available_amount Amount of the cryptocurrency available for withdrawal, in the smallest units of the cryptocurrency +//@usd_rate Current conversion rate of the cryptocurrency to USD +chatRevenueStatistics revenue_by_hour_graph:StatisticalGraph revenue_graph:StatisticalGraph cryptocurrency:string cryptocurrency_total_amount:int64 cryptocurrency_balance_amount:int64 cryptocurrency_available_amount:int64 usd_rate:double = ChatRevenueStatistics; + //@description A detailed statistics about a message //@message_interaction_graph A graph containing number of message views and shares //@message_reaction_graph A graph containing number of message reactions @@ -6590,6 +6660,48 @@ messageStatistics message_interaction_graph:StatisticalGraph message_reaction_gr storyStatistics story_interaction_graph:StatisticalGraph story_reaction_graph:StatisticalGraph = StoryStatistics; +//@class ChatRevenueWithdrawalState @description Describes state of a chat revenue withdrawal + +//@description Withdrawal is pending +chatRevenueWithdrawalStatePending = ChatRevenueWithdrawalState; + +//@description Withdrawal was completed +//@date Point in time (Unix timestamp) when the withdrawal was completed +//@url The URL where the withdrawal transaction can be viewed +chatRevenueWithdrawalStateCompleted date:int32 url:string = ChatRevenueWithdrawalState; + +//@description Withdrawal has_failed +chatRevenueWithdrawalStateFailed = ChatRevenueWithdrawalState; + + +//@class ChatRevenueTransactionType @description Describes type of transaction for revenue earned from sponsored messages in a chat + +//@description Describes earnings from sponsored messages in a chat in some time frame +//@start_date Point in time (Unix timestamp) when the earnings started +//@end_date Point in time (Unix timestamp) when the earnings ended +chatRevenueTransactionTypeEarnings start_date:int32 end_date:int32 = ChatRevenueTransactionType; + +//@description Describes a withdrawal of earnings +//@withdrawal_date Point in time (Unix timestamp) when the earnings withdrawal started +//@provider Name of the payment provider +//@state State of the withdrawal +chatRevenueTransactionTypeWithdrawal withdrawal_date:int32 provider:string state:ChatRevenueWithdrawalState = ChatRevenueTransactionType; + +//@description Describes a refund for failed withdrawal of earnings +//@refund_date Point in time (Unix timestamp) when the transaction was refunded +//@provider Name of the payment provider +chatRevenueTransactionTypeRefund refund_date:int32 provider:string = ChatRevenueTransactionType; + +//@description Contains a chat revenue transactions +//@cryptocurrency Cryptocurrency in which revenue is calculated +//@cryptocurrency_amount The withdrawn amount, in the smallest units of the cryptocurrency +//@type Type of the transaction +chatRevenueTransaction cryptocurrency:string cryptocurrency_amount:int64 type:ChatRevenueTransactionType = ChatRevenueTransaction; + +//@description Contains a list of chat revenue transactions @total_count Total number of transactions @transactions List of transactions +chatRevenueTransactions total_count:int32 transactions:vector = ChatRevenueTransactions; + + //@description A point on a Cartesian plane @x The point's first coordinate @y The point's second coordinate point x:double y:double = Point; @@ -6627,6 +6739,19 @@ botCommandScopeChatAdministrators chat_id:int53 = BotCommandScope; botCommandScopeChatMember chat_id:int53 user_id:int53 = BotCommandScope; +//@class PhoneNumberCodeType @description Describes type of the request for which a code is sent to a phone number + +//@description Checks ownership of a new phone number to change the user's authentication phone number; for official Android and iOS applications only. +phoneNumberCodeTypeChange = PhoneNumberCodeType; + +//@description Verifies ownership of a phone number to be added to the user's Telegram Passport +phoneNumberCodeTypeVerify = PhoneNumberCodeType; + +//@description Confirms ownership of a phone number to prevent account deletion while handling links of the type internalLinkTypePhoneNumberConfirmation +//@hash Hash value from the link +phoneNumberCodeTypeConfirmOwnership hash:string = PhoneNumberCodeType; + + //@class Update @description Contains notifications about data changes //@description The user authorization state has changed @authorization_state New authorization state @@ -6730,6 +6855,9 @@ updateChatReadOutbox chat_id:int53 last_read_outbox_message_id:int53 = Update; //@description The chat action bar was changed @chat_id Chat identifier @action_bar The new value of the action bar; may be null updateChatActionBar chat_id:int53 action_bar:ChatActionBar = Update; +//@description The bar for managing business bot was changed in a chat @chat_id Chat identifier @business_bot_manage_bar The new value of the business bot manage bar; may be null +updateChatBusinessBotManageBar chat_id:int53 business_bot_manage_bar:businessBotManageBar = Update; + //@description The chat available reactions were changed @chat_id Chat identifier @available_reactions The new reactions, available in the chat updateChatAvailableReactions chat_id:int53 available_reactions:ChatAvailableReactions = Update; @@ -7088,12 +7216,14 @@ updateAnimationSearchParameters provider:string emojis:vector = Update; //@description The list of suggested to the user actions has changed @added_actions Added suggested actions @removed_actions Removed suggested actions updateSuggestedActions added_actions:vector removed_actions:vector = Update; +//@description Download or upload file speed for the user was limited, but it can be restored by subscription to Telegram Premium. The notification can be postponed until a being downloaded or uploaded file is visible to the user +//-Use getOption("premium_download_speedup") or getOption("premium_upload_speedup") to get expected speedup after subscription to Telegram Premium +//@is_upload True, if upload speed was limited; false, if download speed was limited +updateSpeedLimitNotification is_upload:Bool = Update; + //@description The list of contacts that had birthdays recently or will have birthday soon has changed @close_birthday_users List of contact users with close birthday updateContactCloseBirthdays close_birthday_users:vector = Update; -//@description Adding users to a chat has failed because of their privacy settings. An invite link can be shared with the users if appropriate @chat_id Chat identifier @user_ids Identifiers of users, which weren't added because of their privacy settings -updateAddChatMembersPrivacyForbidden chat_id:int53 user_ids:vector = Update; - //@description Autosave settings for some type of chats were updated @scope Type of chats for which autosave settings were updated @settings The new autosave settings; may be null if the settings are reset to default updateAutosaveSettings scope:AutosaveSettingsScope settings:scopeAutosaveSettings = Update; @@ -7539,7 +7669,7 @@ getChatSimilarChats chat_id:int53 = Chats; //@return_local Pass true to get the number of chats without sending network requests, or -1 if the number of chats is unknown locally getChatSimilarChatCount chat_id:int53 return_local:Bool = Count; -//@description Informs TDLib that a chat was opened from the list of similar chats. The method is independent from openChat and closeChat methods +//@description Informs TDLib that a chat was opened from the list of similar chats. The method is independent of openChat and closeChat methods //@chat_id Identifier of the original chat, which similar chats were requested //@opened_chat_id Identifier of the opened chat openChatSimilarChat chat_id:int53 opened_chat_id:int53 = Ok; @@ -8040,6 +8170,35 @@ loadQuickReplyShortcutMessages shortcut_id:int32 = Ok; //@message_ids Unique identifiers of the messages deleteQuickReplyShortcutMessages shortcut_id:int32 message_ids:vector = Ok; +//@description Adds a message to a quick reply shortcut. If shortcut doesn't exist and there are less than getOption("quick_reply_shortcut_count_max") shortcuts, then a new shortcut is created. +//-The shortcut must not contain more than getOption("quick_reply_shortcut_message_count_max") messages after adding the new message. Returns the added message +//@shortcut_name Name of the target shortcut +//@reply_to_message_id Identifier of a quick reply message in the same shortcut to be replied; pass 0 if none +//@input_message_content The content of the message to be added; inputMessagePoll, inputMessageForwarded and inputMessageLocation with live_period aren't supported +addQuickReplyShortcutMessage shortcut_name:string reply_to_message_id:int53 input_message_content:InputMessageContent = QuickReplyMessage; + +//@description Adds a message to a quick reply shortcut via inline bot. If shortcut doesn't exist and there are less than getOption("quick_reply_shortcut_count_max") shortcuts, then a new shortcut is created. +//-The shortcut must not contain more than getOption("quick_reply_shortcut_message_count_max") messages after adding the new message. Returns the added message +//@shortcut_name Name of the target shortcut +//@reply_to_message_id Identifier of a quick reply message in the same shortcut to be replied; pass 0 if none +//@query_id Identifier of the inline query +//@result_id Identifier of the inline query result +//@hide_via_bot Pass true to hide the bot, via which the message is sent. Can be used only for bots getOption("animation_search_bot_username"), getOption("photo_search_bot_username"), and getOption("venue_search_bot_username") +addQuickReplyShortcutInlineQueryResultMessage shortcut_name:string reply_to_message_id:int53 query_id:int64 result_id:string hide_via_bot:Bool = QuickReplyMessage; + +//@description Readds quick reply messages which failed to add. Can be called only for messages for which messageSendingStateFailed.can_retry is true and after specified in messageSendingStateFailed.retry_after time passed. +//-If a message is readded, the corresponding failed to send message is deleted. Returns the sent messages in the same order as the message identifiers passed in message_ids. If a message can't be readded, null will be returned instead of the message +//@shortcut_name Name of the target shortcut +//@message_ids Identifiers of the quick reply messages to readd. Message identifiers must be in a strictly increasing order +readdQuickReplyShortcutMessages shortcut_name:string message_ids:vector = QuickReplyMessages; + +//@description Asynchronously edits the text, media or caption of a quick reply message. Use quickReplyMessage.can_be_edited to check whether a message can be edited. +//-Text message can be edited only to a text message. The type of message content in an album can't be changed with exception of replacing a photo with a video or vice versa +//@shortcut_id Unique identifier of the quick reply shortcut with the message +//@message_id Identifier of the message +//@input_message_content New content of the message. Must be one of the following types: inputMessageText, inputMessageAnimation, inputMessageAudio, inputMessageDocument, inputMessagePhoto or inputMessageVideo +editQuickReplyMessage shortcut_id:int32 message_id:int53 input_message_content:InputMessageContent = Ok; + //@description Returns list of custom emojis, which can be used as forum topic icon by all users getForumTopicDefaultIcons = Stickers; @@ -8423,7 +8582,7 @@ clickAnimatedEmojiMessage chat_id:int53 message_id:int53 = Sticker; //@description Returns an HTTPS or a tg: link with the given type. Can be called before authorization @type Expected type of the link @is_http Pass true to create an HTTPS link (only available for some link types); pass false to create a tg: link getInternalLink type:InternalLinkType is_http:Bool = HttpUrl; -//@description Returns information about the type of an internal link. Returns a 404 error if the link is not internal. Can be called before authorization @link The link +//@description Returns information about the type of internal link. Returns a 404 error if the link is not internal. Can be called before authorization @link The link getInternalLinkType link:string = InternalLinkType; //@description Returns information about an action to be done when the current user clicks an external link. Don't use this method for links from secret chats if web page preview is disabled in secret chats @link The link @@ -8460,11 +8619,11 @@ createSupergroupChat supergroup_id:int53 force:Bool = Chat; //@description Returns an existing chat corresponding to a known secret chat @secret_chat_id Secret chat identifier createSecretChat secret_chat_id:int32 = Chat; -//@description Creates a new basic group and sends a corresponding messageBasicGroupChatCreate. Returns the newly created chat +//@description Creates a new basic group and sends a corresponding messageBasicGroupChatCreate. Returns information about the newly created chat //@user_ids Identifiers of users to be added to the basic group; may be empty to create a basic group without other members //@title Title of the new basic group; 1-128 characters //@message_auto_delete_time Message auto-delete time value, in seconds; must be from 0 up to 365 * 86400 and be divisible by 86400. If 0, then messages aren't deleted automatically -createNewBasicGroupChat user_ids:vector title:string message_auto_delete_time:int32 = Chat; +createNewBasicGroupChat user_ids:vector title:string message_auto_delete_time:int32 = CreatedBasicGroupChat; //@description Creates a new supergroup or channel and sends a corresponding messageSupergroupChatCreate. Returns the newly created chat //@title Title of the new chat; 1-128 characters @@ -8697,16 +8856,17 @@ joinChat chat_id:int53 = Ok; //@description Removes the current user from chat members. Private and secret chats can't be left using this method @chat_id Chat identifier leaveChat chat_id:int53 = Ok; -//@description Adds a new member to a chat; requires can_invite_users member right. Members can't be added to private or secret chats +//@description Adds a new member to a chat; requires can_invite_users member right. Members can't be added to private or secret chats. Returns information about members that weren't added //@chat_id Chat identifier //@user_id Identifier of the user //@forward_limit The number of earlier messages from the chat to be forwarded to the new member; up to 100. Ignored for supergroups and channels, or if the added user is a bot -addChatMember chat_id:int53 user_id:int53 forward_limit:int32 = Ok; +addChatMember chat_id:int53 user_id:int53 forward_limit:int32 = FailedToAddMembers; -//@description Adds multiple new members to a chat; requires can_invite_users member right. Currently, this method is only available for supergroups and channels. This method can't be used to join a chat. Members can't be added to a channel if it has more than 200 members +//@description Adds multiple new members to a chat; requires can_invite_users member right. Currently, this method is only available for supergroups and channels. +//-This method can't be used to join a chat. Members can't be added to a channel if it has more than 200 members. Returns information about members that weren't added //@chat_id Chat identifier //@user_ids Identifiers of the users to be added to the chat. The maximum number of added users is 20 for supergroups and 100 for channels -addChatMembers chat_id:int53 user_ids:vector = Ok; +addChatMembers chat_id:int53 user_ids:vector = FailedToAddMembers; //@description Changes the status of a chat member; requires can_invite_users member right to add a chat member, can_promote_members administrator right to change administrator rights of the member, //-and can_restrict_members administrator right to change restrictions of a user. This function is currently not suitable for transferring chat ownership; use transferChatOwnership instead. @@ -8933,7 +9093,7 @@ getStoryPublicForwards story_sender_chat_id:int53 story_id:int32 offset:string l //@level Chat boost level getChatBoostLevelFeatures is_channel:Bool level:int32 = ChatBoostLevelFeatures; -//@description Returns list of features available on the first 10 chat boost levels; this is an offline request +//@description Returns list of features available for different chat boost levels; this is an offline request //@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; @@ -9054,7 +9214,7 @@ readFilePart file_id:int32 offset:int53 count:int53 = FilePart; deleteFile file_id:int32 = Ok; //@description Adds a file from a message to the list of file downloads. Download progress and completion of the download will be notified through updateFile updates. -//-If message database is used, the list of file downloads is persistent across application restarts. The downloading is independent from download using downloadFile, i.e. it continues if downloadFile is canceled or is used to download a part of the file +//-If message database is used, the list of file downloads is persistent across application restarts. The downloading is independent of download using downloadFile, i.e. it continues if downloadFile is canceled or is used to download a part of the file //@file_id Identifier of the file to download //@chat_id Chat identifier of the message with the file //@message_id Message identifier @@ -9444,6 +9604,9 @@ getAllStickerEmojis sticker_type:StickerType query:string chat_id:int53 return_o //@limit The maximum number of stickers to be returned; 0-100 searchStickers sticker_type:StickerType emojis:string limit:int32 = Stickers; +//@description Returns greeting stickers from regular sticker sets that can be used for the start page of other users +getGreetingStickers = Stickers; + //@description Returns premium stickers from regular sticker sets @limit The maximum number of stickers to be returned; 0-100 getPremiumStickers limit:int32 = Stickers; @@ -9641,19 +9804,25 @@ setBusinessGreetingMessageSettings greeting_message_settings:businessGreetingMes //@description Changes the business away message settings of the current user. Requires Telegram Business subscription @away_message_settings The new settings for the away message of the business; pass null to disable the away message setBusinessAwayMessageSettings away_message_settings:businessAwayMessageSettings = Ok; -//@description Changes the business intro of the current user. Requires Telegram Business subscription @intro The new intro of the business; pass null to remove the intro -setBusinessIntro intro:inputBusinessIntro = Ok; +//@description Changes the business start page of the current user. Requires Telegram Business subscription @start_page The new start page of the business; pass null to remove custom start page +setBusinessStartPage start_page:inputBusinessStartPage = Ok; -//@description Changes the phone number of the user and sends an authentication code to the user's new phone number; for official Android and iOS applications only. On success, returns information about the sent code -//@phone_number The new phone number of the user in international format + +//@description Sends a code to the specified phone number. Aborts previous phone number verification if there was one. On success, returns information about the sent code +//@phone_number The phone number, in international format //@settings Settings for the authentication of the user's phone number; pass null to use default settings -changePhoneNumber phone_number:string settings:phoneNumberAuthenticationSettings = AuthenticationCodeInfo; +//@type Type of the request for which the code is sent +sendPhoneNumberCode phone_number:string settings:phoneNumberAuthenticationSettings type:PhoneNumberCodeType = AuthenticationCodeInfo; -//@description Resends the authentication code sent to confirm a new phone number for the current user. Works only if the previously received authenticationCodeInfo next_code_type was not null and the server-specified timeout has passed -resendChangePhoneNumberCode = AuthenticationCodeInfo; +//@description Sends Firebase Authentication SMS to the specified phone number. Works only when received a code of the type authenticationCodeTypeFirebaseAndroid or authenticationCodeTypeFirebaseIos +//@token SafetyNet Attestation API token for the Android application, or secret from push notification for the iOS application +sendPhoneNumberFirebaseSms token:string = Ok; -//@description Checks the authentication code sent to confirm a new phone number of the user @code Authentication code to check -checkChangePhoneNumberCode code:string = Ok; +//@description Resends the authentication code sent to a phone number. Works only if the previously received authenticationCodeInfo next_code_type was not null and the server-specified timeout has passed +resendPhoneNumberCode = AuthenticationCodeInfo; + +//@description Check the authentication code and completes the request for which the code was sent if appropriate @code Authentication code to check +checkPhoneNumberCode code:string = Ok; //@description Returns the business bot that is connected to the current user account. Returns a 404 error if there is no connected bot @@ -9665,6 +9834,31 @@ setBusinessConnectedBot bot:businessConnectedBot = Ok; //@description Deletes the business bot that is connected to the current user account @bot_user_id Unique user identifier for the bot deleteBusinessConnectedBot bot_user_id:int53 = Ok; +//@description Pauses or resumes the connected business bot in a specific chat @chat_id Chat identifier @is_paused Pass true to pause the connected bot in the chat; pass false to resume the bot +toggleBusinessConnectedBotChatIsPaused chat_id:int53 is_paused:Bool = Ok; + +//@description Removes the connected business bot from a specific chat by adding the chat to businessRecipients.excluded_chat_ids @chat_id Chat identifier +removeBusinessConnectedBotFromChat chat_id:int53 = Ok; + + +//@description Returns business chat links created for the current account +getBusinessChatLinks = BusinessChatLinks; + +//@description Creates a business chat link for the current account. Requires Telegram Business subscription. There can be up to getOption("business_chat_link_count_max") links created. Returns the created link +//@link_info Information about the link to create +createBusinessChatLink link_info:inputBusinessChatLink = BusinessChatLink; + +//@description Edits a business chat link of the current account. Requires Telegram Business subscription. Returns the edited link +//@link The link to edit +//@link_info New description of the link +editBusinessChatLink link:string link_info:inputBusinessChatLink = BusinessChatLink; + +//@description Deletes a business chat link of the current account @link The link to delete +deleteBusinessChatLink link:string = Ok; + +//@description Returns information about a business chat link @link_name Name of the link +getBusinessChatLinkInfo link_name:string = BusinessChatLinkInfo; + //@description Returns an HTTPS link, which can be used to get information about the current user getUserLink = UserLink; @@ -9840,6 +10034,11 @@ toggleSupergroupJoinByRequest supergroup_id:int53 join_by_request:Bool = Ok; //@description Toggles whether the message history of a supergroup is available to new members; requires can_change_info member right @supergroup_id The identifier of the supergroup @is_all_history_available The new value of is_all_history_available toggleSupergroupIsAllHistoryAvailable supergroup_id:int53 is_all_history_available:Bool = Ok; +//@description Toggles whether sponsored messages are shown in the channel chat; requires owner privileges in the channel. The chat must have at least chatBoostFeatures.min_sponsored_message_disable_boost_level boost level to disable sponsored messages +//@supergroup_id The identifier of the channel +//@can_have_sponsored_messages The new value of can_have_sponsored_messages +toggleSupergroupCanHaveSponsoredMessages supergroup_id:int53 can_have_sponsored_messages:Bool = Ok; + //@description Toggles whether non-administrators can receive only administrators and bots using getSupergroupMembers or searchChatMembers. Can be called only if supergroupFullInfo.can_hide_members == true //@supergroup_id Identifier of the supergroup //@has_hidden_members New value of has_hidden_members @@ -9868,7 +10067,7 @@ reportSupergroupAntiSpamFalsePositive supergroup_id:int53 message_id:int53 = Ok; //@supergroup_id Identifier of the supergroup or channel //@filter The type of users to return; pass null to use supergroupMembersFilterRecent //@offset Number of users to skip -//@limit The maximum number of users be returned; up to 200 +//@limit The maximum number of users to be returned; up to 200 getSupergroupMembers supergroup_id:int53 filter:SupergroupMembersFilter offset:int32 limit:int32 = ChatMembers; @@ -10086,6 +10285,21 @@ reportChatPhoto chat_id:int53 file_id:int32 reason:ReportReason text:string = Ok reportMessageReactions chat_id:int53 message_id:int53 sender_id:MessageSender = Ok; +//@description Returns detailed revenue statistics about a chat. Currently, this method can be used only for channels if supergroupFullInfo.can_get_revenue_statistics == true @chat_id Chat identifier @is_dark Pass true if a dark theme is used by the application +getChatRevenueStatistics chat_id:int53 is_dark:Bool = ChatRevenueStatistics; + +//@description Returns URL for chat revenue withdrawal; requires owner privileges in the chat. Currently, this method can be used only for channels if supergroupFullInfo.can_get_revenue_statistics == true and getOption("can_withdraw_chat_revenue") +//@chat_id Chat identifier +//@password The 2-step verification password of the current user +getChatRevenueWithdrawalUrl chat_id:int53 password:string = HttpUrl; + +//@description Returns list of revenue transactions for a chat. Currently, this method can be used only for channels if supergroupFullInfo.can_get_revenue_statistics == true +//@chat_id Chat identifier +//@offset Number of transactions to skip +//@limit The maximum number of transactions to be returned; up to 200 +getChatRevenueTransactions chat_id:int53 offset:int32 limit:int32 = ChatRevenueTransactions; + + //@description Returns detailed statistics about a chat. Currently, this method can be used only for supergroups and channels. Can be used only if supergroupFullInfo.can_get_statistics == true @chat_id Chat identifier @is_dark Pass true if a dark theme is used by the application getChatStatistics chat_id:int53 is_dark:Bool = ChatStatistics; @@ -10185,18 +10399,6 @@ setPassportElementErrors user_id:int53 errors:vector getPreferredCountryLanguage country_code:string = Text; -//@description Sends a code to verify a phone number to be added to a user's Telegram Passport -//@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 -sendPhoneNumberVerificationCode phone_number:string settings:phoneNumberAuthenticationSettings = AuthenticationCodeInfo; - -//@description Resends the code to verify a phone number to be added to a user's Telegram Passport -resendPhoneNumberVerificationCode = AuthenticationCodeInfo; - -//@description Checks the phone number verification code for Telegram Passport @code Verification code to check -checkPhoneNumberVerificationCode code:string = Ok; - - //@description Sends a code to verify an email address to be added to a user's Telegram Passport @email_address Email address sendEmailAddressVerificationCode email_address:string = EmailAddressAuthenticationCodeInfo; @@ -10225,19 +10427,6 @@ getPassportAuthorizationFormAvailableElements authorization_form_id:int32 passwo sendPassportAuthorizationForm authorization_form_id:int32 types:vector = Ok; -//@description Sends phone number confirmation code to handle links of the type internalLinkTypePhoneNumberConfirmation -//@hash Hash value from the link -//@phone_number Phone number value from the link -//@settings Settings for the authentication of the user's phone number; pass null to use default settings -sendPhoneNumberConfirmationCode hash:string phone_number:string settings:phoneNumberAuthenticationSettings = AuthenticationCodeInfo; - -//@description Resends phone number confirmation code -resendPhoneNumberConfirmationCode = AuthenticationCodeInfo; - -//@description Checks phone number confirmation code @code Confirmation code to check -checkPhoneNumberConfirmationCode code:string = Ok; - - //@description Informs the server about the number of pending bot updates if they haven't been processed for a long time; for bots only @pending_update_count The number of pending updates @error_message The last error message setBotUpdatesStatus pending_update_count:int32 error_message:string = Ok;