From 4e279fb246c419d0b904b58da17bd6df8db5acb6 Mon Sep 17 00:00:00 2001 From: c0re100 Date: Sat, 29 Aug 2026 16:02:50 +0800 Subject: [PATCH] Update to TDLib 1.8.67 --- client/function.go | 431 ++++++++++++++++++- client/type.go | 954 ++++++++++++++++++++++++++++++++++++++++-- client/unmarshaler.go | 330 ++++++++++++++- data/td_api.tl | 314 +++++++++++--- 4 files changed, 1922 insertions(+), 107 deletions(-) diff --git a/client/function.go b/client/function.go index 9d5d34a..b9d4482 100755 --- a/client/function.go +++ b/client/function.go @@ -3187,6 +3187,93 @@ func (client *Client) SetPinnedSavedMessagesTopics(req *SetPinnedSavedMessagesTo return UnmarshalOk(result.Data) } +type LoadCommunityFullInfoRequest struct { + // Community identifier + CommunityId int64 `json:"community_id"` +} + +// Returns full information about a community. The data will be sent through update. +func (client *Client) LoadCommunityFullInfo(req *LoadCommunityFullInfoRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "loadCommunityFullInfo", + }, + Data: map[string]interface{}{ + "community_id": req.CommunityId, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + +type CreateCommunityRequest struct { + // Name of the new community + Name string `json:"name"` + // Identifier of the chat in the community; only chats with owned bots and owned basic group, supergroup and channel chats are allowed; basic group chats will be automatically upgraded to supergroup chats + ChatId int64 `json:"chat_id"` + // Pass true if the chat will be visible only to administrators of the community + IsChatHidden bool `json:"is_chat_hidden"` +} + +// Creates a new community for the given chat. Returns identifier of the created community +func (client *Client) CreateCommunity(req *CreateCommunityRequest) (*CommunityId, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "createCommunity", + }, + Data: map[string]interface{}{ + "name": req.Name, + "chat_id": req.ChatId, + "is_chat_hidden": req.IsChatHidden, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalCommunityId(result.Data) +} + +type SetCommunityNameRequest struct { + // Identifier of the community + CommunityId int64 `json:"community_id"` + // New name of the community + Name string `json:"name"` +} + +// Changes name of the given community; requires can_change_info administrator right in the community +func (client *Client) SetCommunityName(req *SetCommunityNameRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "setCommunityName", + }, + Data: map[string]interface{}{ + "community_id": req.CommunityId, + "name": req.Name, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + type GetGroupsInCommonRequest struct { // User identifier UserId int64 `json:"user_id"` @@ -5589,15 +5676,19 @@ type SendEphemeralMessageRequest struct { ReceiverUserId int64 `json:"receiver_user_id"` // Identifier of the callback query which triggered the message; for bots only CallbackQueryId JsonInt64 `json:"callback_query_id"` + // Pass true if the ephemeral message must replace the message from which the callback query originated; for bots only + ReplaceCallbackQueryMessage bool `json:"replace_callback_query_message"` // Information about the message to be replied; pass null if none. The message can be an incoming ephemeral message ReplyTo InputMessageReplyTo `json:"reply_to"` + // Pass true if the content of the message must be protected from forwarding and saving; for bots only + ProtectContent bool `json:"protect_content"` // Non-persistent identifier, which will be returned back in messageSendingStatePending object and can be used to match sent messages and corresponding updateNewMessage updates SendingId int32 `json:"sending_id"` // Pass true to get a fake message instead of actually sending them OnlyPreview bool `json:"only_preview"` // Markup for replying to the message; pass null if none; for bots only ReplyMarkup ReplyMarkup `json:"reply_markup"` - // The content of the message to be sent. Must be one of the following types: inputMessageText, inputMessageAnimation, inputMessageAudio, inputMessageDocument, inputMessagePhoto, inputMessageSticker, inputMessageVideo, inputMessageVideoNote, inputMessageVoiceNote, inputMessageLocation, inputMessageVenue, inputMessageContact + // The content of the message to be sent. Must be one of the following types: inputMessageText, inputMessageAnimation, inputMessageAudio, inputMessageDocument, inputMessagePhoto, inputMessageRichMessage, inputMessageSticker, inputMessageVideo, inputMessageVideoNote, inputMessageVoiceNote, inputMessageLocation, inputMessageVenue, inputMessageContact InputMessageContent InputMessageContent `json:"input_message_content"` } @@ -5612,7 +5703,9 @@ func (client *Client) SendEphemeralMessage(req *SendEphemeralMessageRequest) (*M "topic_id": req.TopicId, "receiver_user_id": req.ReceiverUserId, "callback_query_id": req.CallbackQueryId, + "replace_callback_query_message": req.ReplaceCallbackQueryMessage, "reply_to": req.ReplyTo, + "protect_content": req.ProtectContent, "sending_id": req.SendingId, "only_preview": req.OnlyPreview, "reply_markup": req.ReplyMarkup, @@ -5705,7 +5798,7 @@ type DeleteEphemeralMessageRequest struct { ChatId int64 `json:"chat_id"` // Identifier of the user who received the message ReceiverUserId int64 `json:"receiver_user_id"` - // Identifiers of the message to be deleted + // Identifier of the message to be deleted EphemeralMessageId int32 `json:"ephemeral_message_id"` } @@ -6175,11 +6268,11 @@ type EditEphemeralMessageRequest struct { EphemeralMessageId int32 `json:"ephemeral_message_id"` // The new message reply markup; pass null if none ReplyMarkup ReplyMarkup `json:"reply_markup"` - // New content of the message; pass null to edit only reply markup. Must be one of the following types: inputMessageText, inputMessageAnimation, inputMessageAudio, inputMessageDocument, inputMessagePhoto, inputMessageSticker, inputMessageVideo, inputMessageVideoNote, inputMessageVoiceNote + // New content of the message; pass null to edit only reply markup. Must be one of the following types: inputMessageText, inputMessageAnimation, inputMessageAudio, inputMessageDocument, inputMessagePhoto, inputMessageRichMessage, inputMessageSticker, inputMessageVideo, inputMessageVideoNote, inputMessageVoiceNote InputMessageContent InputMessageContent `json:"input_message_content"` } -// Edits the text, caption or reply markup of an ephemeral message sent by the bot; for bots only +// Edits the text, media, or reply markup of an ephemeral message sent by the bot; for bots only func (client *Client) EditEphemeralMessage(req *EditEphemeralMessageRequest) (*Ok, error) { result, err := client.Send(Request{ meta: meta{ @@ -6204,6 +6297,82 @@ func (client *Client) EditEphemeralMessage(req *EditEphemeralMessageRequest) (*O return UnmarshalOk(result.Data) } +type EditEphemeralMessageCaptionRequest struct { + // The chat the message belongs to + ChatId int64 `json:"chat_id"` + // Identifier of the user who received the message + ReceiverUserId int64 `json:"receiver_user_id"` + // Identifier of the ephemeral message + EphemeralMessageId int32 `json:"ephemeral_message_id"` + // The new message reply markup; pass null if none + ReplyMarkup ReplyMarkup `json:"reply_markup"` + // New message content caption; pass null to remove caption; 0-getOption("message_caption_length_max") characters + Caption *FormattedText `json:"caption"` + // Pass true to show the caption above the media; otherwise, the caption will be shown below the media. May be true only for animation, photo, and video messages + ShowCaptionAboveMedia bool `json:"show_caption_above_media"` +} + +// Edits the caption and reply markup of an ephemeral message sent by the bot; for bots only +func (client *Client) EditEphemeralMessageCaption(req *EditEphemeralMessageCaptionRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "editEphemeralMessageCaption", + }, + Data: map[string]interface{}{ + "chat_id": req.ChatId, + "receiver_user_id": req.ReceiverUserId, + "ephemeral_message_id": req.EphemeralMessageId, + "reply_markup": req.ReplyMarkup, + "caption": req.Caption, + "show_caption_above_media": req.ShowCaptionAboveMedia, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + +type EditCallbackQueryMessageRequest struct { + // Identifier of the callback query + CallbackQueryId JsonInt64 `json:"callback_query_id"` + // Pass true if the content of the message must be protected from forwarding and saving + ProtectContent bool `json:"protect_content"` + // The new message reply markup; pass null if none + ReplyMarkup ReplyMarkup `json:"reply_markup"` + // New content of the message. Must be one of the following types: inputMessageText, inputMessageAnimation, inputMessageAudio, inputMessageDocument, inputMessagePhoto, inputMessageRichMessage, inputMessageSticker, inputMessageVideo, inputMessageVideoNote, inputMessageVoiceNote + InputMessageContent InputMessageContent `json:"input_message_content"` +} + +// Edits the message from which a callback query has originated with an ephemeral message; for bots only +func (client *Client) EditCallbackQueryMessage(req *EditCallbackQueryMessageRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "editCallbackQueryMessage", + }, + Data: map[string]interface{}{ + "callback_query_id": req.CallbackQueryId, + "protect_content": req.ProtectContent, + "reply_markup": req.ReplyMarkup, + "input_message_content": req.InputMessageContent, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + type EditMessageSchedulingStateRequest struct { // The chat the message belongs to ChatId int64 `json:"chat_id"` @@ -6236,6 +6405,35 @@ func (client *Client) EditMessageSchedulingState(req *EditMessageSchedulingState return UnmarshalOk(result.Data) } +type DeleteMessageEphemeralContentRequest struct { + // The chat the message belongs to + ChatId int64 `json:"chat_id"` + // Identifier of the message + MessageId int64 `json:"message_id"` +} + +// Removes message ephemeral content and reverts message state to the original +func (client *Client) DeleteMessageEphemeralContent(req *DeleteMessageEphemeralContentRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "deleteMessageEphemeralContent", + }, + Data: map[string]interface{}{ + "chat_id": req.ChatId, + "message_id": req.MessageId, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + type SetMessageFactCheckRequest struct { // The channel chat the message belongs to ChatId int64 `json:"chat_id"` @@ -7289,7 +7487,7 @@ type ReaddQuickReplyShortcutMessagesRequest struct { MessageIds []int64 `json:"message_ids"` } -// Re-adds 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 re-added, 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 +// Re-adds 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 re-added, 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 re-added, null will be returned instead of the message func (client *Client) ReaddQuickReplyShortcutMessages(req *ReaddQuickReplyShortcutMessagesRequest) (*QuickReplyMessages, error) { result, err := client.Send(Request{ meta: meta{ @@ -7343,6 +7541,148 @@ func (client *Client) EditQuickReplyMessage(req *EditQuickReplyMessageRequest) ( return UnmarshalOk(result.Data) } +type LoadChatWelcomeMessagesRequest struct { + // The identifier of the chat + ChatId int64 `json:"chat_id"` +} + +// Loads welcome messages of a chat; requires can_send_welcome_messages administrator right in the chat. The loaded messages will be sent through updateChatWelcomeMessages +func (client *Client) LoadChatWelcomeMessages(req *LoadChatWelcomeMessagesRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "loadChatWelcomeMessages", + }, + 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) +} + +type AddChatWelcomeMessageRequest struct { + // The identifier of the chat + ChatId int64 `json:"chat_id"` + // The content of the message to be sent. Must be one of the following types: inputMessageText, inputMessageAnimation, inputMessageAudio, inputMessageDocument, inputMessagePhoto, inputMessageRichMessage, inputMessageSticker, inputMessageVideo, inputMessageVideoNote, inputMessageVoiceNote, inputMessageLocation, inputMessageVenue, inputMessageContact + InputMessageContent InputMessageContent `json:"input_message_content"` +} + +// Adds a message to the list of welcome messages of a chat; requires can_send_welcome_messages administrator right in the chat. There can be up to getOption("welcome_message_count_max") welcome messages in a chat +func (client *Client) AddChatWelcomeMessage(req *AddChatWelcomeMessageRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "addChatWelcomeMessage", + }, + Data: map[string]interface{}{ + "chat_id": req.ChatId, + "input_message_content": req.InputMessageContent, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + +type EditChatWelcomeMessageRequest struct { + // The identifier of the chat + ChatId int64 `json:"chat_id"` + // The identifier of the welcome message + WelcomeMessageId int32 `json:"welcome_message_id"` + // New content of the message. Must be one of the following types: inputMessageText, inputMessageAnimation, inputMessageAudio, inputMessageDocument, inputMessagePhoto, inputMessageRichMessage, inputMessageSticker, inputMessageVideo, inputMessageVideoNote, inputMessageVoiceNote + InputMessageContent InputMessageContent `json:"input_message_content"` +} + +// Edits a welcome message of a chat; requires can_send_welcome_messages administrator right in the chat +func (client *Client) EditChatWelcomeMessage(req *EditChatWelcomeMessageRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "editChatWelcomeMessage", + }, + Data: map[string]interface{}{ + "chat_id": req.ChatId, + "welcome_message_id": req.WelcomeMessageId, + "input_message_content": req.InputMessageContent, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + +type DeleteChatWelcomeMessageRequest struct { + // The identifier of the chat + ChatId int64 `json:"chat_id"` + // The identifier of the welcome message + WelcomeMessageId int32 `json:"welcome_message_id"` +} + +// Deletes a welcome message of a chat; requires can_send_welcome_messages administrator right in the chat +func (client *Client) DeleteChatWelcomeMessage(req *DeleteChatWelcomeMessageRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "deleteChatWelcomeMessage", + }, + Data: map[string]interface{}{ + "chat_id": req.ChatId, + "welcome_message_id": req.WelcomeMessageId, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + +type DeleteAllChatWelcomeMessagesRequest struct { + // The identifier of the chat + ChatId int64 `json:"chat_id"` +} + +// Deletes all welcome messages of a chat; requires can_send_welcome_messages administrator right in the chat +func (client *Client) DeleteAllChatWelcomeMessages(req *DeleteAllChatWelcomeMessagesRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "deleteAllChatWelcomeMessages", + }, + 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 the list of custom emoji, which can be used as forum topic icon by all users func (client *Client) GetForumTopicDefaultIcons() (*Stickers, error) { result, err := client.Send(Request{ @@ -10440,6 +10780,10 @@ type SendTextMessageDraftRequest struct { ForumTopicId int32 `json:"forum_topic_id"` // Unique identifier of the draft DraftId JsonInt64 `json:"draft_id"` + // Pass true to show the user a button to stop further drafts + CanStop bool `json:"can_stop"` + // Pass true to keep the current draft when the user stops further generation + KeepOnStop bool `json:"keep_on_stop"` // Draft text of the message; pass null to show a "Thinking..." placeholder Text *FormattedText `json:"text"` } @@ -10454,6 +10798,8 @@ func (client *Client) SendTextMessageDraft(req *SendTextMessageDraftRequest) (*O "chat_id": req.ChatId, "forum_topic_id": req.ForumTopicId, "draft_id": req.DraftId, + "can_stop": req.CanStop, + "keep_on_stop": req.KeepOnStop, "text": req.Text, }, }) @@ -10475,6 +10821,10 @@ type SendRichMessageDraftRequest struct { ForumTopicId int32 `json:"forum_topic_id"` // Unique identifier of the draft DraftId JsonInt64 `json:"draft_id"` + // Pass true to show the user a button to stop further drafts + CanStop bool `json:"can_stop"` + // Pass true to keep the current draft when the user stops further generation + KeepOnStop bool `json:"keep_on_stop"` // Draft of the message; file upload isn't supported Message *InputRichMessage `json:"message"` } @@ -10489,6 +10839,8 @@ func (client *Client) SendRichMessageDraft(req *SendRichMessageDraftRequest) (*O "chat_id": req.ChatId, "forum_topic_id": req.ForumTopicId, "draft_id": req.DraftId, + "can_stop": req.CanStop, + "keep_on_stop": req.KeepOnStop, "message": req.Message, }, }) @@ -10503,6 +10855,38 @@ func (client *Client) SendRichMessageDraft(req *SendRichMessageDraftRequest) (*O return UnmarshalOk(result.Data) } +type StopPendingMessageRequest struct { + // Identifier of the chat with the bot + ChatId int64 `json:"chat_id"` + // Identifier of the topic in which the action is performed; pass null if none + TopicId MessageTopic `json:"topic_id"` + // Unique identifier of the message draft within the message thread + DraftId JsonInt64 `json:"draft_id"` +} + +// Stops a pending message generation by a bot +func (client *Client) StopPendingMessage(req *StopPendingMessageRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "stopPendingMessage", + }, + Data: map[string]interface{}{ + "chat_id": req.ChatId, + "topic_id": req.TopicId, + "draft_id": req.DraftId, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + type OpenChatRequest struct { // Chat identifier ChatId int64 `json:"chat_id"` @@ -12448,7 +12832,7 @@ type SetChatDraftMessageRequest struct { ChatId int64 `json:"chat_id"` // Topic in which the draft will be changed; pass null to change the draft for the chat itself TopicId MessageTopic `json:"topic_id"` - // New draft message; pass null to remove the draft. All files in draft message content must be of the type inputFileLocal. Media thumbnails and captions are ignored + // New draft message; pass null to remove the draft DraftMessage *DraftMessage `json:"draft_message"` } @@ -13083,7 +13467,7 @@ 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. Returns information about members that weren't added +// Adds multiple new members to a chat; requires can_invite_users member right. Currently, this method is available only in 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{ @@ -13140,7 +13524,7 @@ func (client *Client) SetChatMemberStatus(req *SetChatMemberStatusRequest) (*Ok, type SetChatMemberTagRequest struct { // Chat identifier ChatId int64 `json:"chat_id"` - // Identifier of the user, which tag is changed. Chats can't have member tags + // Identifier of the user whose tag is changed. Chats can't have member tags UserId int64 `json:"user_id"` // The new tag of the member in the chat; 0-16 characters without emoji Tag string `json:"tag"` @@ -16125,7 +16509,7 @@ type EditChatInviteLinkRequest struct { CreatesJoinRequest bool `json:"creates_join_request"` } -// Edits a non-primary invite link for a chat. Available for basic groups, supergroups, and channels. If the link creates a subscription, then expiration_date, member_limit and creates_join_request must not be used. Requires administrator privileges and can_invite_users right in the chat for own links and owner privileges for other links +// Edits a non-primary invite link for a chat. Available in basic groups, supergroups, and channels. If the link creates a subscription, then expiration_date, member_limit and creates_join_request must not be used. Requires administrator privileges and can_invite_users right in the chat for own links and owner privileges for other links func (client *Client) EditChatInviteLink(req *EditChatInviteLinkRequest) (*ChatInviteLink, error) { result, err := client.Send(Request{ meta: meta{ @@ -16324,7 +16708,7 @@ type RevokeChatInviteLinkRequest struct { InviteLink string `json:"invite_link"` } -// Revokes invite link for a chat. Available for basic groups, supergroups, and channels. Requires administrator privileges and can_invite_users right in the chat for own links and owner privileges for other links. If a primary link is revoked, then additionally to the revoked link returns new primary link +// Revokes invite link for a chat. Available in basic groups, supergroups, and channels. Requires administrator privileges and can_invite_users right in the chat for own links and owner privileges for other links. If a primary link is revoked, then additionally to the revoked link returns new primary link func (client *Client) RevokeChatInviteLink(req *RevokeChatInviteLinkRequest) (*ChatInviteLinks, error) { result, err := client.Send(Request{ meta: meta{ @@ -23306,7 +23690,7 @@ type GetChatEventLogRequest struct { UserIds []int64 `json:"user_ids"` } -// Returns a list of service actions taken by chat members and administrators in the last 48 hours. Available only for supergroups and channels. Requires administrator rights. Returns results in reverse chronological order (i.e., in order of decreasing event_id) +// Returns a list of service actions taken by chat members and administrators in the last 48 hours. Available only in supergroups and channels. Requires administrator rights. Returns results in reverse chronological order (i.e., in order of decreasing event_id) func (client *Client) GetChatEventLog(req *GetChatEventLogRequest) (*ChatEvents, error) { result, err := client.Send(Request{ meta: meta{ @@ -24181,6 +24565,10 @@ type SendResoldGiftRequest struct { OwnerId MessageSender `json:"owner_id"` // The price that the user agreed to pay for the gift Price GiftResalePrice `json:"price"` + // Text to show along with the gift; 0-getOption("gift_text_length_max") characters. Only Bold, Italic, Underline, Strikethrough, Spoiler, CustomEmoji, and DateTime entities are allowed. Must be empty if the receiver enabled paid messages and the price of the gift is less than the price of a paid message to the user + Text *FormattedText `json:"text"` + // Pass true to show gift text and sender only to the gift receiver; otherwise, everyone will be able to see them + IsPrivate bool `json:"is_private"` } // Sends an upgraded gift that is available for resale to another user or channel chat; gifts already owned by the current user must be transferred using transferGift and can't be passed to the method @@ -24193,6 +24581,8 @@ func (client *Client) SendResoldGift(req *SendResoldGiftRequest) (GiftResaleResu "gift_name": req.GiftName, "owner_id": req.OwnerId, "price": req.Price, + "text": req.Text, + "is_private": req.IsPrivate, }, }) if err != nil { @@ -24508,7 +24898,7 @@ func (client *Client) GetUpgradedGiftsPromotionalAnimation() (*Animation, error) type SetGiftResalePriceRequest struct { // Identifier of the unique gift ReceivedGiftId string `json:"received_gift_id"` - // The new price for the unique gift; pass null to disallow gift resale. The current user will receive getOption("gift_resale_star_earnings_per_mille") Telegram Stars for each 1000 Telegram Stars paid for the gift if the gift price is in Telegram Stars or getOption("gift_resale_ton_earnings_per_mille") TON Grams for each 1000 Grams paid for the gift if the gift price is in Grams + // The new price for the unique gift; pass null to disallow gift resale. The current user will receive getOption("gift_resale_star_earnings_per_mille") Telegram Stars for each 1000 Telegram Stars paid for the gift if the gift price is in Telegram Stars or getOption("gift_resale_gram_earnings_per_mille") TON Grams for each 1000 Grams paid for the gift if the gift price is in Grams Price GiftResalePrice `json:"price"` } @@ -28184,7 +28574,7 @@ func (client *Client) ApplyPremiumGiftCode(req *ApplyPremiumGiftCodeRequest) (*O } type GiftPremiumWithStarsRequest struct { - // Identifier of the user which will receive Telegram Premium + // Identifier of the user who will receive Telegram Premium UserId int64 `json:"user_id"` // The number of Telegram Stars to pay for subscription StarCount int64 `json:"star_count"` @@ -30027,6 +30417,9 @@ func (client *Client) TestUseUpdate() (Update, error) { case TypeUpdateMessageContent: return UnmarshalUpdateMessageContent(result.Data) + case TypeUpdateMessageEphemeralContent: + return UnmarshalUpdateMessageEphemeralContent(result.Data) + case TypeUpdateMessageEdited: return UnmarshalUpdateMessageEdited(result.Data) @@ -30162,6 +30555,9 @@ func (client *Client) TestUseUpdate() (Update, error) { case TypeUpdateChatHasScheduledMessages: return UnmarshalUpdateChatHasScheduledMessages(result.Data) + case TypeUpdateChatHasWelcomeMessages: + return UnmarshalUpdateChatHasWelcomeMessages(result.Data) + case TypeUpdateChatFolders: return UnmarshalUpdateChatFolders(result.Data) @@ -30192,6 +30588,9 @@ func (client *Client) TestUseUpdate() (Update, error) { case TypeUpdateQuickReplyShortcutMessages: return UnmarshalUpdateQuickReplyShortcutMessages(result.Data) + case TypeUpdateChatWelcomeMessages: + return UnmarshalUpdateChatWelcomeMessages(result.Data) + case TypeUpdateForumTopicInfo: return UnmarshalUpdateForumTopicInfo(result.Data) @@ -30225,6 +30624,9 @@ func (client *Client) TestUseUpdate() (Update, error) { case TypeUpdatePendingMessage: return UnmarshalUpdatePendingMessage(result.Data) + case TypeUpdateStopMessageDraft: + return UnmarshalUpdateStopMessageDraft(result.Data) + case TypeUpdateCommunity: return UnmarshalUpdateCommunity(result.Data) @@ -30252,6 +30654,9 @@ func (client *Client) TestUseUpdate() (Update, error) { case TypeUpdateSupergroupFullInfo: return UnmarshalUpdateSupergroupFullInfo(result.Data) + case TypeUpdateCommunityFullInfo: + return UnmarshalUpdateCommunityFullInfo(result.Data) + case TypeUpdateServiceNotification: return UnmarshalUpdateServiceNotification(result.Data) diff --git a/client/type.go b/client/type.go index 4a3fbae..d1d4293 100755 --- a/client/type.go +++ b/client/type.go @@ -389,9 +389,12 @@ const ( ClassAccentColor = "AccentColor" ClassProfileAccentColors = "ProfileAccentColors" ClassProfileAccentColor = "ProfileAccentColor" + ClassCommunityId = "CommunityId" ClassCommunityPermissions = "CommunityPermissions" ClassCommunityAdministratorRights = "CommunityAdministratorRights" ClassCommunity = "Community" + ClassCommunityChat = "CommunityChat" + ClassCommunityFullInfo = "CommunityFullInfo" ClassUserRating = "UserRating" ClassRestrictionInfo = "RestrictionInfo" ClassEmojiStatus = "EmojiStatus" @@ -445,6 +448,7 @@ const ( ClassTextQuote = "TextQuote" ClassInputTextQuote = "InputTextQuote" ClassFactCheck = "FactCheck" + ClassEphemeralMessageContent = "EphemeralMessageContent" ClassMessage = "Message" ClassMessages = "Messages" ClassFoundMessages = "FoundMessages" @@ -506,6 +510,7 @@ const ( ClassSharedUser = "SharedUser" ClassSharedChat = "SharedChat" ClassThemeSettings = "ThemeSettings" + ClassInlineButton = "InlineButton" ClassPageBlockCaption = "PageBlockCaption" ClassPageBlockListItem = "PageBlockListItem" ClassInputPageBlockListItem = "InputPageBlockListItem" @@ -593,6 +598,7 @@ const ( ClassQuickReplyMessage = "QuickReplyMessage" ClassQuickReplyMessages = "QuickReplyMessages" ClassQuickReplyShortcut = "QuickReplyShortcut" + ClassWelcomeMessage = "WelcomeMessage" ClassPublicForwards = "PublicForwards" ClassBotMediaPreview = "BotMediaPreview" ClassBotMediaPreviews = "BotMediaPreviews" @@ -1127,6 +1133,7 @@ const ( TypeAccentColor = "accentColor" TypeProfileAccentColors = "profileAccentColors" TypeProfileAccentColor = "profileAccentColor" + TypeCommunityId = "communityId" TypeCommunityPermissions = "communityPermissions" TypeCommunityAdministratorRights = "communityAdministratorRights" TypeCommunityMemberStatusCreator = "communityMemberStatusCreator" @@ -1135,6 +1142,8 @@ const ( TypeCommunityMemberStatusLeft = "communityMemberStatusLeft" TypeCommunityMemberStatusBanned = "communityMemberStatusBanned" TypeCommunity = "community" + TypeCommunityChat = "communityChat" + TypeCommunityFullInfo = "communityFullInfo" TypeUserRating = "userRating" TypeRestrictionInfo = "restrictionInfo" TypeEmojiStatusTypeCustomEmoji = "emojiStatusTypeCustomEmoji" @@ -1255,6 +1264,7 @@ const ( TypeInputMessageReplyToStory = "inputMessageReplyToStory" TypeInputMessageReplyToEphemeralMessage = "inputMessageReplyToEphemeralMessage" TypeFactCheck = "factCheck" + TypeEphemeralMessageContent = "ephemeralMessageContent" TypeMessage = "message" TypeMessages = "messages" TypeFoundMessages = "foundMessages" @@ -1304,6 +1314,7 @@ const ( TypeReactionNotificationSettings = "reactionNotificationSettings" TypeDraftMessageContentText = "draftMessageContentText" TypeDraftMessageContentRichMessage = "draftMessageContentRichMessage" + TypeDraftMessageContentInputRichMessage = "draftMessageContentInputRichMessage" TypeDraftMessageContentVideoNote = "draftMessageContentVideoNote" TypeDraftMessageContentVoiceNote = "draftMessageContentVoiceNote" TypeDraftMessage = "draftMessage" @@ -1352,6 +1363,7 @@ const ( TypeButtonStylePrimary = "buttonStylePrimary" TypeButtonStyleDanger = "buttonStyleDanger" TypeButtonStyleSuccess = "buttonStyleSuccess" + TypeButtonStyleLink = "buttonStyleLink" TypeKeyboardButtonTypeText = "keyboardButtonTypeText" TypeKeyboardButtonTypeRequestPhoneNumber = "keyboardButtonTypeRequestPhoneNumber" TypeKeyboardButtonTypeRequestLocation = "keyboardButtonTypeRequestLocation" @@ -1371,6 +1383,7 @@ const ( TypeInlineKeyboardButtonTypeBuy = "inlineKeyboardButtonTypeBuy" TypeInlineKeyboardButtonTypeUser = "inlineKeyboardButtonTypeUser" TypeInlineKeyboardButtonTypeCopyText = "inlineKeyboardButtonTypeCopyText" + TypeInlineKeyboardButtonTypeDisabled = "inlineKeyboardButtonTypeDisabled" TypeKeyboardButtonSourceMessage = "keyboardButtonSourceMessage" TypeKeyboardButtonSourceWebApp = "keyboardButtonSourceWebApp" TypeInlineKeyboardButton = "inlineKeyboardButton" @@ -1399,6 +1412,7 @@ const ( TypeBuiltInThemeTinted = "builtInThemeTinted" TypeBuiltInThemeArctic = "builtInThemeArctic" TypeThemeSettings = "themeSettings" + TypeInlineButton = "inlineButton" TypeRichTextPlain = "richTextPlain" TypeRichTextBold = "richTextBold" TypeRichTextItalic = "richTextItalic" @@ -1422,6 +1436,7 @@ const ( TypeRichTextCustomEmoji = "richTextCustomEmoji" TypeRichTextIcon = "richTextIcon" TypeRichTextMathematicalExpression = "richTextMathematicalExpression" + TypeRichTextButton = "richTextButton" TypeRichTextDiff = "richTextDiff" TypeRichTextReference = "richTextReference" TypeRichTextReferenceLink = "richTextReferenceLink" @@ -1455,9 +1470,11 @@ const ( TypePageBlockAnchor = "pageBlockAnchor" TypePageBlockList = "pageBlockList" TypePageBlockBlockQuote = "pageBlockBlockQuote" + TypePageBlockExpandableBlockQuote = "pageBlockExpandableBlockQuote" TypePageBlockPullQuote = "pageBlockPullQuote" TypePageBlockAnimation = "pageBlockAnimation" TypePageBlockAudio = "pageBlockAudio" + TypePageBlockDocument = "pageBlockDocument" TypePageBlockPhoto = "pageBlockPhoto" TypePageBlockVideo = "pageBlockVideo" TypePageBlockVoiceNote = "pageBlockVoiceNote" @@ -1471,6 +1488,8 @@ const ( TypePageBlockDetails = "pageBlockDetails" TypePageBlockRelatedArticles = "pageBlockRelatedArticles" TypePageBlockMap = "pageBlockMap" + TypePageBlockButtonRow = "pageBlockButtonRow" + TypePageBlockUnsupported = "pageBlockUnsupported" TypeWebPageInstantView = "webPageInstantView" TypeLinkPreviewAlbumMediaPhoto = "linkPreviewAlbumMediaPhoto" TypeLinkPreviewAlbumMediaVideo = "linkPreviewAlbumMediaVideo" @@ -1684,6 +1703,7 @@ const ( TypeMessageChatAddMembers = "messageChatAddMembers" TypeMessageChatJoinByLink = "messageChatJoinByLink" TypeMessageChatJoinByRequest = "messageChatJoinByRequest" + TypeMessageChatJoinFromCommunity = "messageChatJoinFromCommunity" TypeMessageChatDeleteMember = "messageChatDeleteMember" TypeMessageChatAddedToCommunity = "messageChatAddedToCommunity" TypeMessageChatRemovedFromCommunity = "messageChatRemovedFromCommunity" @@ -1714,7 +1734,7 @@ const ( TypeMessageGiveawayCompleted = "messageGiveawayCompleted" TypeMessageGiveawayWinners = "messageGiveawayWinners" TypeMessageGiftedStars = "messageGiftedStars" - TypeMessageGiftedTon = "messageGiftedTon" + TypeMessageGiftedGrams = "messageGiftedGrams" TypeMessageGiveawayPrizeStars = "messageGiveawayPrizeStars" TypeMessageGift = "messageGift" TypeMessageUpgradedGift = "messageUpgradedGift" @@ -1810,9 +1830,11 @@ const ( TypeInputPageBlockAnchor = "inputPageBlockAnchor" TypeInputPageBlockList = "inputPageBlockList" TypeInputPageBlockBlockQuote = "inputPageBlockBlockQuote" + TypeInputPageBlockExpandableBlockQuote = "inputPageBlockExpandableBlockQuote" TypeInputPageBlockPullQuote = "inputPageBlockPullQuote" TypeInputPageBlockAnimation = "inputPageBlockAnimation" TypeInputPageBlockAudio = "inputPageBlockAudio" + TypeInputPageBlockDocument = "inputPageBlockDocument" TypeInputPageBlockPhoto = "inputPageBlockPhoto" TypeInputPageBlockVideo = "inputPageBlockVideo" TypeInputPageBlockVoiceNote = "inputPageBlockVoiceNote" @@ -1821,6 +1843,7 @@ const ( TypeInputPageBlockTable = "inputPageBlockTable" TypeInputPageBlockDetails = "inputPageBlockDetails" TypeInputPageBlockMap = "inputPageBlockMap" + TypeInputPageBlockButtonRow = "inputPageBlockButtonRow" TypeInputMessageText = "inputMessageText" TypeInputMessageRichMessage = "inputMessageRichMessage" TypeInputMessageAnimation = "inputMessageAnimation" @@ -1868,6 +1891,7 @@ const ( TypeSearchMessagesChatTypeFilterPrivate = "searchMessagesChatTypeFilterPrivate" TypeSearchMessagesChatTypeFilterGroup = "searchMessagesChatTypeFilterGroup" TypeSearchMessagesChatTypeFilterChannel = "searchMessagesChatTypeFilterChannel" + TypeSearchMessagesChatTypeFilterCommunity = "searchMessagesChatTypeFilterCommunity" TypeSearchChatTypeFilterBot = "searchChatTypeFilterBot" TypeSearchChatTypeFilterChannel = "searchChatTypeFilterChannel" TypeChatActionTyping = "chatActionTyping" @@ -1960,6 +1984,7 @@ const ( TypeQuickReplyMessage = "quickReplyMessage" TypeQuickReplyMessages = "quickReplyMessages" TypeQuickReplyShortcut = "quickReplyShortcut" + TypeWelcomeMessage = "welcomeMessage" TypePublicForwardMessage = "publicForwardMessage" TypePublicForwardStory = "publicForwardStory" TypePublicForwards = "publicForwards" @@ -2714,6 +2739,7 @@ const ( TypeUpdateMessageSendSucceeded = "updateMessageSendSucceeded" TypeUpdateMessageSendFailed = "updateMessageSendFailed" TypeUpdateMessageContent = "updateMessageContent" + TypeUpdateMessageEphemeralContent = "updateMessageEphemeralContent" TypeUpdateMessageEdited = "updateMessageEdited" TypeUpdateMessageIsPinned = "updateMessageIsPinned" TypeUpdateMessageInteractionInfo = "updateMessageInteractionInfo" @@ -2759,6 +2785,7 @@ const ( TypeUpdateChatViewAsTopics = "updateChatViewAsTopics" TypeUpdateChatBlockList = "updateChatBlockList" TypeUpdateChatHasScheduledMessages = "updateChatHasScheduledMessages" + TypeUpdateChatHasWelcomeMessages = "updateChatHasWelcomeMessages" TypeUpdateChatFolders = "updateChatFolders" TypeUpdateChatOnlineMemberCount = "updateChatOnlineMemberCount" TypeUpdateSavedMessagesTopic = "updateSavedMessagesTopic" @@ -2769,6 +2796,7 @@ const ( TypeUpdateQuickReplyShortcutDeleted = "updateQuickReplyShortcutDeleted" TypeUpdateQuickReplyShortcuts = "updateQuickReplyShortcuts" TypeUpdateQuickReplyShortcutMessages = "updateQuickReplyShortcutMessages" + TypeUpdateChatWelcomeMessages = "updateChatWelcomeMessages" TypeUpdateForumTopicInfo = "updateForumTopicInfo" TypeUpdateForumTopic = "updateForumTopic" TypeUpdateScopeNotificationSettings = "updateScopeNotificationSettings" @@ -2780,6 +2808,7 @@ const ( TypeUpdateDeleteMessages = "updateDeleteMessages" TypeUpdateChatAction = "updateChatAction" TypeUpdatePendingMessage = "updatePendingMessage" + TypeUpdateStopMessageDraft = "updateStopMessageDraft" TypeUpdateCommunity = "updateCommunity" TypeUpdateUserStatus = "updateUserStatus" TypeUpdateUser = "updateUser" @@ -2789,6 +2818,7 @@ const ( TypeUpdateUserFullInfo = "updateUserFullInfo" TypeUpdateBasicGroupFullInfo = "updateBasicGroupFullInfo" TypeUpdateSupergroupFullInfo = "updateSupergroupFullInfo" + TypeUpdateCommunityFullInfo = "updateCommunityFullInfo" TypeUpdateServiceNotification = "updateServiceNotification" TypeUpdateNewOauthRequest = "updateNewOauthRequest" TypeUpdateFile = "updateFile" @@ -5059,7 +5089,7 @@ type Passkey struct { AdditionDate int32 `json:"addition_date"` // Point in time (Unix timestamp) when the passkey was used last time; 0 if never LastUsageDate int32 `json:"last_usage_date"` - // Identifier of the custom emoji that is used as the icon of the software, which created the passkey; 0 if unknown + // Identifier of the custom emoji that is used as the icon of the software that created the passkey; 0 if unknown SoftwareIconCustomEmojiId JsonInt64 `json:"software_icon_custom_emoji_id"` } @@ -6653,7 +6683,7 @@ type InputPollOption struct { meta // Option text; 1-100 characters. Only custom emoji entities are allowed to be added and only by Premium users Text *FormattedText `json:"text"` - // Option media; pass null if none; ignored in addPollOption. Must be one of the following types: inputPollMediaAnimation, inputPollMediaLink, inputPollMediaLocation, inputPollMediaPhoto, inputPollMediaSticker, inputPollMediaVenue, or inputPollMediaVideo without caption + // Option media; pass null if none. Must be one of the following types: inputPollMediaAnimation, inputPollMediaLink, inputPollMediaLocation, inputPollMediaPhoto, inputPollMediaSticker, inputPollMediaVenue, or inputPollMediaVideo without caption Media InputPollMedia `json:"media"` } @@ -9741,6 +9771,8 @@ type ChatAdministratorRights struct { CanManageDirectMessages bool `json:"can_manage_direct_messages"` // True, if the administrator can change tags of other users; applicable to basic groups and supergroups only CanManageTags bool `json:"can_manage_tags"` + // True, if the administrator can manage and send welcome messages + CanSendWelcomeMessages bool `json:"can_send_welcome_messages"` // True, if the administrator isn't shown in the chat member list and sends messages anonymously; applicable to supergroups only IsAnonymous bool `json:"is_anonymous"` } @@ -11199,7 +11231,7 @@ type PremiumGiveawayPaymentOption struct { Currency string `json:"currency"` // The amount to pay, in the smallest units of the currency Amount int64 `json:"amount"` - // Number of users which will be able to activate the gift codes + // Number of users who will be able to activate the gift codes WinnerCount int32 `json:"winner_count"` // Number of months the Telegram Premium subscription will be active MonthCount int32 `json:"month_count"` @@ -16343,6 +16375,29 @@ func (*ProfileAccentColor) GetType() string { return TypeProfileAccentColor } +// Contains identifier of a community +type CommunityId struct { + meta + // Community identifier + Id int64 `json:"id"` +} + +func (entity *CommunityId) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub CommunityId + + return json.Marshal((*stub)(entity)) +} + +func (*CommunityId) GetClass() string { + return ClassCommunityId +} + +func (*CommunityId) GetType() string { + return TypeCommunityId +} + // Describes actions that a user is allowed to take in a community type CommunityPermissions struct { meta @@ -16590,6 +16645,64 @@ func (community *Community) UnmarshalJSON(data []byte) error { return nil } +// Describes a chat in a community +type CommunityChat struct { + meta + // Identifier of the chat in the community + ChatId int64 `json:"chat_id"` + // True, if message history of the chat can be viewed + CanViewHistory bool `json:"can_view_history"` + // True, if the chat is hidden in the list of community chats; for community administrators only + IsHidden bool `json:"is_hidden"` +} + +func (entity *CommunityChat) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub CommunityChat + + return json.Marshal((*stub)(entity)) +} + +func (*CommunityChat) GetClass() string { + return ClassCommunityChat +} + +func (*CommunityChat) GetType() string { + return TypeCommunityChat +} + +// Contains full information about a community +type CommunityFullInfo struct { + meta + // Photo of the community + Photo *ChatPhoto `json:"photo"` + // Chats belonging to the community + Chats []*CommunityChat `json:"chats"` + // Number of privileged users in the community; 0 if the current user isn't an administrator of the community + AdministratorCount int32 `json:"administrator_count"` + // Number of users banned from the community; 0 if the current user isn't an administrator of the community + BannedCount int32 `json:"banned_count"` + // Number of pending requests for addition of chats to the community; 0 if the current user isn't an administrator of the community + AddChatRequestCount int32 `json:"add_chat_request_count"` +} + +func (entity *CommunityFullInfo) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub CommunityFullInfo + + return json.Marshal((*stub)(entity)) +} + +func (*CommunityFullInfo) GetClass() string { + return ClassCommunityFullInfo +} + +func (*CommunityFullInfo) GetType() string { + return TypeCommunityFullInfo +} + // Contains description of user rating type UserRating struct { meta @@ -17709,7 +17822,7 @@ func (*ChatMembersFilterMembers) ChatMembersFilterType() string { return TypeChatMembersFilterMembers } -// Returns users which can be mentioned in the chat +// Returns users who can be mentioned in the chat type ChatMembersFilterMention struct { meta // Identifier of the topic in which the users will be mentioned; pass null if none @@ -17852,7 +17965,7 @@ func (*SupergroupMembersFilterRecent) SupergroupMembersFilterType() string { return TypeSupergroupMembersFilterRecent } -// Returns contacts of the user, which are members of the supergroup or channel +// Returns contacts of the current user who are members of the supergroup or channel type SupergroupMembersFilterContacts struct { meta // Query to search for @@ -17985,7 +18098,7 @@ func (*SupergroupMembersFilterBanned) SupergroupMembersFilterType() string { return TypeSupergroupMembersFilterBanned } -// Returns users which can be mentioned in the supergroup +// Returns users who can be mentioned in the supergroup type SupergroupMembersFilterMention struct { meta // Query to search for @@ -19725,7 +19838,7 @@ func (*MessageOriginUser) MessageOriginType() string { return TypeMessageOriginUser } -// The message was originally sent by a user, which is hidden by their privacy settings +// The message was originally sent by a user who is hidden by their privacy settings type MessageOriginHiddenUser struct { meta // Name of the sender @@ -21000,6 +21113,60 @@ func (*FactCheck) GetType() string { return TypeFactCheck } +// Describes an ephemeral content of a regular message, which must be shown instead of the regular content +type EphemeralMessageContent struct { + meta + // True, if content of the message can be saved locally + CanBeSaved bool `json:"can_be_saved"` + // True, if media timestamp entities refers to a media in this message as opposed to a media in the replied message + HasTimestampedMedia bool `json:"has_timestamped_media"` + // Content of the message + Content MessageContent `json:"content"` + // Reply markup for the message; may be null if none + ReplyMarkup ReplyMarkup `json:"reply_markup"` +} + +func (entity *EphemeralMessageContent) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub EphemeralMessageContent + + return json.Marshal((*stub)(entity)) +} + +func (*EphemeralMessageContent) GetClass() string { + return ClassEphemeralMessageContent +} + +func (*EphemeralMessageContent) GetType() string { + return TypeEphemeralMessageContent +} + +func (ephemeralMessageContent *EphemeralMessageContent) UnmarshalJSON(data []byte) error { + var tmp struct { + CanBeSaved bool `json:"can_be_saved"` + HasTimestampedMedia bool `json:"has_timestamped_media"` + Content json.RawMessage `json:"content"` + ReplyMarkup json.RawMessage `json:"reply_markup"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + ephemeralMessageContent.CanBeSaved = tmp.CanBeSaved + ephemeralMessageContent.HasTimestampedMedia = tmp.HasTimestampedMedia + + fieldContent, _ := UnmarshalMessageContent(tmp.Content) + ephemeralMessageContent.Content = fieldContent + + fieldReplyMarkup, _ := UnmarshalReplyMarkup(tmp.ReplyMarkup) + ephemeralMessageContent.ReplyMarkup = fieldReplyMarkup + + return nil +} + // Describes a message type Message struct { meta @@ -21085,10 +21252,14 @@ type Message struct { SummaryLanguageCode string `json:"summary_language_code"` // Content of the message Content MessageContent `json:"content"` + // Content of the message, which is visible only to the current user and must be shown instead of the regular content; may be null if none + EphemeralContent *EphemeralMessageContent `json:"ephemeral_content"` // Reply markup for the message; may be null if none ReplyMarkup ReplyMarkup `json:"reply_markup"` // Unique identifier of the ephemeral message if the message is ephemeral; for bots only EphemeralMessageId int32 `json:"ephemeral_message_id"` + // Identifier that uniquely corresponds to the chat to which the message was sent; for bots only + ChatInstance JsonInt64 `json:"chat_instance"` } func (entity *Message) MarshalJSON() ([]byte, error) { @@ -21150,8 +21321,10 @@ func (message *Message) UnmarshalJSON(data []byte) error { RestrictionInfo *RestrictionInfo `json:"restriction_info"` SummaryLanguageCode string `json:"summary_language_code"` Content json.RawMessage `json:"content"` + EphemeralContent *EphemeralMessageContent `json:"ephemeral_content"` ReplyMarkup json.RawMessage `json:"reply_markup"` EphemeralMessageId int32 `json:"ephemeral_message_id"` + ChatInstance JsonInt64 `json:"chat_instance"` } err := json.Unmarshal(data, &tmp) @@ -21191,7 +21364,9 @@ func (message *Message) UnmarshalJSON(data []byte) error { message.EffectId = tmp.EffectId message.RestrictionInfo = tmp.RestrictionInfo message.SummaryLanguageCode = tmp.SummaryLanguageCode + message.EphemeralContent = tmp.EphemeralContent message.EphemeralMessageId = tmp.EphemeralMessageId + message.ChatInstance = tmp.ChatInstance fieldSenderId, _ := UnmarshalMessageSender(tmp.SenderId) message.SenderId = fieldSenderId @@ -22576,7 +22751,7 @@ func (*DraftMessageContentText) DraftMessageContentType() string { // A rich message draft; not supported in setChatDraftMessage type DraftMessageContentRichMessage struct { meta - // The rich message; the message must not have not yet uploaded media + // The rich message Message *RichMessage `json:"message"` } @@ -22600,6 +22775,33 @@ func (*DraftMessageContentRichMessage) DraftMessageContentType() string { return TypeDraftMessageContentRichMessage } +// A rich message draft; only for setChatDraftMessage +type DraftMessageContentInputRichMessage struct { + meta + // The rich message + Message *InputRichMessage `json:"message"` +} + +func (entity *DraftMessageContentInputRichMessage) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub DraftMessageContentInputRichMessage + + return json.Marshal((*stub)(entity)) +} + +func (*DraftMessageContentInputRichMessage) GetClass() string { + return ClassDraftMessageContent +} + +func (*DraftMessageContentInputRichMessage) GetType() string { + return TypeDraftMessageContentInputRichMessage +} + +func (*DraftMessageContentInputRichMessage) DraftMessageContentType() string { + return TypeDraftMessageContentInputRichMessage +} + // A video note message draft type DraftMessageContentVideoNote struct { meta @@ -23656,6 +23858,8 @@ type Chat struct { ViewAsTopics bool `json:"view_as_topics"` // True, if the chat has scheduled messages HasScheduledMessages bool `json:"has_scheduled_messages"` + // True, if the chat has welcome messages; for chat administrators with can_change_info administrator right only + HasWelcomeMessages bool `json:"has_welcome_messages"` // True, if the chat messages can be deleted only for the current user while other users will continue to see the messages CanBeDeletedOnlyForSelf bool `json:"can_be_deleted_only_for_self"` // True, if the chat messages can be deleted for all users @@ -23742,6 +23946,7 @@ func (chat *Chat) UnmarshalJSON(data []byte) error { IsMarkedAsUnread bool `json:"is_marked_as_unread"` ViewAsTopics bool `json:"view_as_topics"` HasScheduledMessages bool `json:"has_scheduled_messages"` + HasWelcomeMessages bool `json:"has_welcome_messages"` CanBeDeletedOnlyForSelf bool `json:"can_be_deleted_only_for_self"` CanBeDeletedForAllUsers bool `json:"can_be_deleted_for_all_users"` CanBeReported bool `json:"can_be_reported"` @@ -23788,6 +23993,7 @@ func (chat *Chat) UnmarshalJSON(data []byte) error { chat.IsMarkedAsUnread = tmp.IsMarkedAsUnread chat.ViewAsTopics = tmp.ViewAsTopics chat.HasScheduledMessages = tmp.HasScheduledMessages + chat.HasWelcomeMessages = tmp.HasWelcomeMessages chat.CanBeDeletedOnlyForSelf = tmp.CanBeDeletedOnlyForSelf chat.CanBeDeletedForAllUsers = tmp.CanBeDeletedForAllUsers chat.CanBeReported = tmp.CanBeReported @@ -24276,6 +24482,31 @@ func (*ButtonStyleSuccess) ButtonStyleType() string { return TypeButtonStyleSuccess } +// The button must be shown as a link. The style is allowed only for callback buttons in inlineButton +type ButtonStyleLink struct{ + meta +} + +func (entity *ButtonStyleLink) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ButtonStyleLink + + return json.Marshal((*stub)(entity)) +} + +func (*ButtonStyleLink) GetClass() string { + return ClassButtonStyle +} + +func (*ButtonStyleLink) GetType() string { + return TypeButtonStyleLink +} + +func (*ButtonStyleLink) ButtonStyleType() string { + return TypeButtonStyleLink +} + // A simple button, with text that must be sent when the button is pressed type KeyboardButtonTypeText struct{ meta @@ -24613,7 +24844,7 @@ func (*InlineKeyboardButtonTypeUrl) InlineKeyboardButtonTypeType() string { return TypeInlineKeyboardButtonTypeUrl } -// A button that opens a specified URL and automatically authorize the current user by calling getLoginUrlInfo +// A button that opens a specified URL and automatically authorize the current user by calling getLoginUrlInfo; not supported in ephemeral messages type InlineKeyboardButtonTypeLoginUrl struct { meta // An HTTP URL to pass to getLoginUrlInfo @@ -24877,6 +25108,31 @@ func (*InlineKeyboardButtonTypeCopyText) InlineKeyboardButtonTypeType() string { return TypeInlineKeyboardButtonTypeCopyText } +// A disabled button +type InlineKeyboardButtonTypeDisabled struct{ + meta +} + +func (entity *InlineKeyboardButtonTypeDisabled) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub InlineKeyboardButtonTypeDisabled + + return json.Marshal((*stub)(entity)) +} + +func (*InlineKeyboardButtonTypeDisabled) GetClass() string { + return ClassInlineKeyboardButtonType +} + +func (*InlineKeyboardButtonTypeDisabled) GetType() string { + return TypeInlineKeyboardButtonTypeDisabled +} + +func (*InlineKeyboardButtonTypeDisabled) InlineKeyboardButtonTypeType() string { + return TypeInlineKeyboardButtonTypeDisabled +} + // The button is from a bot's message type KeyboardButtonSourceMessage struct { meta @@ -25058,6 +25314,8 @@ type ReplyMarkupShowKeyboard struct { OneTime bool `json:"one_time"` // True, if the keyboard must automatically be shown to the current user. For outgoing messages, specify true to show the keyboard only for the mentioned users and for the target user of a reply IsPersonal bool `json:"is_personal"` + // True, if the keyboard must force reply to the message with the keyboard + ForceReply bool `json:"force_reply"` // If non-empty, the placeholder to be shown in the input field when the keyboard is active; 0-64 characters InputFieldPlaceholder string `json:"input_field_placeholder"` } @@ -25087,6 +25345,8 @@ type ReplyMarkupInlineKeyboard struct { meta // A list of rows of inline keyboard buttons Rows [][]*InlineKeyboardButton `json:"rows"` + // True, if a reply to the message must be forced when the message is received + ForceReply bool `json:"force_reply"` } func (entity *ReplyMarkupInlineKeyboard) MarshalJSON() ([]byte, error) { @@ -25902,6 +26162,57 @@ func (themeSettings *ThemeSettings) UnmarshalJSON(data []byte) error { return nil } +// Represents a button inside a rich message +type InlineButton struct { + meta + // Text of the button; only richTexts, richTextPlain, and richTextCustomEmoji are allowed + Text RichText `json:"text"` + // Style of the button + Style ButtonStyle `json:"style"` + // Type of the button; must be one of inlineKeyboardButtonTypeUrl, inlineKeyboardButtonTypeLoginUrl, inlineKeyboardButtonTypeWebApp, inlineKeyboardButtonTypeCallback, inlineKeyboardButtonTypeSwitchInline, inlineKeyboardButtonTypeUser, inlineKeyboardButtonTypeCopyText. Additionally, inlineKeyboardButtonTypeCallbackWithPassword and inlineKeyboardButtonTypeDisabled may be received in incoming messages. Regular users may use only inlineKeyboardButtonTypeUrl, inlineKeyboardButtonTypeUser and inlineKeyboardButtonTypeCopyText + Type InlineKeyboardButtonType `json:"type"` +} + +func (entity *InlineButton) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub InlineButton + + return json.Marshal((*stub)(entity)) +} + +func (*InlineButton) GetClass() string { + return ClassInlineButton +} + +func (*InlineButton) GetType() string { + return TypeInlineButton +} + +func (inlineButton *InlineButton) UnmarshalJSON(data []byte) error { + var tmp struct { + Text json.RawMessage `json:"text"` + Style json.RawMessage `json:"style"` + Type json.RawMessage `json:"type"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + fieldText, _ := UnmarshalRichText(tmp.Text) + inlineButton.Text = fieldText + + fieldStyle, _ := UnmarshalButtonStyle(tmp.Style) + inlineButton.Style = fieldStyle + + fieldType, _ := UnmarshalInlineKeyboardButtonType(tmp.Type) + inlineButton.Type = fieldType + + return nil +} + // A plain text type RichTextPlain struct { meta @@ -26893,6 +27204,33 @@ func (*RichTextMathematicalExpression) RichTextType() string { return TypeRichTextMathematicalExpression } +// A button +type RichTextButton struct { + meta + // The button + Button *InlineButton `json:"button"` +} + +func (entity *RichTextButton) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub RichTextButton + + return json.Marshal((*stub)(entity)) +} + +func (*RichTextButton) GetClass() string { + return ClassRichText +} + +func (*RichTextButton) GetType() string { + return TypeRichTextButton +} + +func (*RichTextButton) RichTextType() string { + return TypeRichTextButton +} + // A rich text replacing another rich text; not supported in inputRichMessage type RichTextDiff struct { meta @@ -28215,6 +28553,55 @@ func (pageBlockBlockQuote *PageBlockBlockQuote) UnmarshalJSON(data []byte) error return nil } +// An expandable block quote +type PageBlockExpandableBlockQuote struct { + meta + // Text of the quote + Text RichText `json:"text"` + // Quote credit; may be null if none + Credit RichText `json:"credit"` +} + +func (entity *PageBlockExpandableBlockQuote) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub PageBlockExpandableBlockQuote + + return json.Marshal((*stub)(entity)) +} + +func (*PageBlockExpandableBlockQuote) GetClass() string { + return ClassPageBlock +} + +func (*PageBlockExpandableBlockQuote) GetType() string { + return TypePageBlockExpandableBlockQuote +} + +func (*PageBlockExpandableBlockQuote) PageBlockType() string { + return TypePageBlockExpandableBlockQuote +} + +func (pageBlockExpandableBlockQuote *PageBlockExpandableBlockQuote) UnmarshalJSON(data []byte) error { + var tmp struct { + Text json.RawMessage `json:"text"` + Credit json.RawMessage `json:"credit"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + fieldText, _ := UnmarshalRichText(tmp.Text) + pageBlockExpandableBlockQuote.Text = fieldText + + fieldCredit, _ := UnmarshalRichText(tmp.Credit) + pageBlockExpandableBlockQuote.Credit = fieldCredit + + return nil +} + // A pull quote type PageBlockPullQuote struct { meta @@ -28300,7 +28687,7 @@ func (*PageBlockAnimation) PageBlockType() string { // An audio file type PageBlockAudio struct { meta - // Audio file; may be null + // Audio file Audio *Audio `json:"audio"` // Audio file caption; may be null if none Caption *PageBlockCaption `json:"caption"` @@ -28326,6 +28713,35 @@ func (*PageBlockAudio) PageBlockType() string { return TypePageBlockAudio } +// A general file +type PageBlockDocument struct { + meta + // The file + Document *Document `json:"document"` + // File caption; may be null if none + Caption *PageBlockCaption `json:"caption"` +} + +func (entity *PageBlockDocument) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub PageBlockDocument + + return json.Marshal((*stub)(entity)) +} + +func (*PageBlockDocument) GetClass() string { + return ClassPageBlock +} + +func (*PageBlockDocument) GetType() string { + return TypePageBlockDocument +} + +func (*PageBlockDocument) PageBlockType() string { + return TypePageBlockDocument +} + // A photo type PageBlockPhoto struct { meta @@ -28397,7 +28813,7 @@ func (*PageBlockVideo) PageBlockType() string { // A voice note type PageBlockVoiceNote struct { meta - // Voice note; may be null + // Voice note VoiceNote *VoiceNote `json:"voice_note"` // Voice note caption; may be null if none Caption *PageBlockCaption `json:"caption"` @@ -28711,6 +29127,8 @@ type PageBlockTable struct { IsBordered bool `json:"is_bordered"` // True, if the table is striped IsStriped bool `json:"is_striped"` + // True, if table cells must have smaller indents + IsCompact bool `json:"is_compact"` } func (entity *PageBlockTable) MarshalJSON() ([]byte, error) { @@ -28739,6 +29157,7 @@ func (pageBlockTable *PageBlockTable) UnmarshalJSON(data []byte) error { Cells [][]*PageBlockTableCell `json:"cells"` IsBordered bool `json:"is_bordered"` IsStriped bool `json:"is_striped"` + IsCompact bool `json:"is_compact"` } err := json.Unmarshal(data, &tmp) @@ -28749,6 +29168,7 @@ func (pageBlockTable *PageBlockTable) UnmarshalJSON(data []byte) error { pageBlockTable.Cells = tmp.Cells pageBlockTable.IsBordered = tmp.IsBordered pageBlockTable.IsStriped = tmp.IsStriped + pageBlockTable.IsCompact = tmp.IsCompact fieldCaption, _ := UnmarshalRichText(tmp.Caption) pageBlockTable.Caption = fieldCaption @@ -28893,6 +29313,79 @@ func (*PageBlockMap) PageBlockType() string { return TypePageBlockMap } +// A list of buttons shown in a row +type PageBlockButtonRow struct { + meta + // The buttons + Buttons []*InlineButton `json:"buttons"` + // Horizontal alignment of the buttons; may be null if the buttons must be shown full-width + Align PageBlockHorizontalAlignment `json:"align"` +} + +func (entity *PageBlockButtonRow) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub PageBlockButtonRow + + return json.Marshal((*stub)(entity)) +} + +func (*PageBlockButtonRow) GetClass() string { + return ClassPageBlock +} + +func (*PageBlockButtonRow) GetType() string { + return TypePageBlockButtonRow +} + +func (*PageBlockButtonRow) PageBlockType() string { + return TypePageBlockButtonRow +} + +func (pageBlockButtonRow *PageBlockButtonRow) UnmarshalJSON(data []byte) error { + var tmp struct { + Buttons []*InlineButton `json:"buttons"` + Align json.RawMessage `json:"align"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + pageBlockButtonRow.Buttons = tmp.Buttons + + fieldAlign, _ := UnmarshalPageBlockHorizontalAlignment(tmp.Align) + pageBlockButtonRow.Align = fieldAlign + + return nil +} + +// Represents a block unsupported by the current application version +type PageBlockUnsupported struct{ + meta +} + +func (entity *PageBlockUnsupported) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub PageBlockUnsupported + + return json.Marshal((*stub)(entity)) +} + +func (*PageBlockUnsupported) GetClass() string { + return ClassPageBlock +} + +func (*PageBlockUnsupported) GetType() string { + return TypePageBlockUnsupported +} + +func (*PageBlockUnsupported) PageBlockType() string { + return TypePageBlockUnsupported +} + // Describes an instant view page for a web page type WebPageInstantView struct { meta @@ -35535,6 +36028,33 @@ func (*MessageChatJoinByRequest) MessageContentType() string { return TypeMessageChatJoinByRequest } +// A new member joined the chat from a community +type MessageChatJoinFromCommunity struct { + meta + // Identifier of the community from which the user joined the chat + CommunityId int64 `json:"community_id"` +} + +func (entity *MessageChatJoinFromCommunity) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub MessageChatJoinFromCommunity + + return json.Marshal((*stub)(entity)) +} + +func (*MessageChatJoinFromCommunity) GetClass() string { + return ClassMessageContent +} + +func (*MessageChatJoinFromCommunity) GetType() string { + return TypeMessageChatJoinFromCommunity +} + +func (*MessageChatJoinFromCommunity) MessageContentType() string { + return TypeMessageChatJoinFromCommunity +} + // A chat member was deleted type MessageChatDeleteMember struct { meta @@ -36085,6 +36605,8 @@ type MessageManagedBotCreated struct { meta // User identifier of the created bot BotUserId int64 `json:"bot_user_id"` + // Identifier of the bot which will manage the new bot + ManagerBotUserId int64 `json:"manager_bot_user_id"` } func (entity *MessageManagedBotCreated) MarshalJSON() ([]byte, error) { @@ -36422,7 +36944,7 @@ type MessageGiveaway struct { meta // Giveaway parameters Parameters *GiveawayParameters `json:"parameters"` - // Number of users which will receive Telegram Premium subscription gift codes + // Number of users who will receive Telegram Premium subscription gift codes WinnerCount int32 `json:"winner_count"` // Prize of the giveaway Prize GiveawayPrize `json:"prize"` @@ -36634,7 +37156,7 @@ func (*MessageGiftedStars) MessageContentType() string { } // TON Grams were gifted to a user -type MessageGiftedTon struct { +type MessageGiftedGrams struct { meta // The identifier of a user who gifted Grams; 0 if the gift was anonymous or is outgoing GifterUserId int64 `json:"gifter_user_id"` @@ -36648,24 +37170,24 @@ type MessageGiftedTon struct { Sticker *Sticker `json:"sticker"` } -func (entity *MessageGiftedTon) MarshalJSON() ([]byte, error) { +func (entity *MessageGiftedGrams) MarshalJSON() ([]byte, error) { entity.meta.Type = entity.GetType() - type stub MessageGiftedTon + type stub MessageGiftedGrams return json.Marshal((*stub)(entity)) } -func (*MessageGiftedTon) GetClass() string { +func (*MessageGiftedGrams) GetClass() string { return ClassMessageContent } -func (*MessageGiftedTon) GetType() string { - return TypeMessageGiftedTon +func (*MessageGiftedGrams) GetType() string { + return TypeMessageGiftedGrams } -func (*MessageGiftedTon) MessageContentType() string { - return TypeMessageGiftedTon +func (*MessageGiftedGrams) MessageContentType() string { + return TypeMessageGiftedGrams } // Telegram Stars were received by the current user from a giveaway @@ -36836,6 +37358,10 @@ type MessageUpgradedGift struct { Origin UpgradedGiftOrigin `json:"origin"` // Unique identifier of the received gift for the current user; only for the receiver of the gift ReceivedGiftId string `json:"received_gift_id"` + // Message added to the gift + Text *FormattedText `json:"text"` + // True, if the sender and gift text are shown only to the gift receiver; otherwise, everyone will be able to see them + IsPrivate bool `json:"is_private"` // True, if the gift is displayed on the user's or the channel's profile page; only for the receiver of the gift IsSaved bool `json:"is_saved"` // True, if the gift can be transferred to another owner; only for the receiver of the gift @@ -36883,6 +37409,8 @@ func (messageUpgradedGift *MessageUpgradedGift) UnmarshalJSON(data []byte) error ReceiverId json.RawMessage `json:"receiver_id"` Origin json.RawMessage `json:"origin"` ReceivedGiftId string `json:"received_gift_id"` + Text *FormattedText `json:"text"` + IsPrivate bool `json:"is_private"` IsSaved bool `json:"is_saved"` CanBeTransferred bool `json:"can_be_transferred"` WasTransferred bool `json:"was_transferred"` @@ -36901,6 +37429,8 @@ func (messageUpgradedGift *MessageUpgradedGift) UnmarshalJSON(data []byte) error messageUpgradedGift.Gift = tmp.Gift messageUpgradedGift.ReceivedGiftId = tmp.ReceivedGiftId + messageUpgradedGift.Text = tmp.Text + messageUpgradedGift.IsPrivate = tmp.IsPrivate messageUpgradedGift.IsSaved = tmp.IsSaved messageUpgradedGift.CanBeTransferred = tmp.CanBeTransferred messageUpgradedGift.WasTransferred = tmp.WasTransferred @@ -37475,7 +38005,7 @@ func (*MessageContactRegistered) MessageContentType() string { return TypeMessageContactRegistered } -// The current user shared users, which were requested by the bot +// The current user shared users who were requested by the bot type MessageUsersShared struct { meta // The shared users @@ -40148,6 +40678,55 @@ func (inputPageBlockBlockQuote *InputPageBlockBlockQuote) UnmarshalJSON(data []b return nil } +// An expandable block quote +type InputPageBlockExpandableBlockQuote struct { + meta + // Quote text + Text RichText `json:"text"` + // Quote credit; pass null if none + Credit RichText `json:"credit"` +} + +func (entity *InputPageBlockExpandableBlockQuote) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub InputPageBlockExpandableBlockQuote + + return json.Marshal((*stub)(entity)) +} + +func (*InputPageBlockExpandableBlockQuote) GetClass() string { + return ClassInputPageBlock +} + +func (*InputPageBlockExpandableBlockQuote) GetType() string { + return TypeInputPageBlockExpandableBlockQuote +} + +func (*InputPageBlockExpandableBlockQuote) InputPageBlockType() string { + return TypeInputPageBlockExpandableBlockQuote +} + +func (inputPageBlockExpandableBlockQuote *InputPageBlockExpandableBlockQuote) UnmarshalJSON(data []byte) error { + var tmp struct { + Text json.RawMessage `json:"text"` + Credit json.RawMessage `json:"credit"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + fieldText, _ := UnmarshalRichText(tmp.Text) + inputPageBlockExpandableBlockQuote.Text = fieldText + + fieldCredit, _ := UnmarshalRichText(tmp.Credit) + inputPageBlockExpandableBlockQuote.Credit = fieldCredit + + return nil +} + // A pull quote type InputPageBlockPullQuote struct { meta @@ -40257,6 +40836,35 @@ func (*InputPageBlockAudio) InputPageBlockType() string { return TypeInputPageBlockAudio } +// A general file +type InputPageBlockDocument struct { + meta + // The file to be sent + Document *InputDocument `json:"document"` + // File caption; pass null if none + Caption *PageBlockCaption `json:"caption"` +} + +func (entity *InputPageBlockDocument) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub InputPageBlockDocument + + return json.Marshal((*stub)(entity)) +} + +func (*InputPageBlockDocument) GetClass() string { + return ClassInputPageBlock +} + +func (*InputPageBlockDocument) GetType() string { + return TypeInputPageBlockDocument +} + +func (*InputPageBlockDocument) InputPageBlockType() string { + return TypeInputPageBlockDocument +} + // A photo type InputPageBlockPhoto struct { meta @@ -40451,10 +41059,12 @@ type InputPageBlockTable struct { Caption RichText `json:"caption"` // Table cells Cells [][]*PageBlockTableCell `json:"cells"` - // True, if the table is bordered + // Pass true if the table is bordered IsBordered bool `json:"is_bordered"` - // True, if the table is striped + // Pass true if the table is striped IsStriped bool `json:"is_striped"` + // Pass true if table cells must have smaller indents + IsCompact bool `json:"is_compact"` } func (entity *InputPageBlockTable) MarshalJSON() ([]byte, error) { @@ -40483,6 +41093,7 @@ func (inputPageBlockTable *InputPageBlockTable) UnmarshalJSON(data []byte) error Cells [][]*PageBlockTableCell `json:"cells"` IsBordered bool `json:"is_bordered"` IsStriped bool `json:"is_striped"` + IsCompact bool `json:"is_compact"` } err := json.Unmarshal(data, &tmp) @@ -40493,6 +41104,7 @@ func (inputPageBlockTable *InputPageBlockTable) UnmarshalJSON(data []byte) error inputPageBlockTable.Cells = tmp.Cells inputPageBlockTable.IsBordered = tmp.IsBordered inputPageBlockTable.IsStriped = tmp.IsStriped + inputPageBlockTable.IsCompact = tmp.IsCompact fieldCaption, _ := UnmarshalRichText(tmp.Caption) inputPageBlockTable.Caption = fieldCaption @@ -40589,6 +41201,54 @@ func (*InputPageBlockMap) InputPageBlockType() string { return TypeInputPageBlockMap } +// A list of buttons shown in a row +type InputPageBlockButtonRow struct { + meta + // The buttons + Buttons []*InlineButton `json:"buttons"` + // Horizontal alignment of the buttons; pass null if the buttons must be shown full-width + Align PageBlockHorizontalAlignment `json:"align"` +} + +func (entity *InputPageBlockButtonRow) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub InputPageBlockButtonRow + + return json.Marshal((*stub)(entity)) +} + +func (*InputPageBlockButtonRow) GetClass() string { + return ClassInputPageBlock +} + +func (*InputPageBlockButtonRow) GetType() string { + return TypeInputPageBlockButtonRow +} + +func (*InputPageBlockButtonRow) InputPageBlockType() string { + return TypeInputPageBlockButtonRow +} + +func (inputPageBlockButtonRow *InputPageBlockButtonRow) UnmarshalJSON(data []byte) error { + var tmp struct { + Buttons []*InlineButton `json:"buttons"` + Align json.RawMessage `json:"align"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + inputPageBlockButtonRow.Buttons = tmp.Buttons + + fieldAlign, _ := UnmarshalPageBlockHorizontalAlignment(tmp.Align) + inputPageBlockButtonRow.Align = fieldAlign + + return nil +} + // A text message type InputMessageText struct { meta @@ -42145,6 +42805,33 @@ func (*SearchMessagesChatTypeFilterChannel) SearchMessagesChatTypeFilterType() s return TypeSearchMessagesChatTypeFilterChannel } +// Returns only messages in the specified community +type SearchMessagesChatTypeFilterCommunity struct { + meta + // Identifier of the community to search in + CommunityId int64 `json:"community_id"` +} + +func (entity *SearchMessagesChatTypeFilterCommunity) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub SearchMessagesChatTypeFilterCommunity + + return json.Marshal((*stub)(entity)) +} + +func (*SearchMessagesChatTypeFilterCommunity) GetClass() string { + return ClassSearchMessagesChatTypeFilter +} + +func (*SearchMessagesChatTypeFilterCommunity) GetType() string { + return TypeSearchMessagesChatTypeFilterCommunity +} + +func (*SearchMessagesChatTypeFilterCommunity) SearchMessagesChatTypeFilterType() string { + return TypeSearchMessagesChatTypeFilterCommunity +} + // Returns only private chats with bots type SearchChatTypeFilterBot struct{ meta @@ -45171,6 +45858,50 @@ func (*QuickReplyShortcut) GetType() string { return TypeQuickReplyShortcut } +// Describes a set up welcome message +type WelcomeMessage struct { + meta + // Welcome message identifier; unique for the chat to which the welcome message belongs + Id int32 `json:"id"` + // Content of the welcome message + Content MessageContent `json:"content"` +} + +func (entity *WelcomeMessage) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub WelcomeMessage + + return json.Marshal((*stub)(entity)) +} + +func (*WelcomeMessage) GetClass() string { + return ClassWelcomeMessage +} + +func (*WelcomeMessage) GetType() string { + return TypeWelcomeMessage +} + +func (welcomeMessage *WelcomeMessage) UnmarshalJSON(data []byte) error { + var tmp struct { + Id int32 `json:"id"` + Content json.RawMessage `json:"content"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + welcomeMessage.Id = tmp.Id + + fieldContent, _ := UnmarshalMessageContent(tmp.Content) + welcomeMessage.Content = fieldContent + + return nil +} + // Contains a public forward as a message type PublicForwardMessage struct { meta @@ -45553,7 +46284,7 @@ type PrepaidGiveaway struct { meta // Unique identifier of the prepaid giveaway Id JsonInt64 `json:"id"` - // Number of users which will receive giveaway prize + // Number of users who will receive giveaway prize WinnerCount int32 `json:"winner_count"` // Prize of the giveaway Prize GiveawayPrize `json:"prize"` @@ -54628,7 +55359,7 @@ type StorePaymentPurposePremiumGift struct { Currency string `json:"currency"` // Paid amount, in the smallest units of the currency Amount int64 `json:"amount"` - // Identifiers of the user which will receive Telegram Premium + // Identifier of the user who will receive Telegram Premium UserId int64 `json:"user_id"` // Text to show along with the gift codes; 0-getOption("gift_text_length_max") characters. Only Bold, Italic, Underline, Strikethrough, Spoiler, CustomEmoji, and DateTime entities are allowed Text *FormattedText `json:"text"` @@ -54663,7 +55394,7 @@ type StorePaymentPurposePremiumGiftCodes struct { Currency string `json:"currency"` // Paid amount, in the smallest units of the currency Amount int64 `json:"amount"` - // Identifiers of the users which can activate the gift codes + // Identifiers of the users who can activate the gift codes UserIds []int64 `json:"user_ids"` // Text to show along with the gift codes; 0-getOption("gift_text_length_max") characters. Only Bold, Italic, Underline, Strikethrough, Spoiler, CustomEmoji, and DateTime entities are allowed Text *FormattedText `json:"text"` @@ -54886,7 +55617,7 @@ type TelegramPaymentPurposePremiumGift struct { Currency string `json:"currency"` // Paid amount, in the smallest units of the currency Amount int64 `json:"amount"` - // Identifier of the user which will receive Telegram Premium + // Identifier of the user who will receive Telegram Premium UserId int64 `json:"user_id"` // Number of months the Telegram Premium subscription will be active for the user MonthCount int32 `json:"month_count"` @@ -54923,7 +55654,7 @@ type TelegramPaymentPurposePremiumGiftCodes struct { Currency string `json:"currency"` // Paid amount, in the smallest units of the currency Amount int64 `json:"amount"` - // Identifiers of the users which can activate the gift codes + // Identifiers of the users who can activate the gift codes UserIds []int64 `json:"user_ids"` // Number of months the Telegram Premium subscription will be active for the users MonthCount int32 `json:"month_count"` @@ -54960,7 +55691,7 @@ type TelegramPaymentPurposePremiumGiveaway struct { Currency string `json:"currency"` // Paid amount, in the smallest units of the currency Amount int64 `json:"amount"` - // Number of users which will be able to activate the gift codes + // Number of users who will be able to activate the gift codes WinnerCount int32 `json:"winner_count"` // Number of months the Telegram Premium subscription will be active for the users MonthCount int32 `json:"month_count"` @@ -57225,7 +57956,7 @@ func (*PushMessageContentPremiumGiftCode) PushMessageContentType() string { // A message with a giveaway type PushMessageContentGiveaway struct { meta - // Number of users which will receive giveaway prizes; 0 for pinned message + // Number of users who will receive giveaway prizes; 0 for pinned message WinnerCount int32 `json:"winner_count"` // Prize of the giveaway; may be null for pinned message Prize GiveawayPrize `json:"prize"` @@ -68191,6 +68922,37 @@ func (updateMessageContent *UpdateMessageContent) UnmarshalJSON(data []byte) err return nil } +// The message ephemeral content has changed +type UpdateMessageEphemeralContent struct { + meta + // Chat identifier + ChatId int64 `json:"chat_id"` + // Message identifier + MessageId int64 `json:"message_id"` + // New ephemeral content of the message; may be null if none + EphemeralContent *EphemeralMessageContent `json:"ephemeral_content"` +} + +func (entity *UpdateMessageEphemeralContent) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub UpdateMessageEphemeralContent + + return json.Marshal((*stub)(entity)) +} + +func (*UpdateMessageEphemeralContent) GetClass() string { + return ClassUpdate +} + +func (*UpdateMessageEphemeralContent) GetType() string { + return TypeUpdateMessageEphemeralContent +} + +func (*UpdateMessageEphemeralContent) UpdateType() string { + return TypeUpdateMessageEphemeralContent +} + // A message was edited. Changes in the message content will come in a separate updateMessageContent type UpdateMessageEdited struct { meta @@ -69686,6 +70448,35 @@ func (*UpdateChatHasScheduledMessages) UpdateType() string { return TypeUpdateChatHasScheduledMessages } +// A chat's has_welcome_messages field has changed +type UpdateChatHasWelcomeMessages struct { + meta + // Chat identifier + ChatId int64 `json:"chat_id"` + // New value of has_welcome_messages + HasWelcomeMessages bool `json:"has_welcome_messages"` +} + +func (entity *UpdateChatHasWelcomeMessages) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub UpdateChatHasWelcomeMessages + + return json.Marshal((*stub)(entity)) +} + +func (*UpdateChatHasWelcomeMessages) GetClass() string { + return ClassUpdate +} + +func (*UpdateChatHasWelcomeMessages) GetType() string { + return TypeUpdateChatHasWelcomeMessages +} + +func (*UpdateChatHasWelcomeMessages) UpdateType() string { + return TypeUpdateChatHasWelcomeMessages +} + // The list of chat folders or a chat folder has changed type UpdateChatFolders struct { meta @@ -69989,6 +70780,35 @@ func (*UpdateQuickReplyShortcutMessages) UpdateType() string { return TypeUpdateQuickReplyShortcutMessages } +// The list of welcome messages of a chat has changed +type UpdateChatWelcomeMessages struct { + meta + // The identifier of the chat + ChatId int64 `json:"chat_id"` + // The new list of welcome messages of the chat in the order from the first to the last sent + Messages []*WelcomeMessage `json:"messages"` +} + +func (entity *UpdateChatWelcomeMessages) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub UpdateChatWelcomeMessages + + return json.Marshal((*stub)(entity)) +} + +func (*UpdateChatWelcomeMessages) GetClass() string { + return ClassUpdate +} + +func (*UpdateChatWelcomeMessages) GetType() string { + return TypeUpdateChatWelcomeMessages +} + +func (*UpdateChatWelcomeMessages) UpdateType() string { + return TypeUpdateChatWelcomeMessages +} + // Basic information about a topic in a forum chat was changed type UpdateForumTopicInfo struct { meta @@ -70386,7 +71206,7 @@ func (updateChatAction *UpdateChatAction) UnmarshalJSON(data []byte) error { return nil } -// A new pending text or rich message was received in a chat with a bot. The message must be shown in the chat for at most getOption("pending_text_message_period") seconds, replace any other pending message with the same draft_id, and be deleted whenever any incoming message from the bot in the message thread is received +// A new pending text or rich message was received in a chat with a bot. The message must be shown in the chat for at most getOption("pending_text_message_period") seconds, replace any other pending message with the same draft_id with animation, and be deleted whenever any incoming message or a pending message with another draft_id is received in the message thread type UpdatePendingMessage struct { meta // Chat identifier @@ -70395,6 +71215,10 @@ type UpdatePendingMessage struct { ForumTopicId int32 `json:"forum_topic_id"` // Unique identifier of the message draft within the message thread DraftId JsonInt64 `json:"draft_id"` + // True, if a button that calls stopPendingMessage to stop further message generation must be shown + CanStop bool `json:"can_stop"` + // True, if the pending message must not be automatically deleted when the user presses the Stop button + KeepOnStop bool `json:"keep_on_stop"` // Content of the message; always of the type messageText or messageRichMessage Content MessageContent `json:"content"` } @@ -70424,6 +71248,8 @@ func (updatePendingMessage *UpdatePendingMessage) UnmarshalJSON(data []byte) err ChatId int64 `json:"chat_id"` ForumTopicId int32 `json:"forum_topic_id"` DraftId JsonInt64 `json:"draft_id"` + CanStop bool `json:"can_stop"` + KeepOnStop bool `json:"keep_on_stop"` Content json.RawMessage `json:"content"` } @@ -70435,6 +71261,8 @@ func (updatePendingMessage *UpdatePendingMessage) UnmarshalJSON(data []byte) err updatePendingMessage.ChatId = tmp.ChatId updatePendingMessage.ForumTopicId = tmp.ForumTopicId updatePendingMessage.DraftId = tmp.DraftId + updatePendingMessage.CanStop = tmp.CanStop + updatePendingMessage.KeepOnStop = tmp.KeepOnStop fieldContent, _ := UnmarshalMessageContent(tmp.Content) updatePendingMessage.Content = fieldContent @@ -70442,6 +71270,37 @@ func (updatePendingMessage *UpdatePendingMessage) UnmarshalJSON(data []byte) err return nil } +// A message draft generation was stopped by the user +type UpdateStopMessageDraft struct { + meta + // Chat identifier + ChatId int64 `json:"chat_id"` + // The forum topic identifier of the message draft + ForumTopicId int32 `json:"forum_topic_id"` + // Identifier of the message draft within the message thread + DraftId JsonInt64 `json:"draft_id"` +} + +func (entity *UpdateStopMessageDraft) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub UpdateStopMessageDraft + + return json.Marshal((*stub)(entity)) +} + +func (*UpdateStopMessageDraft) GetClass() string { + return ClassUpdate +} + +func (*UpdateStopMessageDraft) GetType() string { + return TypeUpdateStopMessageDraft +} + +func (*UpdateStopMessageDraft) UpdateType() string { + return TypeUpdateStopMessageDraft +} + // Some data of a community has changed. This update is guaranteed to come before the community identifier is returned to the application type UpdateCommunity struct { meta @@ -70712,6 +71571,35 @@ func (*UpdateSupergroupFullInfo) UpdateType() string { return TypeUpdateSupergroupFullInfo } +// Some data in communityFullInfo has been changed +type UpdateCommunityFullInfo struct { + meta + // Identifier of the community + CommunityId int64 `json:"community_id"` + // New full information about the community + CommunityFullInfo *CommunityFullInfo `json:"community_full_info"` +} + +func (entity *UpdateCommunityFullInfo) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub UpdateCommunityFullInfo + + return json.Marshal((*stub)(entity)) +} + +func (*UpdateCommunityFullInfo) GetClass() string { + return ClassUpdate +} + +func (*UpdateCommunityFullInfo) GetType() string { + return TypeUpdateCommunityFullInfo +} + +func (*UpdateCommunityFullInfo) UpdateType() string { + return TypeUpdateCommunityFullInfo +} + // A service notification from the server was received. Upon receiving this the application must show a popup with the content of the notification type UpdateServiceNotification struct { meta @@ -70827,7 +71715,7 @@ type UpdateFileGenerationStart struct { OriginalPath string `json:"original_path"` // The path to a file that must be created and where the new file must be generated by the application. If the application has no access to the path, it can use writeGeneratedFilePart to generate the file DestinationPath string `json:"destination_path"` - // If the conversion is "#url#" than original_path contains an HTTP/HTTPS URL of a file that must be downloaded by the application. Otherwise, this is the conversion specified by the application in inputFileGenerated + // If the conversion is "#url#", then original_path contains an HTTP/HTTPS URL of a file that must be downloaded by the application. Otherwise, this is the conversion specified by the application in inputFileGenerated Conversion string `json:"conversion"` } diff --git a/client/unmarshaler.go b/client/unmarshaler.go index aa02f39..868d1cb 100755 --- a/client/unmarshaler.go +++ b/client/unmarshaler.go @@ -2835,6 +2835,9 @@ func UnmarshalDraftMessageContent(data json.RawMessage) (DraftMessageContent, er case TypeDraftMessageContentRichMessage: return UnmarshalDraftMessageContentRichMessage(data) + case TypeDraftMessageContentInputRichMessage: + return UnmarshalDraftMessageContentInputRichMessage(data) + case TypeDraftMessageContentVideoNote: return UnmarshalDraftMessageContentVideoNote(data) @@ -3106,6 +3109,9 @@ func UnmarshalButtonStyle(data json.RawMessage) (ButtonStyle, error) { case TypeButtonStyleSuccess: return UnmarshalButtonStyleSuccess(data) + case TypeButtonStyleLink: + return UnmarshalButtonStyleLink(data) + default: return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) } @@ -3216,6 +3222,9 @@ func UnmarshalInlineKeyboardButtonType(data json.RawMessage) (InlineKeyboardButt case TypeInlineKeyboardButtonTypeCopyText: return UnmarshalInlineKeyboardButtonTypeCopyText(data) + case TypeInlineKeyboardButtonTypeDisabled: + return UnmarshalInlineKeyboardButtonTypeDisabled(data) + default: return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) } @@ -3501,6 +3510,9 @@ func UnmarshalRichText(data json.RawMessage) (RichText, error) { case TypeRichTextMathematicalExpression: return UnmarshalRichTextMathematicalExpression(data) + case TypeRichTextButton: + return UnmarshalRichTextButton(data) + case TypeRichTextDiff: return UnmarshalRichTextDiff(data) @@ -3669,6 +3681,9 @@ func UnmarshalPageBlock(data json.RawMessage) (PageBlock, error) { case TypePageBlockBlockQuote: return UnmarshalPageBlockBlockQuote(data) + case TypePageBlockExpandableBlockQuote: + return UnmarshalPageBlockExpandableBlockQuote(data) + case TypePageBlockPullQuote: return UnmarshalPageBlockPullQuote(data) @@ -3678,6 +3693,9 @@ func UnmarshalPageBlock(data json.RawMessage) (PageBlock, error) { case TypePageBlockAudio: return UnmarshalPageBlockAudio(data) + case TypePageBlockDocument: + return UnmarshalPageBlockDocument(data) + case TypePageBlockPhoto: return UnmarshalPageBlockPhoto(data) @@ -3717,6 +3735,12 @@ func UnmarshalPageBlock(data json.RawMessage) (PageBlock, error) { case TypePageBlockMap: return UnmarshalPageBlockMap(data) + case TypePageBlockButtonRow: + return UnmarshalPageBlockButtonRow(data) + + case TypePageBlockUnsupported: + return UnmarshalPageBlockUnsupported(data) + default: return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) } @@ -4693,6 +4717,9 @@ func UnmarshalMessageContent(data json.RawMessage) (MessageContent, error) { case TypeMessageChatJoinByRequest: return UnmarshalMessageChatJoinByRequest(data) + case TypeMessageChatJoinFromCommunity: + return UnmarshalMessageChatJoinFromCommunity(data) + case TypeMessageChatDeleteMember: return UnmarshalMessageChatDeleteMember(data) @@ -4783,8 +4810,8 @@ func UnmarshalMessageContent(data json.RawMessage) (MessageContent, error) { case TypeMessageGiftedStars: return UnmarshalMessageGiftedStars(data) - case TypeMessageGiftedTon: - return UnmarshalMessageGiftedTon(data) + case TypeMessageGiftedGrams: + return UnmarshalMessageGiftedGrams(data) case TypeMessageGiveawayPrizeStars: return UnmarshalMessageGiveawayPrizeStars(data) @@ -5287,6 +5314,9 @@ func UnmarshalInputPageBlock(data json.RawMessage) (InputPageBlock, error) { case TypeInputPageBlockBlockQuote: return UnmarshalInputPageBlockBlockQuote(data) + case TypeInputPageBlockExpandableBlockQuote: + return UnmarshalInputPageBlockExpandableBlockQuote(data) + case TypeInputPageBlockPullQuote: return UnmarshalInputPageBlockPullQuote(data) @@ -5296,6 +5326,9 @@ func UnmarshalInputPageBlock(data json.RawMessage) (InputPageBlock, error) { case TypeInputPageBlockAudio: return UnmarshalInputPageBlockAudio(data) + case TypeInputPageBlockDocument: + return UnmarshalInputPageBlockDocument(data) + case TypeInputPageBlockPhoto: return UnmarshalInputPageBlockPhoto(data) @@ -5320,6 +5353,9 @@ func UnmarshalInputPageBlock(data json.RawMessage) (InputPageBlock, error) { case TypeInputPageBlockMap: return UnmarshalInputPageBlockMap(data) + case TypeInputPageBlockButtonRow: + return UnmarshalInputPageBlockButtonRow(data) + default: return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) } @@ -5539,6 +5575,9 @@ func UnmarshalSearchMessagesChatTypeFilter(data json.RawMessage) (SearchMessages case TypeSearchMessagesChatTypeFilterChannel: return UnmarshalSearchMessagesChatTypeFilterChannel(data) + case TypeSearchMessagesChatTypeFilterCommunity: + return UnmarshalSearchMessagesChatTypeFilterCommunity(data) + default: return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) } @@ -10224,6 +10263,9 @@ func UnmarshalUpdate(data json.RawMessage) (Update, error) { case TypeUpdateMessageContent: return UnmarshalUpdateMessageContent(data) + case TypeUpdateMessageEphemeralContent: + return UnmarshalUpdateMessageEphemeralContent(data) + case TypeUpdateMessageEdited: return UnmarshalUpdateMessageEdited(data) @@ -10359,6 +10401,9 @@ func UnmarshalUpdate(data json.RawMessage) (Update, error) { case TypeUpdateChatHasScheduledMessages: return UnmarshalUpdateChatHasScheduledMessages(data) + case TypeUpdateChatHasWelcomeMessages: + return UnmarshalUpdateChatHasWelcomeMessages(data) + case TypeUpdateChatFolders: return UnmarshalUpdateChatFolders(data) @@ -10389,6 +10434,9 @@ func UnmarshalUpdate(data json.RawMessage) (Update, error) { case TypeUpdateQuickReplyShortcutMessages: return UnmarshalUpdateQuickReplyShortcutMessages(data) + case TypeUpdateChatWelcomeMessages: + return UnmarshalUpdateChatWelcomeMessages(data) + case TypeUpdateForumTopicInfo: return UnmarshalUpdateForumTopicInfo(data) @@ -10422,6 +10470,9 @@ func UnmarshalUpdate(data json.RawMessage) (Update, error) { case TypeUpdatePendingMessage: return UnmarshalUpdatePendingMessage(data) + case TypeUpdateStopMessageDraft: + return UnmarshalUpdateStopMessageDraft(data) + case TypeUpdateCommunity: return UnmarshalUpdateCommunity(data) @@ -10449,6 +10500,9 @@ func UnmarshalUpdate(data json.RawMessage) (Update, error) { case TypeUpdateSupergroupFullInfo: return UnmarshalUpdateSupergroupFullInfo(data) + case TypeUpdateCommunityFullInfo: + return UnmarshalUpdateCommunityFullInfo(data) + case TypeUpdateServiceNotification: return UnmarshalUpdateServiceNotification(data) @@ -13854,6 +13908,14 @@ func UnmarshalProfileAccentColor(data json.RawMessage) (*ProfileAccentColor, err return &resp, err } +func UnmarshalCommunityId(data json.RawMessage) (*CommunityId, error) { + var resp CommunityId + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalCommunityPermissions(data json.RawMessage) (*CommunityPermissions, error) { var resp CommunityPermissions @@ -13918,6 +13980,22 @@ func UnmarshalCommunity(data json.RawMessage) (*Community, error) { return &resp, err } +func UnmarshalCommunityChat(data json.RawMessage) (*CommunityChat, error) { + var resp CommunityChat + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalCommunityFullInfo(data json.RawMessage) (*CommunityFullInfo, error) { + var resp CommunityFullInfo + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalUserRating(data json.RawMessage) (*UserRating, error) { var resp UserRating @@ -14878,6 +14956,14 @@ func UnmarshalFactCheck(data json.RawMessage) (*FactCheck, error) { return &resp, err } +func UnmarshalEphemeralMessageContent(data json.RawMessage) (*EphemeralMessageContent, error) { + var resp EphemeralMessageContent + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalMessage(data json.RawMessage) (*Message, error) { var resp Message @@ -15270,6 +15356,14 @@ func UnmarshalDraftMessageContentRichMessage(data json.RawMessage) (*DraftMessag return &resp, err } +func UnmarshalDraftMessageContentInputRichMessage(data json.RawMessage) (*DraftMessageContentInputRichMessage, error) { + var resp DraftMessageContentInputRichMessage + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalDraftMessageContentVideoNote(data json.RawMessage) (*DraftMessageContentVideoNote, error) { var resp DraftMessageContentVideoNote @@ -15654,6 +15748,14 @@ func UnmarshalButtonStyleSuccess(data json.RawMessage) (*ButtonStyleSuccess, err return &resp, err } +func UnmarshalButtonStyleLink(data json.RawMessage) (*ButtonStyleLink, error) { + var resp ButtonStyleLink + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalKeyboardButtonTypeText(data json.RawMessage) (*KeyboardButtonTypeText, error) { var resp KeyboardButtonTypeText @@ -15806,6 +15908,14 @@ func UnmarshalInlineKeyboardButtonTypeCopyText(data json.RawMessage) (*InlineKey return &resp, err } +func UnmarshalInlineKeyboardButtonTypeDisabled(data json.RawMessage) (*InlineKeyboardButtonTypeDisabled, error) { + var resp InlineKeyboardButtonTypeDisabled + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalKeyboardButtonSourceMessage(data json.RawMessage) (*KeyboardButtonSourceMessage, error) { var resp KeyboardButtonSourceMessage @@ -16030,6 +16140,14 @@ func UnmarshalThemeSettings(data json.RawMessage) (*ThemeSettings, error) { return &resp, err } +func UnmarshalInlineButton(data json.RawMessage) (*InlineButton, error) { + var resp InlineButton + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalRichTextPlain(data json.RawMessage) (*RichTextPlain, error) { var resp RichTextPlain @@ -16214,6 +16332,14 @@ func UnmarshalRichTextMathematicalExpression(data json.RawMessage) (*RichTextMat return &resp, err } +func UnmarshalRichTextButton(data json.RawMessage) (*RichTextButton, error) { + var resp RichTextButton + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalRichTextDiff(data json.RawMessage) (*RichTextDiff, error) { var resp RichTextDiff @@ -16478,6 +16604,14 @@ func UnmarshalPageBlockBlockQuote(data json.RawMessage) (*PageBlockBlockQuote, e return &resp, err } +func UnmarshalPageBlockExpandableBlockQuote(data json.RawMessage) (*PageBlockExpandableBlockQuote, error) { + var resp PageBlockExpandableBlockQuote + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalPageBlockPullQuote(data json.RawMessage) (*PageBlockPullQuote, error) { var resp PageBlockPullQuote @@ -16502,6 +16636,14 @@ func UnmarshalPageBlockAudio(data json.RawMessage) (*PageBlockAudio, error) { return &resp, err } +func UnmarshalPageBlockDocument(data json.RawMessage) (*PageBlockDocument, error) { + var resp PageBlockDocument + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalPageBlockPhoto(data json.RawMessage) (*PageBlockPhoto, error) { var resp PageBlockPhoto @@ -16606,6 +16748,22 @@ func UnmarshalPageBlockMap(data json.RawMessage) (*PageBlockMap, error) { return &resp, err } +func UnmarshalPageBlockButtonRow(data json.RawMessage) (*PageBlockButtonRow, error) { + var resp PageBlockButtonRow + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalPageBlockUnsupported(data json.RawMessage) (*PageBlockUnsupported, error) { + var resp PageBlockUnsupported + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalWebPageInstantView(data json.RawMessage) (*WebPageInstantView, error) { var resp WebPageInstantView @@ -18310,6 +18468,14 @@ func UnmarshalMessageChatJoinByRequest(data json.RawMessage) (*MessageChatJoinBy return &resp, err } +func UnmarshalMessageChatJoinFromCommunity(data json.RawMessage) (*MessageChatJoinFromCommunity, error) { + var resp MessageChatJoinFromCommunity + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalMessageChatDeleteMember(data json.RawMessage) (*MessageChatDeleteMember, error) { var resp MessageChatDeleteMember @@ -18550,8 +18716,8 @@ func UnmarshalMessageGiftedStars(data json.RawMessage) (*MessageGiftedStars, err return &resp, err } -func UnmarshalMessageGiftedTon(data json.RawMessage) (*MessageGiftedTon, error) { - var resp MessageGiftedTon +func UnmarshalMessageGiftedGrams(data json.RawMessage) (*MessageGiftedGrams, error) { + var resp MessageGiftedGrams err := json.Unmarshal(data, &resp) @@ -19318,6 +19484,14 @@ func UnmarshalInputPageBlockBlockQuote(data json.RawMessage) (*InputPageBlockBlo return &resp, err } +func UnmarshalInputPageBlockExpandableBlockQuote(data json.RawMessage) (*InputPageBlockExpandableBlockQuote, error) { + var resp InputPageBlockExpandableBlockQuote + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalInputPageBlockPullQuote(data json.RawMessage) (*InputPageBlockPullQuote, error) { var resp InputPageBlockPullQuote @@ -19342,6 +19516,14 @@ func UnmarshalInputPageBlockAudio(data json.RawMessage) (*InputPageBlockAudio, e return &resp, err } +func UnmarshalInputPageBlockDocument(data json.RawMessage) (*InputPageBlockDocument, error) { + var resp InputPageBlockDocument + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalInputPageBlockPhoto(data json.RawMessage) (*InputPageBlockPhoto, error) { var resp InputPageBlockPhoto @@ -19406,6 +19588,14 @@ func UnmarshalInputPageBlockMap(data json.RawMessage) (*InputPageBlockMap, error return &resp, err } +func UnmarshalInputPageBlockButtonRow(data json.RawMessage) (*InputPageBlockButtonRow, error) { + var resp InputPageBlockButtonRow + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalInputMessageText(data json.RawMessage) (*InputMessageText, error) { var resp InputMessageText @@ -19782,6 +19972,14 @@ func UnmarshalSearchMessagesChatTypeFilterChannel(data json.RawMessage) (*Search return &resp, err } +func UnmarshalSearchMessagesChatTypeFilterCommunity(data json.RawMessage) (*SearchMessagesChatTypeFilterCommunity, error) { + var resp SearchMessagesChatTypeFilterCommunity + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalSearchChatTypeFilterBot(data json.RawMessage) (*SearchChatTypeFilterBot, error) { var resp SearchChatTypeFilterBot @@ -20518,6 +20716,14 @@ func UnmarshalQuickReplyShortcut(data json.RawMessage) (*QuickReplyShortcut, err return &resp, err } +func UnmarshalWelcomeMessage(data json.RawMessage) (*WelcomeMessage, error) { + var resp WelcomeMessage + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalPublicForwardMessage(data json.RawMessage) (*PublicForwardMessage, error) { var resp PublicForwardMessage @@ -26550,6 +26756,14 @@ func UnmarshalUpdateMessageContent(data json.RawMessage) (*UpdateMessageContent, return &resp, err } +func UnmarshalUpdateMessageEphemeralContent(data json.RawMessage) (*UpdateMessageEphemeralContent, error) { + var resp UpdateMessageEphemeralContent + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalUpdateMessageEdited(data json.RawMessage) (*UpdateMessageEdited, error) { var resp UpdateMessageEdited @@ -26910,6 +27124,14 @@ func UnmarshalUpdateChatHasScheduledMessages(data json.RawMessage) (*UpdateChatH return &resp, err } +func UnmarshalUpdateChatHasWelcomeMessages(data json.RawMessage) (*UpdateChatHasWelcomeMessages, error) { + var resp UpdateChatHasWelcomeMessages + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalUpdateChatFolders(data json.RawMessage) (*UpdateChatFolders, error) { var resp UpdateChatFolders @@ -26990,6 +27212,14 @@ func UnmarshalUpdateQuickReplyShortcutMessages(data json.RawMessage) (*UpdateQui return &resp, err } +func UnmarshalUpdateChatWelcomeMessages(data json.RawMessage) (*UpdateChatWelcomeMessages, error) { + var resp UpdateChatWelcomeMessages + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalUpdateForumTopicInfo(data json.RawMessage) (*UpdateForumTopicInfo, error) { var resp UpdateForumTopicInfo @@ -27078,6 +27308,14 @@ func UnmarshalUpdatePendingMessage(data json.RawMessage) (*UpdatePendingMessage, return &resp, err } +func UnmarshalUpdateStopMessageDraft(data json.RawMessage) (*UpdateStopMessageDraft, error) { + var resp UpdateStopMessageDraft + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalUpdateCommunity(data json.RawMessage) (*UpdateCommunity, error) { var resp UpdateCommunity @@ -27150,6 +27388,14 @@ func UnmarshalUpdateSupergroupFullInfo(data json.RawMessage) (*UpdateSupergroupF return &resp, err } +func UnmarshalUpdateCommunityFullInfo(data json.RawMessage) (*UpdateCommunityFullInfo, error) { + var resp UpdateCommunityFullInfo + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalUpdateServiceNotification(data json.RawMessage) (*UpdateServiceNotification, error) { var resp UpdateServiceNotification @@ -29235,6 +29481,9 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeProfileAccentColor: return UnmarshalProfileAccentColor(data) + case TypeCommunityId: + return UnmarshalCommunityId(data) + case TypeCommunityPermissions: return UnmarshalCommunityPermissions(data) @@ -29259,6 +29508,12 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeCommunity: return UnmarshalCommunity(data) + case TypeCommunityChat: + return UnmarshalCommunityChat(data) + + case TypeCommunityFullInfo: + return UnmarshalCommunityFullInfo(data) + case TypeUserRating: return UnmarshalUserRating(data) @@ -29619,6 +29874,9 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeFactCheck: return UnmarshalFactCheck(data) + case TypeEphemeralMessageContent: + return UnmarshalEphemeralMessageContent(data) + case TypeMessage: return UnmarshalMessage(data) @@ -29766,6 +30024,9 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeDraftMessageContentRichMessage: return UnmarshalDraftMessageContentRichMessage(data) + case TypeDraftMessageContentInputRichMessage: + return UnmarshalDraftMessageContentInputRichMessage(data) + case TypeDraftMessageContentVideoNote: return UnmarshalDraftMessageContentVideoNote(data) @@ -29910,6 +30171,9 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeButtonStyleSuccess: return UnmarshalButtonStyleSuccess(data) + case TypeButtonStyleLink: + return UnmarshalButtonStyleLink(data) + case TypeKeyboardButtonTypeText: return UnmarshalKeyboardButtonTypeText(data) @@ -29967,6 +30231,9 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeInlineKeyboardButtonTypeCopyText: return UnmarshalInlineKeyboardButtonTypeCopyText(data) + case TypeInlineKeyboardButtonTypeDisabled: + return UnmarshalInlineKeyboardButtonTypeDisabled(data) + case TypeKeyboardButtonSourceMessage: return UnmarshalKeyboardButtonSourceMessage(data) @@ -30051,6 +30318,9 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeThemeSettings: return UnmarshalThemeSettings(data) + case TypeInlineButton: + return UnmarshalInlineButton(data) + case TypeRichTextPlain: return UnmarshalRichTextPlain(data) @@ -30120,6 +30390,9 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeRichTextMathematicalExpression: return UnmarshalRichTextMathematicalExpression(data) + case TypeRichTextButton: + return UnmarshalRichTextButton(data) + case TypeRichTextDiff: return UnmarshalRichTextDiff(data) @@ -30219,6 +30492,9 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypePageBlockBlockQuote: return UnmarshalPageBlockBlockQuote(data) + case TypePageBlockExpandableBlockQuote: + return UnmarshalPageBlockExpandableBlockQuote(data) + case TypePageBlockPullQuote: return UnmarshalPageBlockPullQuote(data) @@ -30228,6 +30504,9 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypePageBlockAudio: return UnmarshalPageBlockAudio(data) + case TypePageBlockDocument: + return UnmarshalPageBlockDocument(data) + case TypePageBlockPhoto: return UnmarshalPageBlockPhoto(data) @@ -30267,6 +30546,12 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypePageBlockMap: return UnmarshalPageBlockMap(data) + case TypePageBlockButtonRow: + return UnmarshalPageBlockButtonRow(data) + + case TypePageBlockUnsupported: + return UnmarshalPageBlockUnsupported(data) + case TypeWebPageInstantView: return UnmarshalWebPageInstantView(data) @@ -30906,6 +31191,9 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeMessageChatJoinByRequest: return UnmarshalMessageChatJoinByRequest(data) + case TypeMessageChatJoinFromCommunity: + return UnmarshalMessageChatJoinFromCommunity(data) + case TypeMessageChatDeleteMember: return UnmarshalMessageChatDeleteMember(data) @@ -30996,8 +31284,8 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeMessageGiftedStars: return UnmarshalMessageGiftedStars(data) - case TypeMessageGiftedTon: - return UnmarshalMessageGiftedTon(data) + case TypeMessageGiftedGrams: + return UnmarshalMessageGiftedGrams(data) case TypeMessageGiveawayPrizeStars: return UnmarshalMessageGiveawayPrizeStars(data) @@ -31284,6 +31572,9 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeInputPageBlockBlockQuote: return UnmarshalInputPageBlockBlockQuote(data) + case TypeInputPageBlockExpandableBlockQuote: + return UnmarshalInputPageBlockExpandableBlockQuote(data) + case TypeInputPageBlockPullQuote: return UnmarshalInputPageBlockPullQuote(data) @@ -31293,6 +31584,9 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeInputPageBlockAudio: return UnmarshalInputPageBlockAudio(data) + case TypeInputPageBlockDocument: + return UnmarshalInputPageBlockDocument(data) + case TypeInputPageBlockPhoto: return UnmarshalInputPageBlockPhoto(data) @@ -31317,6 +31611,9 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeInputPageBlockMap: return UnmarshalInputPageBlockMap(data) + case TypeInputPageBlockButtonRow: + return UnmarshalInputPageBlockButtonRow(data) + case TypeInputMessageText: return UnmarshalInputMessageText(data) @@ -31458,6 +31755,9 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeSearchMessagesChatTypeFilterChannel: return UnmarshalSearchMessagesChatTypeFilterChannel(data) + case TypeSearchMessagesChatTypeFilterCommunity: + return UnmarshalSearchMessagesChatTypeFilterCommunity(data) + case TypeSearchChatTypeFilterBot: return UnmarshalSearchChatTypeFilterBot(data) @@ -31734,6 +32034,9 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeQuickReplyShortcut: return UnmarshalQuickReplyShortcut(data) + case TypeWelcomeMessage: + return UnmarshalWelcomeMessage(data) + case TypePublicForwardMessage: return UnmarshalPublicForwardMessage(data) @@ -33996,6 +34299,9 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeUpdateMessageContent: return UnmarshalUpdateMessageContent(data) + case TypeUpdateMessageEphemeralContent: + return UnmarshalUpdateMessageEphemeralContent(data) + case TypeUpdateMessageEdited: return UnmarshalUpdateMessageEdited(data) @@ -34131,6 +34437,9 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeUpdateChatHasScheduledMessages: return UnmarshalUpdateChatHasScheduledMessages(data) + case TypeUpdateChatHasWelcomeMessages: + return UnmarshalUpdateChatHasWelcomeMessages(data) + case TypeUpdateChatFolders: return UnmarshalUpdateChatFolders(data) @@ -34161,6 +34470,9 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeUpdateQuickReplyShortcutMessages: return UnmarshalUpdateQuickReplyShortcutMessages(data) + case TypeUpdateChatWelcomeMessages: + return UnmarshalUpdateChatWelcomeMessages(data) + case TypeUpdateForumTopicInfo: return UnmarshalUpdateForumTopicInfo(data) @@ -34194,6 +34506,9 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeUpdatePendingMessage: return UnmarshalUpdatePendingMessage(data) + case TypeUpdateStopMessageDraft: + return UnmarshalUpdateStopMessageDraft(data) + case TypeUpdateCommunity: return UnmarshalUpdateCommunity(data) @@ -34221,6 +34536,9 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeUpdateSupergroupFullInfo: return UnmarshalUpdateSupergroupFullInfo(data) + case TypeUpdateCommunityFullInfo: + return UnmarshalUpdateCommunityFullInfo(data) + case TypeUpdateServiceNotification: return UnmarshalUpdateServiceNotification(data) diff --git a/data/td_api.tl b/data/td_api.tl index be096e6..16b229d 100644 --- a/data/td_api.tl +++ b/data/td_api.tl @@ -185,7 +185,7 @@ termsOfService text:formattedText min_user_age:int32 show_popup:Bool = TermsOfSe //@name Name of the passkey //@addition_date Point in time (Unix timestamp) when the passkey was added //@last_usage_date Point in time (Unix timestamp) when the passkey was used last time; 0 if never -//@software_icon_custom_emoji_id Identifier of the custom emoji that is used as the icon of the software, which created the passkey; 0 if unknown +//@software_icon_custom_emoji_id Identifier of the custom emoji that is used as the icon of the software that created the passkey; 0 if unknown passkey id:string name:string addition_date:int32 last_usage_date:int32 software_icon_custom_emoji_id:int64 = Passkey; //@description Contains a list of passkeys @passkeys List of passkeys @@ -458,7 +458,7 @@ pollOption id:string text:formattedText media:PollMedia voter_count:int32 vote_p //@description Describes one answer option of a poll to be created //@text Option text; 1-100 characters. Only custom emoji entities are allowed to be added and only by Premium users -//@media Option media; pass null if none; ignored in addPollOption. Must be one of the following types: +//@media Option media; pass null if none. Must be one of the following types: //-inputPollMediaAnimation, inputPollMediaLink, inputPollMediaLocation, inputPollMediaPhoto, inputPollMediaSticker, inputPollMediaVenue, or inputPollMediaVideo without caption inputPollOption text:formattedText media:InputPollMedia = InputPollOption; @@ -1091,8 +1091,9 @@ chatPermissions can_send_basic_messages:Bool can_send_audios:Bool can_send_docum //@can_delete_stories True, if the administrator can delete stories posted by other users; applicable to supergroups and channels only //@can_manage_direct_messages True, if the administrator can answer to channel direct messages; applicable to channels only //@can_manage_tags True, if the administrator can change tags of other users; applicable to basic groups and supergroups only +//@can_send_welcome_messages True, if the administrator can manage and send welcome messages //@is_anonymous True, if the administrator isn't shown in the chat member list and sends messages anonymously; applicable to supergroups only -chatAdministratorRights can_manage_chat:Bool can_change_info:Bool can_post_messages:Bool can_edit_messages:Bool can_delete_messages:Bool can_invite_users:Bool can_restrict_members:Bool can_pin_messages:Bool can_manage_topics:Bool can_promote_members:Bool can_manage_video_chats:Bool can_post_stories:Bool can_edit_stories:Bool can_delete_stories:Bool can_manage_direct_messages:Bool can_manage_tags:Bool is_anonymous:Bool = ChatAdministratorRights; +chatAdministratorRights can_manage_chat:Bool can_change_info:Bool can_post_messages:Bool can_edit_messages:Bool can_delete_messages:Bool can_invite_users:Bool can_restrict_members:Bool can_pin_messages:Bool can_manage_topics:Bool can_promote_members:Bool can_manage_video_chats:Bool can_post_stories:Bool can_edit_stories:Bool can_delete_stories:Bool can_manage_direct_messages:Bool can_manage_tags:Bool can_send_welcome_messages:Bool is_anonymous:Bool = ChatAdministratorRights; //@description Contains parameters of the application theme @@ -1382,7 +1383,7 @@ premiumGiftPaymentOptions options:vector = PremiumGift //@description Describes an option for creating of Telegram Premium giveaway or manual distribution of Telegram Premium among chat members. Use telegramPaymentPurposePremiumGiftCodes or telegramPaymentPurposePremiumGiveaway for out-of-store payments //@currency ISO 4217 currency code for Telegram Premium gift code payment //@amount The amount to pay, in the smallest units of the currency -//@winner_count Number of users which will be able to activate the gift codes +//@winner_count Number of users who will be able to activate the gift codes //@month_count Number of months the Telegram Premium subscription will be active //@store_product_id Identifier of the store product associated with the option; may be empty if none //@store_product_quantity Number of times the store product must be paid @@ -2263,6 +2264,9 @@ profileAccentColors palette_colors:vector background_colors:vector profileAccentColor id:int32 light_theme_colors:profileAccentColors dark_theme_colors:profileAccentColors min_supergroup_chat_boost_level:int32 min_channel_chat_boost_level:int32 = ProfileAccentColor; +//@description Contains identifier of a community @id Community identifier +communityId id:int53 = CommunityId; + //@description Describes actions that a user is allowed to take in a community //@can_edit_chat_list True, if the user can change the chats added to the community communityPermissions can_edit_chat_list:Bool = CommunityPermissions; @@ -2304,6 +2308,20 @@ communityMemberStatusBanned = CommunityMemberStatus; //@permissions Actions that non-administrator community members are allowed to take in the community community id:int53 have_access:Bool name:string photo:chatPhotoInfo date:int32 status:CommunityMemberStatus permissions:communityPermissions = Community; +//@description Describes a chat in a community +//@chat_id Identifier of the chat in the community +//@can_view_history True, if message history of the chat can be viewed +//@is_hidden True, if the chat is hidden in the list of community chats; for community administrators only +communityChat chat_id:int53 can_view_history:Bool is_hidden:Bool = CommunityChat; + +//@description Contains full information about a community +//@photo Photo of the community +//@chats Chats belonging to the community +//@administrator_count Number of privileged users in the community; 0 if the current user isn't an administrator of the community +//@banned_count Number of users banned from the community; 0 if the current user isn't an administrator of the community +//@add_chat_request_count Number of pending requests for addition of chats to the community; 0 if the current user isn't an administrator of the community +communityFullInfo photo:chatPhoto chats:vector administrator_count:int32 banned_count:int32 add_chat_request_count:int32 = CommunityFullInfo; + //@description Contains description of user rating //@level The level of the user; may be negative @@ -2527,7 +2545,7 @@ chatMembersFilterAdministrators = ChatMembersFilter; //@description Returns all chat members, including restricted chat members chatMembersFilterMembers = ChatMembersFilter; -//@description Returns users which can be mentioned in the chat @topic_id Identifier of the topic in which the users will be mentioned; pass null if none +//@description Returns users who can be mentioned in the chat @topic_id Identifier of the topic in which the users will be mentioned; pass null if none chatMembersFilterMention topic_id:MessageTopic = ChatMembersFilter; //@description Returns users under certain restrictions in the chat; can be used only by administrators in a supergroup @@ -2545,7 +2563,7 @@ chatMembersFilterBots = ChatMembersFilter; //@description Returns recently active users in reverse chronological order supergroupMembersFilterRecent = SupergroupMembersFilter; -//@description Returns contacts of the user, which are members of the supergroup or channel @query Query to search for +//@description Returns contacts of the current user who are members of the supergroup or channel @query Query to search for supergroupMembersFilterContacts query:string = SupergroupMembersFilter; //@description Returns the owner and administrators @@ -2560,7 +2578,7 @@ supergroupMembersFilterRestricted query:string = SupergroupMembersFilter; //@description Returns users banned from the supergroup or channel; can be used only by administrators @query Query to search for supergroupMembersFilterBanned query:string = SupergroupMembersFilter; -//@description Returns users which can be mentioned in the supergroup @query Query to search for @topic_id Identifier of the topic in which the users will be mentioned; pass null if none +//@description Returns users who can be mentioned in the supergroup @query Query to search for @topic_id Identifier of the topic in which the users will be mentioned; pass null if none supergroupMembersFilterMention query:string topic_id:MessageTopic = SupergroupMembersFilter; //@description Returns bot members of the supergroup or channel @@ -2872,7 +2890,7 @@ messageViewers viewers:vector = MessageViewers; //@description The message was originally sent by a known user @sender_user_id Identifier of the user who originally sent the message messageOriginUser sender_user_id:int53 = MessageOrigin; -//@description The message was originally sent by a user, which is hidden by their privacy settings @sender_name Name of the sender +//@description The message was originally sent by a user who is hidden by their privacy settings @sender_name Name of the sender messageOriginHiddenUser sender_name:string = MessageOrigin; //@description The message was originally sent on behalf of a chat @@ -3095,6 +3113,13 @@ inputMessageReplyToEphemeralMessage ephemeral_message_id:int32 = InputMessageRep //@country_code A two-letter ISO 3166-1 alpha-2 country code of the country for which the fact-check is shown factCheck text:formattedText country_code:string = FactCheck; +//@description Describes an ephemeral content of a regular message, which must be shown instead of the regular content +//@can_be_saved True, if content of the message can be saved locally +//@has_timestamped_media True, if media timestamp entities refers to a media in this message as opposed to a media in the replied message +//@content Content of the message +//@reply_markup Reply markup for the message; may be null if none +ephemeralMessageContent can_be_saved:Bool has_timestamped_media:Bool content:MessageContent reply_markup:ReplyMarkup = EphemeralMessageContent; + //@description Describes a message //@id Message identifier; unique for the chat to which the message belongs @@ -3139,9 +3164,11 @@ factCheck text:formattedText country_code:string = FactCheck; //@restriction_info Information about the restrictions that must be applied to the message content; may be null if none //@summary_language_code IETF language tag of the message language on which it can be summarized; empty if summary isn't available for the message //@content Content of the message +//@ephemeral_content Content of the message, which is visible only to the current user and must be shown instead of the regular content; may be null if none //@reply_markup Reply markup for the message; may be null if none //@ephemeral_message_id Unique identifier of the ephemeral message if the message is ephemeral; for bots only -message id:int53 sender_id:MessageSender receiver_id:MessageSender chat_id:int53 sending_state:MessageSendingState scheduling_state:MessageSchedulingState is_outgoing:Bool is_pinned:Bool is_from_offline:Bool can_be_saved:Bool has_timestamped_media:Bool is_channel_post:Bool is_paid_star_suggested_post:Bool is_paid_gram_suggested_post:Bool contains_unread_mention:Bool contains_unread_poll_votes:Bool date:int32 edit_date:int32 forward_info:messageForwardInfo import_info:messageImportInfo interaction_info:messageInteractionInfo unread_reactions:vector fact_check:factCheck suggested_post_info:suggestedPostInfo reply_to:MessageReplyTo topic_id:MessageTopic self_destruct_type:MessageSelfDestructType self_destruct_in:double auto_delete_in:double via_bot_user_id:int53 guest_bot_caller_id:MessageSender sender_business_bot_user_id:int53 sender_boost_count:int32 sender_tag:string paid_message_star_count:int53 author_signature:string media_album_id:int64 effect_id:int64 restriction_info:restrictionInfo summary_language_code:string content:MessageContent reply_markup:ReplyMarkup ephemeral_message_id:int32 = Message; +//@chat_instance Identifier that uniquely corresponds to the chat to which the message was sent; for bots only +message id:int53 sender_id:MessageSender receiver_id:MessageSender chat_id:int53 sending_state:MessageSendingState scheduling_state:MessageSchedulingState is_outgoing:Bool is_pinned:Bool is_from_offline:Bool can_be_saved:Bool has_timestamped_media:Bool is_channel_post:Bool is_paid_star_suggested_post:Bool is_paid_gram_suggested_post:Bool contains_unread_mention:Bool contains_unread_poll_votes:Bool date:int32 edit_date:int32 forward_info:messageForwardInfo import_info:messageImportInfo interaction_info:messageInteractionInfo unread_reactions:vector fact_check:factCheck suggested_post_info:suggestedPostInfo reply_to:MessageReplyTo topic_id:MessageTopic self_destruct_type:MessageSelfDestructType self_destruct_in:double auto_delete_in:double via_bot_user_id:int53 guest_bot_caller_id:MessageSender sender_business_bot_user_id:int53 sender_boost_count:int32 sender_tag:string paid_message_star_count:int53 author_signature:string media_album_id:int64 effect_id:int64 restriction_info:restrictionInfo summary_language_code:string content:MessageContent ephemeral_content:ephemeralMessageContent reply_markup:ReplyMarkup ephemeral_message_id:int32 chat_instance:int64 = Message; //@description Contains a list of messages @total_count Approximate total number of messages found @messages List of messages; messages may be null @@ -3382,9 +3409,12 @@ reactionNotificationSettings message_reaction_source:ReactionNotificationSource //@link_preview_options Options to be used for generation of a link preview; may be null if none; pass null to use default link preview options draftMessageContentText text:formattedText link_preview_options:linkPreviewOptions = DraftMessageContent; -//@description A rich message draft; not supported in setChatDraftMessage @message The rich message; the message must not have not yet uploaded media +//@description A rich message draft; not supported in setChatDraftMessage @message The rich message draftMessageContentRichMessage message:richMessage = DraftMessageContent; +//@description A rich message draft; only for setChatDraftMessage @message The rich message +draftMessageContentInputRichMessage message:inputRichMessage = DraftMessageContent; + //@description A video note message draft //@file_path Path to the file with the video note //@duration Duration of the video, in seconds; 0-60 @@ -3576,6 +3606,7 @@ videoChat group_call_id:int32 has_participants:Bool default_participant_id:Messa //@is_marked_as_unread True, if the chat is marked as unread //@view_as_topics True, if the chat is a forum supergroup that must be shown in the "View as topics" mode, or Saved Messages chat that must be shown in the "View as chats" //@has_scheduled_messages True, if the chat has scheduled messages +//@has_welcome_messages True, if the chat has welcome messages; for chat administrators with can_change_info administrator right only //@can_be_deleted_only_for_self True, if the chat messages can be deleted only for the current user while other users will continue to see the messages //@can_be_deleted_for_all_users True, if the chat messages can be deleted for all users //@can_be_reported True, if the chat can be reported to Telegram moderators through reportChat or reportChatPhoto @@ -3599,7 +3630,7 @@ videoChat group_call_id:int32 has_participants:Bool default_participant_id:Messa //@reply_markup_message_id Identifier of the message from which reply markup needs to be used; 0 if there is no 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 upgraded_gift_colors:upgradedGiftColors 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 unread_poll_vote_count:int32 notification_settings:chatNotificationSettings available_reactions:ChatAvailableReactions message_auto_delete_time:int32 emoji_status:emojiStatus background:chatBackground theme:ChatTheme 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; +chat id:int53 type:ChatType title:string photo:chatPhotoInfo accent_color_id:int32 background_custom_emoji_id:int64 upgraded_gift_colors:upgradedGiftColors 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 has_welcome_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 unread_poll_vote_count:int32 notification_settings:chatNotificationSettings available_reactions:ChatAvailableReactions message_auto_delete_time:int32 emoji_status:emojiStatus background:chatBackground theme:ChatTheme 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; @@ -3679,6 +3710,9 @@ buttonStyleDanger = ButtonStyle; //@description The button has green color buttonStyleSuccess = ButtonStyle; +//@description The button must be shown as a link. The style is allowed only for callback buttons in inlineButton +buttonStyleLink = ButtonStyle; + //@class KeyboardButtonType @description Describes a keyboard button type @@ -3745,7 +3779,10 @@ keyboardButton text:string icon_custom_emoji_id:int64 style:ButtonStyle type:Key //@description A button that opens a specified URL @url HTTP or tg:// URL to open. If the link is of the type internalLinkTypeWebApp, then the button must be marked as a Web App button inlineKeyboardButtonTypeUrl url:string = InlineKeyboardButtonType; -//@description A button that opens a specified URL and automatically authorize the current user by calling getLoginUrlInfo @url An HTTP URL to pass to getLoginUrlInfo @id Unique button identifier @forward_text If non-empty, new text of the button in forwarded messages +//@description A button that opens a specified URL and automatically authorize the current user by calling getLoginUrlInfo; not supported in ephemeral messages +//@url An HTTP URL to pass to getLoginUrlInfo +//@id Unique button identifier +//@forward_text If non-empty, new text of the button in forwarded messages inlineKeyboardButtonTypeLoginUrl url:string id:int53 forward_text:string = InlineKeyboardButtonType; //@description A button that opens a Web App by calling openWebApp @url An HTTP URL to pass to openWebApp @@ -3772,6 +3809,9 @@ inlineKeyboardButtonTypeUser user_id:int53 = InlineKeyboardButtonType; //@description A button that copies specified text to clipboard @text The text to copy to clipboard inlineKeyboardButtonTypeCopyText text:string = InlineKeyboardButtonType; +//@description A disabled button +inlineKeyboardButtonTypeDisabled = InlineKeyboardButtonType; + //@class KeyboardButtonSource @description Describes source of a keyboard button @@ -3811,12 +3851,14 @@ replyMarkupForceReply is_personal:Bool input_field_placeholder:string = ReplyMar //@resize_keyboard True, if the application needs to resize the keyboard vertically //@one_time True, if the application needs to hide the keyboard after use //@is_personal True, if the keyboard must automatically be shown to the current user. For outgoing messages, specify true to show the keyboard only for the mentioned users and for the target user of a reply +//@force_reply True, if the keyboard must force reply to the message with the keyboard //@input_field_placeholder If non-empty, the placeholder to be shown in the input field when the keyboard is active; 0-64 characters -replyMarkupShowKeyboard rows:vector> is_persistent:Bool resize_keyboard:Bool one_time:Bool is_personal:Bool input_field_placeholder:string = ReplyMarkup; +replyMarkupShowKeyboard rows:vector> is_persistent:Bool resize_keyboard:Bool one_time:Bool is_personal:Bool force_reply:Bool input_field_placeholder:string = ReplyMarkup; //@description Contains an inline keyboard layout //@rows A list of rows of inline keyboard buttons -replyMarkupInlineKeyboard rows:vector> = ReplyMarkup; +//@force_reply True, if a reply to the message must be forced when the message is received +replyMarkupInlineKeyboard rows:vector> force_reply:Bool = ReplyMarkup; //@class LoginUrlInfo @description Contains information about an inline button of type inlineKeyboardButtonTypeLoginUrl or an external link @@ -3984,6 +4026,16 @@ builtInThemeArctic = BuiltInTheme; themeSettings base_theme:BuiltInTheme accent_color:int32 background:background outgoing_message_fill:BackgroundFill animate_outgoing_message_fill:Bool outgoing_message_accent_color:int32 = ThemeSettings; +//@description Represents a button inside a rich message +//@text Text of the button; only richTexts, richTextPlain, and richTextCustomEmoji are allowed +//@style Style of the button +//@type Type of the button; must be one of inlineKeyboardButtonTypeUrl, inlineKeyboardButtonTypeLoginUrl, inlineKeyboardButtonTypeWebApp, inlineKeyboardButtonTypeCallback, +//-inlineKeyboardButtonTypeSwitchInline, inlineKeyboardButtonTypeUser, inlineKeyboardButtonTypeCopyText. Additionally, +//-inlineKeyboardButtonTypeCallbackWithPassword and inlineKeyboardButtonTypeDisabled may be received in incoming messages. Regular users may use only inlineKeyboardButtonTypeUrl, +//-inlineKeyboardButtonTypeUser and inlineKeyboardButtonTypeCopyText +inlineButton text:RichText style:ButtonStyle type:InlineKeyboardButtonType = InlineButton; + + //@class RichText @description Describes a formatted text object //@description A plain text @text Text @@ -4061,6 +4113,9 @@ richTextIcon document:document width:int32 height:int32 = RichText; //@description A mathematical expression @expression The expression in LaTeX format richTextMathematicalExpression expression:string = RichText; +//@description A button @button The button +richTextButton button:inlineButton = RichText; + //@description A rich text replacing another rich text; not supported in inputRichMessage @text Text @old_text The old text richTextDiff text:RichText old_text:RichText = RichText; @@ -4195,6 +4250,11 @@ pageBlockList items:vector = PageBlock; //@credit Quote credit; may be null if none pageBlockBlockQuote blocks:vector credit:RichText = PageBlock; +//@description An expandable block quote +//@text Text of the quote +//@credit Quote credit; may be null if none +pageBlockExpandableBlockQuote text:RichText credit:RichText = PageBlock; + //@description A pull quote //@text Quote text //@credit Quote credit; may be null if none @@ -4208,10 +4268,15 @@ pageBlockPullQuote text:RichText credit:RichText = PageBlock; pageBlockAnimation animation:animation caption:pageBlockCaption need_autoplay:Bool has_spoiler:Bool = PageBlock; //@description An audio file -//@audio Audio file; may be null +//@audio Audio file //@caption Audio file caption; may be null if none pageBlockAudio audio:audio caption:pageBlockCaption = PageBlock; +//@description A general file +//@document The file +//@caption File caption; may be null if none +pageBlockDocument document:document caption:pageBlockCaption = PageBlock; + //@description A photo //@photo Photo file; may be null //@caption Photo caption; may be null if none @@ -4228,7 +4293,7 @@ pageBlockPhoto photo:photo caption:pageBlockCaption url:string has_spoiler:Bool pageBlockVideo video:video caption:pageBlockCaption need_autoplay:Bool is_looped:Bool has_spoiler:Bool = PageBlock; //@description A voice note -//@voice_note Voice note; may be null +//@voice_note Voice note //@caption Voice note caption; may be null if none pageBlockVoiceNote voice_note:voiceNote caption:pageBlockCaption = PageBlock; @@ -4277,7 +4342,8 @@ pageBlockChatLink title:string photo:chatPhotoInfo accent_color_id:int32 usernam //@cells Table cells //@is_bordered True, if the table is bordered //@is_striped True, if the table is striped -pageBlockTable caption:RichText cells:vector> is_bordered:Bool is_striped:Bool = PageBlock; +//@is_compact True, if table cells must have smaller indents +pageBlockTable caption:RichText cells:vector> is_bordered:Bool is_striped:Bool is_compact:Bool = PageBlock; //@description A collapsible block //@header Always visible heading for the block @@ -4298,6 +4364,14 @@ pageBlockRelatedArticles header:RichText articles:vector align:PageBlockHorizontalAlignment = PageBlock; + +//@description Represents a block unsupported by the current application version +pageBlockUnsupported = PageBlock; + //@description Describes an instant view page for a web page //@blocks Content of the instant view page @@ -5282,6 +5356,9 @@ messageChatJoinByLink = MessageContent; //@description A new member was accepted to the chat by an administrator messageChatJoinByRequest = MessageContent; +//@description A new member joined the chat from a community @community_id Identifier of the community from which the user joined the chat +messageChatJoinFromCommunity community_id:int53 = MessageContent; + //@description A chat member was deleted @user_id User identifier of the deleted chat member messageChatDeleteMember user_id:int53 = MessageContent; @@ -5348,8 +5425,10 @@ messageCustomServiceAction text:string = MessageContent; //@description A new high score was achieved in a game @game_message_id Identifier of the message with the game, can be an identifier of a deleted message @game_id Identifier of the game; may be different from the games presented in the message with the game @score New score messageGameScore game_message_id:int53 game_id:int64 score:int32 = MessageContent; -//@description A bot managed by another bot was created by the user @bot_user_id User identifier of the created bot -messageManagedBotCreated bot_user_id:int53 = MessageContent; +//@description A bot managed by another bot was created by the user +//@bot_user_id User identifier of the created bot +//@manager_bot_user_id Identifier of the bot which will manage the new bot +messageManagedBotCreated bot_user_id:int53 manager_bot_user_id:int53 = MessageContent; //@description A payment has been sent to a bot or a business account //@invoice_chat_id Identifier of the chat, containing the corresponding invoice message @@ -5418,7 +5497,7 @@ messageGiveawayCreated star_count:int53 = MessageContent; //@description A giveaway //@parameters Giveaway parameters -//@winner_count Number of users which will receive Telegram Premium subscription gift codes +//@winner_count Number of users who will receive Telegram Premium subscription gift codes //@prize Prize of the giveaway //@sticker A sticker to be shown in the message; may be null if unknown messageGiveaway parameters:giveawayParameters winner_count:int32 prize:GiveawayPrize sticker:sticker = MessageContent; @@ -5462,7 +5541,7 @@ messageGiftedStars gifter_user_id:int53 receiver_user_id:int53 currency:string a //@gram_amount The received Gram amount, in the smallest units of the cryptocurrency //@transaction_id Identifier of the transaction for Gram credit; for receiver only //@sticker A sticker to be shown in the message; may be null if unknown -messageGiftedTon gifter_user_id:int53 receiver_user_id:int53 gram_amount:int53 transaction_id:string sticker:sticker = MessageContent; +messageGiftedGrams gifter_user_id:int53 receiver_user_id:int53 gram_amount:int53 transaction_id:string sticker:sticker = MessageContent; //@description Telegram Stars were received by the current user from a giveaway //@star_count Number of Telegram Stars that were received @@ -5501,6 +5580,8 @@ messageGift gift:gift sender_id:MessageSender receiver_id:MessageSender received //@receiver_id Receiver of the gift //@origin Origin of the upgraded gift //@received_gift_id Unique identifier of the received gift for the current user; only for the receiver of the gift +//@text Message added to the gift +//@is_private True, if the sender and gift text are shown only to the gift receiver; otherwise, everyone will be able to see them //@is_saved True, if the gift is displayed on the user's or the channel's profile page; only for the receiver of the gift //@can_be_transferred True, if the gift can be transferred to another owner; only for the receiver of the gift //@was_transferred True, if the gift has already been transferred to another owner; only for the receiver of the gift @@ -5510,7 +5591,7 @@ messageGift gift:gift sender_id:MessageSender receiver_id:MessageSender received //@next_resale_date Point in time (Unix timestamp) when the gift can be resold to another user; can be in the past; 0 if the gift can't be resold; only for the receiver of the gift //@export_date Point in time (Unix timestamp) when the gift can be transferred to the TON blockchain as an NFT; can be in the past; 0 if NFT export isn't possible; only for the receiver of the gift //@craft_date Point in time (Unix timestamp) when the gift can be used to craft another gift; can be in the past; only for the receiver of the gift -messageUpgradedGift gift:upgradedGift sender_id:MessageSender receiver_id:MessageSender origin:UpgradedGiftOrigin received_gift_id:string is_saved:Bool can_be_transferred:Bool was_transferred:Bool transfer_star_count:int53 drop_original_details_star_count:int53 next_transfer_date:int32 next_resale_date:int32 export_date:int32 craft_date:int32 = MessageContent; +messageUpgradedGift gift:upgradedGift sender_id:MessageSender receiver_id:MessageSender origin:UpgradedGiftOrigin received_gift_id:string text:formattedText is_private:Bool is_saved:Bool can_be_transferred:Bool was_transferred:Bool transfer_star_count:int53 drop_original_details_star_count:int53 next_transfer_date:int32 next_resale_date:int32 export_date:int32 craft_date:int32 = MessageContent; //@description A gift which purchase, upgrade or transfer were refunded //@gift The gift @@ -5586,7 +5667,7 @@ messageSuggestedPostRefunded suggested_post_message_id:int53 reason:SuggestedPos //@description A contact has registered with Telegram messageContactRegistered = MessageContent; -//@description The current user shared users, which were requested by the bot @users The shared users @button_id Identifier of the keyboard button with the request +//@description The current user shared users who were requested by the bot @users The shared users @button_id Identifier of the keyboard button with the request messageUsersShared users:vector button_id:int32 = MessageContent; //@description The current user shared a chat, which was requested by the bot @chat The shared chat @button_id Identifier of the keyboard button with the request @@ -5929,6 +6010,9 @@ inputPageBlockList items:vector = InputPageBlock; //@description A block quote @blocks Quote blocks @credit Quote credit; pass null if none inputPageBlockBlockQuote blocks:vector credit:RichText = InputPageBlock; +//@description An expandable block quote @text Quote text @credit Quote credit; pass null if none +inputPageBlockExpandableBlockQuote text:RichText credit:RichText = InputPageBlock; + //@description A pull quote @text Quote text @credit Quote credit; pass null if none inputPageBlockPullQuote text:RichText credit:RichText = InputPageBlock; @@ -5941,6 +6025,9 @@ inputPageBlockAnimation animation:inputAnimation caption:pageBlockCaption has_sp //@description An audio file @audio The audio to be sent @caption Audio file caption; pass null if none inputPageBlockAudio audio:inputAudio caption:pageBlockCaption = InputPageBlock; +//@description A general file @document The file to be sent @caption File caption; pass null if none +inputPageBlockDocument document:inputDocument caption:pageBlockCaption = InputPageBlock; + //@description A photo //@photo The photo to be sent //@caption Photo caption; pass null if none @@ -5965,9 +6052,10 @@ inputPageBlockSlideshow blocks:vector caption:pageBlockCaption = //@description A table //@caption Table caption //@cells Table cells -//@is_bordered True, if the table is bordered -//@is_striped True, if the table is striped -inputPageBlockTable caption:RichText cells:vector> is_bordered:Bool is_striped:Bool = InputPageBlock; +//@is_bordered Pass true if the table is bordered +//@is_striped Pass true if the table is striped +//@is_compact Pass true if table cells must have smaller indents +inputPageBlockTable caption:RichText cells:vector> is_bordered:Bool is_striped:Bool is_compact:Bool = InputPageBlock; //@description A collapsible block //@header Always visible heading for the block @@ -5983,6 +6071,11 @@ inputPageBlockDetails header:RichText blocks:vector is_open:Bool //@caption Block caption; pass null if none inputPageBlockMap location:location zoom:int32 width:int32 height:int32 caption:pageBlockCaption = InputPageBlock; +//@description A list of buttons shown in a row +//@buttons The buttons +//@align Horizontal alignment of the buttons; pass null if the buttons must be shown full-width +inputPageBlockButtonRow buttons:vector align:PageBlockHorizontalAlignment = InputPageBlock; + //@class InputMessageContent @description The content of a message to send @@ -6253,6 +6346,9 @@ searchMessagesChatTypeFilterGroup = SearchMessagesChatTypeFilter; //@description Returns only messages in channel chats searchMessagesChatTypeFilterChannel = SearchMessagesChatTypeFilter; +//@description Returns only messages in the specified community @community_id Identifier of the community to search in +searchMessagesChatTypeFilterCommunity community_id:int53 = SearchMessagesChatTypeFilter; + //@class SearchChatTypeFilter @description Represents a filter for type of the chats to search for @@ -6743,6 +6839,12 @@ quickReplyMessages messages:vector = QuickReplyMessages; quickReplyShortcut id:int32 name:string first_message:quickReplyMessage message_count:int32 = QuickReplyShortcut; +//@description Describes a set up welcome message +//@id Welcome message identifier; unique for the chat to which the welcome message belongs +//@content Content of the welcome message +welcomeMessage id:int32 content:MessageContent = WelcomeMessage; + + //@class PublicForward @description Describes a public forward or repost of a story //@description Contains a public forward as a message @message Information about the message @@ -6827,7 +6929,7 @@ chatBoostSourcePremium user_id:int53 = ChatBoostSource; //@description Describes a prepaid giveaway //@id Unique identifier of the prepaid giveaway -//@winner_count Number of users which will receive giveaway prize +//@winner_count Number of users who will receive giveaway prize //@prize Prize of the giveaway //@boost_count The number of boosts received by the chat from the giveaway; for Telegram Star giveaways only //@payment_date Point in time (Unix timestamp) when the giveaway was paid @@ -8180,7 +8282,7 @@ storePaymentPurposePremiumSubscription is_restore:Bool is_upgrade:Bool = StorePa //@description The user gifting Telegram Premium to another user //@currency ISO 4217 currency code of the payment currency //@amount Paid amount, in the smallest units of the currency -//@user_id Identifiers of the user which will receive Telegram Premium +//@user_id Identifier of the user who will receive Telegram Premium //@text Text to show along with the gift codes; 0-getOption("gift_text_length_max") characters. Only Bold, Italic, Underline, Strikethrough, Spoiler, CustomEmoji, and DateTime entities are allowed storePaymentPurposePremiumGift currency:string amount:int53 user_id:int53 text:formattedText = StorePaymentPurpose; @@ -8188,7 +8290,7 @@ storePaymentPurposePremiumGift currency:string amount:int53 user_id:int53 text:f //@boosted_chat_id Identifier of the supergroup or channel chat, which will be automatically boosted by the users for duration of the Premium subscription and which is administered by the user //@currency ISO 4217 currency code of the payment currency //@amount Paid amount, in the smallest units of the currency -//@user_ids Identifiers of the users which can activate the gift codes +//@user_ids Identifiers of the users who can activate the gift codes //@text Text to show along with the gift codes; 0-getOption("gift_text_length_max") characters. Only Bold, Italic, Underline, Strikethrough, Spoiler, CustomEmoji, and DateTime entities are allowed storePaymentPurposePremiumGiftCodes boosted_chat_id:int53 currency:string amount:int53 user_ids:vector text:formattedText = StorePaymentPurpose; @@ -8238,7 +8340,7 @@ storeTransactionGooglePlay package_name:string store_product_id:string purchase_ //@description The user gifting Telegram Premium to another user //@currency ISO 4217 currency code of the payment currency, or "XTR" for payments in Telegram Stars //@amount Paid amount, in the smallest units of the currency -//@user_id Identifier of the user which will receive Telegram Premium +//@user_id Identifier of the user who will receive Telegram Premium //@month_count Number of months the Telegram Premium subscription will be active for the user //@text Text to show to the user receiving Telegram Premium; 0-getOption("gift_text_length_max") characters. Only Bold, Italic, Underline, Strikethrough, Spoiler, CustomEmoji, and DateTime entities are allowed telegramPaymentPurposePremiumGift currency:string amount:int53 user_id:int53 month_count:int32 text:formattedText = TelegramPaymentPurpose; @@ -8247,7 +8349,7 @@ telegramPaymentPurposePremiumGift currency:string amount:int53 user_id:int53 mon //@boosted_chat_id Identifier of the supergroup or channel chat, which will be automatically boosted by the users for duration of the Premium subscription and which is administered by the user //@currency ISO 4217 currency code of the payment currency //@amount Paid amount, in the smallest units of the currency -//@user_ids Identifiers of the users which can activate the gift codes +//@user_ids Identifiers of the users who can activate the gift codes //@month_count Number of months the Telegram Premium subscription will be active for the users //@text Text to show along with the gift codes; 0-getOption("gift_text_length_max") characters. Only Bold, Italic, Underline, Strikethrough, Spoiler, CustomEmoji, and DateTime entities are allowed telegramPaymentPurposePremiumGiftCodes boosted_chat_id:int53 currency:string amount:int53 user_ids:vector month_count:int32 text:formattedText = TelegramPaymentPurpose; @@ -8256,7 +8358,7 @@ telegramPaymentPurposePremiumGiftCodes boosted_chat_id:int53 currency:string amo //@parameters Giveaway parameters //@currency ISO 4217 currency code of the payment currency //@amount Paid amount, in the smallest units of the currency -//@winner_count Number of users which will be able to activate the gift codes +//@winner_count Number of users who will be able to activate the gift codes //@month_count Number of months the Telegram Premium subscription will be active for the users telegramPaymentPurposePremiumGiveaway parameters:giveawayParameters currency:string amount:int53 winner_count:int32 month_count:int32 = TelegramPaymentPurpose; @@ -8591,7 +8693,7 @@ pushMessageContentPoll question:string is_regular:Bool is_pinned:Bool = PushMess pushMessageContentPremiumGiftCode month_count:int32 = PushMessageContent; //@description A message with a giveaway -//@winner_count Number of users which will receive giveaway prizes; 0 for pinned message +//@winner_count Number of users who will receive giveaway prizes; 0 for pinned message //@prize Prize of the giveaway; may be null for pinned message //@is_pinned True, if the message is a pinned message with the specified content pushMessageContentGiveaway winner_count:int32 prize:GiveawayPrize is_pinned:Bool = PushMessageContent; @@ -10323,6 +10425,9 @@ updateMessageSendFailed message:message old_message_id:int53 error:error = Updat //@description The message content has changed @chat_id Chat identifier @message_id Message identifier @new_content New message content updateMessageContent chat_id:int53 message_id:int53 new_content:MessageContent = Update; +//@description The message ephemeral content has changed @chat_id Chat identifier @message_id Message identifier @ephemeral_content New ephemeral content of the message; may be null if none +updateMessageEphemeralContent chat_id:int53 message_id:int53 ephemeral_content:ephemeralMessageContent = Update; + //@description A message was edited. Changes in the message content will come in a separate updateMessageContent //@chat_id Chat identifier //@message_id Message identifier @@ -10496,6 +10601,9 @@ updateChatBlockList chat_id:int53 block_list:BlockList = Update; //@description A chat's has_scheduled_messages field has changed @chat_id Chat identifier @has_scheduled_messages New value of has_scheduled_messages updateChatHasScheduledMessages chat_id:int53 has_scheduled_messages:Bool = Update; +//@description A chat's has_welcome_messages field has changed @chat_id Chat identifier @has_welcome_messages New value of has_welcome_messages +updateChatHasWelcomeMessages chat_id:int53 has_welcome_messages:Bool = Update; + //@description The list of chat folders or a chat folder has changed //@chat_folders The new list of chat folders //@main_chat_list_position Position of the main chat list among chat folders, 0-based @@ -10540,6 +10648,11 @@ updateQuickReplyShortcuts shortcut_ids:vector = Update; //@messages The new list of quick reply messages for the shortcut in order from the first to the last sent updateQuickReplyShortcutMessages shortcut_id:int32 messages:vector = Update; +//@description The list of welcome messages of a chat has changed +//@chat_id The identifier of the chat +//@messages The new list of welcome messages of the chat in the order from the first to the last sent +updateChatWelcomeMessages chat_id:int53 messages:vector = Update; + //@description Basic information about a topic in a forum chat was changed @info New information about the topic updateForumTopicInfo info:forumTopicInfo = Update; @@ -10599,12 +10712,20 @@ updateDeleteMessages chat_id:int53 message_ids:vector is_permanent:Bool f updateChatAction chat_id:int53 topic_id:MessageTopic sender_id:MessageSender action:ChatAction = Update; //@description A new pending text or rich message was received in a chat with a bot. The message must be shown in the chat for at most getOption("pending_text_message_period") seconds, -//-replace any other pending message with the same draft_id, and be deleted whenever any incoming message from the bot in the message thread is received +//-replace any other pending message with the same draft_id with animation, and be deleted whenever any incoming message or a pending message with another draft_id is received in the message thread //@chat_id Chat identifier //@forum_topic_id The forum topic identifier in which the message will be sent; 0 if none //@draft_id Unique identifier of the message draft within the message thread +//@can_stop True, if a button that calls stopPendingMessage to stop further message generation must be shown +//@keep_on_stop True, if the pending message must not be automatically deleted when the user presses the Stop button //@content Content of the message; always of the type messageText or messageRichMessage -updatePendingMessage chat_id:int53 forum_topic_id:int32 draft_id:int64 content:MessageContent = Update; +updatePendingMessage chat_id:int53 forum_topic_id:int32 draft_id:int64 can_stop:Bool keep_on_stop:Bool content:MessageContent = Update; + +//@description A message draft generation was stopped by the user +//@chat_id Chat identifier +//@forum_topic_id The forum topic identifier of the message draft +//@draft_id Identifier of the message draft within the message thread +updateStopMessageDraft chat_id:int53 forum_topic_id:int32 draft_id:int64 = Update; //@description Some data of a community has changed. This update is guaranteed to come before the community identifier is returned to the application @community New data about the community updateCommunity community:community = Update; @@ -10633,6 +10754,9 @@ updateBasicGroupFullInfo basic_group_id:int53 basic_group_full_info:basicGroupFu //@description Some data in supergroupFullInfo has been changed @supergroup_id Identifier of the supergroup or channel @supergroup_full_info New full information about the supergroup updateSupergroupFullInfo supergroup_id:int53 supergroup_full_info:supergroupFullInfo = Update; +//@description Some data in communityFullInfo has been changed @community_id Identifier of the community @community_full_info New full information about the community +updateCommunityFullInfo community_id:int53 community_full_info:communityFullInfo = Update; + //@description A service notification from the server was received. Upon receiving this the application must show a popup with the content of the notification //@type Notification type. If type begins with "AUTH_KEY_DROP_", then two buttons "Cancel" and "Log out" must be shown under notification; if user presses the second, all local data must be destroyed using Destroy method //@content Notification content @@ -10652,7 +10776,7 @@ updateFile file:file = Update; //@original_path The original path specified by the application in inputFileGenerated //@destination_path The path to a file that must be created and where the new file must be generated by the application. //-If the application has no access to the path, it can use writeGeneratedFilePart to generate the file -//@conversion If the conversion is "#url#" than original_path contains an HTTP/HTTPS URL of a file that must be downloaded by the application. +//@conversion If the conversion is "#url#", then original_path contains an HTTP/HTTPS URL of a file that must be downloaded by the application. //-Otherwise, this is the conversion specified by the application in inputFileGenerated updateFileGenerationStart generation_id:int64 original_path:string destination_path:string conversion:string = Update; @@ -11676,6 +11800,22 @@ toggleSavedMessagesTopicIsPinned saved_messages_topic_id:int53 is_pinned:Bool = setPinnedSavedMessagesTopics saved_messages_topic_ids:vector = Ok; +//@description Returns full information about a community. The data will be sent through update. @community_id Community identifier +loadCommunityFullInfo community_id:int53 = Ok; + +//@description Creates a new community for the given chat. Returns identifier of the created community +//@name Name of the new community +//@chat_id Identifier of the chat in the community; only chats with owned bots and owned basic group, supergroup and channel chats are allowed; +//-basic group chats will be automatically upgraded to supergroup chats +//@is_chat_hidden Pass true if the chat will be visible only to administrators of the community +createCommunity name:string chat_id:int53 is_chat_hidden:Bool = CommunityId; + +//@description Changes name of the given community; requires can_change_info administrator right in the community +//@community_id Identifier of the community +//@name New name of the community +setCommunityName community_id:int53 name:string = Ok; + + //@description Returns a list of common group chats with a given user. Chats are sorted by their type and creation date //@user_id User identifier //@offset_chat_id Chat identifier starting from which to return chats; use 0 for the first request @@ -12124,14 +12264,16 @@ sendChatScreenshotTakenNotification chat_id:int53 = Ok; //@topic_id Topic in which the message will be sent; pass null if none //@receiver_user_id Identifier of the user who will receive the message //@callback_query_id Identifier of the callback query which triggered the message; for bots only +//@replace_callback_query_message Pass true if the ephemeral message must replace the message from which the callback query originated; for bots only //@reply_to Information about the message to be replied; pass null if none. The message can be an incoming ephemeral message +//@protect_content Pass true if the content of the message must be protected from forwarding and saving; for bots only //@sending_id Non-persistent identifier, which will be returned back in messageSendingStatePending object and can be used to match sent messages and corresponding updateNewMessage updates //@only_preview Pass true to get a fake message instead of actually sending them //@reply_markup Markup for replying to the message; pass null if none; for bots only //@input_message_content The content of the message to be sent. Must be one of the following types: inputMessageText, inputMessageAnimation, -//-inputMessageAudio, inputMessageDocument, inputMessagePhoto, inputMessageSticker, inputMessageVideo, inputMessageVideoNote, inputMessageVoiceNote, +//-inputMessageAudio, inputMessageDocument, inputMessagePhoto, inputMessageRichMessage, inputMessageSticker, inputMessageVideo, inputMessageVideoNote, inputMessageVoiceNote, //-inputMessageLocation, inputMessageVenue, inputMessageContact -sendEphemeralMessage chat_id:int53 topic_id:MessageTopic receiver_user_id:int53 callback_query_id:int64 reply_to:InputMessageReplyTo sending_id:int32 only_preview:Bool reply_markup:ReplyMarkup input_message_content:InputMessageContent = Message; +sendEphemeralMessage chat_id:int53 topic_id:MessageTopic receiver_user_id:int53 callback_query_id:int64 replace_callback_query_message:Bool reply_to:InputMessageReplyTo protect_content:Bool sending_id:int32 only_preview:Bool reply_markup:ReplyMarkup input_message_content:InputMessageContent = Message; //@description Adds a local message to a chat. The message is persistent across application restarts only if the message database is used. Returns the added message //@chat_id Target chat; channel direct messages chats aren't supported @@ -12150,7 +12292,7 @@ deleteMessages chat_id:int53 message_ids:vector revoke:Bool = Ok; //@description Deletes an ephemeral message; for bots only //@chat_id Chat identifier //@receiver_user_id Identifier of the user who received the message -//@ephemeral_message_id Identifiers of the message to be deleted +//@ephemeral_message_id Identifier of the message to be deleted deleteEphemeralMessage chat_id:int53 receiver_user_id:int53 ephemeral_message_id:int32 = Ok; //@description Deletes all messages sent by the specified message sender in a chat. Supported only for supergroups; requires can_delete_messages administrator right @chat_id Chat identifier @sender_id Identifier of the sender of messages to delete @@ -12240,21 +12382,43 @@ editInlineMessageCaption inline_message_id:string reply_markup:ReplyMarkup capti //@reply_markup The new message reply markup; pass null if none editInlineMessageReplyMarkup inline_message_id:string reply_markup:ReplyMarkup = Ok; -//@description Edits the text, caption or reply markup of an ephemeral message sent by the bot; for bots only +//@description Edits the text, media, or reply markup of an ephemeral message sent by the bot; for bots only //@chat_id The chat the message belongs to //@receiver_user_id Identifier of the user who received the message //@ephemeral_message_id Identifier of the ephemeral message //@reply_markup The new message reply markup; pass null if none //@input_message_content New content of the message; pass null to edit only reply markup. Must be one of the following types: inputMessageText, inputMessageAnimation, -//-inputMessageAudio, inputMessageDocument, inputMessagePhoto, inputMessageSticker, inputMessageVideo, inputMessageVideoNote, inputMessageVoiceNote +//-inputMessageAudio, inputMessageDocument, inputMessagePhoto, inputMessageRichMessage, inputMessageSticker, inputMessageVideo, inputMessageVideoNote, inputMessageVoiceNote editEphemeralMessage chat_id:int53 receiver_user_id:int53 ephemeral_message_id:int32 reply_markup:ReplyMarkup input_message_content:InputMessageContent = Ok; +//@description Edits the caption and reply markup of an ephemeral message sent by the bot; for bots only +//@chat_id The chat the message belongs to +//@receiver_user_id Identifier of the user who received the message +//@ephemeral_message_id Identifier of the ephemeral message +//@reply_markup The new message reply markup; pass null if none +//@caption New message content caption; pass null to remove caption; 0-getOption("message_caption_length_max") characters +//@show_caption_above_media Pass true to show the caption above the media; otherwise, the caption will be shown below the media. May be true only for animation, photo, and video messages +editEphemeralMessageCaption chat_id:int53 receiver_user_id:int53 ephemeral_message_id:int32 reply_markup:ReplyMarkup caption:formattedText show_caption_above_media:Bool = Ok; + +//@description Edits the message from which a callback query has originated with an ephemeral message; for bots only +//@callback_query_id Identifier of the callback query +//@protect_content Pass true if the content of the message must be protected from forwarding and saving +//@reply_markup The new message reply markup; pass null if none +//@input_message_content New content of the message. Must be one of the following types: inputMessageText, inputMessageAnimation, +//-inputMessageAudio, inputMessageDocument, inputMessagePhoto, inputMessageRichMessage, inputMessageSticker, inputMessageVideo, inputMessageVideoNote, inputMessageVoiceNote +editCallbackQueryMessage callback_query_id:int64 protect_content:Bool reply_markup:ReplyMarkup input_message_content:InputMessageContent = Ok; + //@description Edits the time when a scheduled message will be sent. Scheduling state of all messages in the same album or forwarded together with the message will be also changed //@chat_id The chat the message belongs to //@message_id Identifier of the message. Use messageProperties.can_edit_scheduling_state to check whether the message is suitable //@scheduling_state The new message scheduling state; pass null to send the message immediately. Must be null for messages in the state messageSchedulingStateSendWhenVideoProcessed editMessageSchedulingState chat_id:int53 message_id:int53 scheduling_state:MessageSchedulingState = Ok; +//@description Removes message ephemeral content and reverts message state to the original +//@chat_id The chat the message belongs to +//@message_id Identifier of the message +deleteMessageEphemeralContent chat_id:int53 message_id:int53 = Ok; + //@description Changes the fact-check of a message. Can be only used if messageProperties.can_set_fact_check == true //@chat_id The channel chat the message belongs to @@ -12457,7 +12621,7 @@ addQuickReplyShortcutInlineQueryResultMessage shortcut_name:string reply_to_mess addQuickReplyShortcutMessageAlbum shortcut_name:string reply_to_message_id:int53 input_message_contents:vector = QuickReplyMessages; //@description Re-adds 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 re-added, 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 +//-If a message is re-added, 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 re-added, null will be returned instead of the message //@shortcut_name Name of the target shortcut //@message_ids Identifiers of the quick reply messages to re-add. Message identifiers must be in a strictly increasing order readdQuickReplyShortcutMessages shortcut_name:string message_ids:vector = QuickReplyMessages; @@ -12471,6 +12635,33 @@ readdQuickReplyShortcutMessages shortcut_name:string message_ids:vector = editQuickReplyMessage shortcut_id:int32 message_id:int53 input_message_content:InputMessageContent = Ok; +//@description Loads welcome messages of a chat; requires can_send_welcome_messages administrator right in the chat. The loaded messages will be sent through updateChatWelcomeMessages +//@chat_id The identifier of the chat +loadChatWelcomeMessages chat_id:int53 = Ok; + +//@description Adds a message to the list of welcome messages of a chat; requires can_send_welcome_messages administrator right in the chat. There can be up to getOption("welcome_message_count_max") welcome messages in a chat +//@chat_id The identifier of the chat +//@input_message_content The content of the message to be sent. Must be one of the following types: inputMessageText, inputMessageAnimation, +//-inputMessageAudio, inputMessageDocument, inputMessagePhoto, inputMessageRichMessage, inputMessageSticker, inputMessageVideo, inputMessageVideoNote, inputMessageVoiceNote, +//-inputMessageLocation, inputMessageVenue, inputMessageContact +addChatWelcomeMessage chat_id:int53 input_message_content:InputMessageContent = Ok; + +//@description Edits a welcome message of a chat; requires can_send_welcome_messages administrator right in the chat +//@chat_id The identifier of the chat +//@welcome_message_id The identifier of the welcome message +//@input_message_content New content of the message. Must be one of the following types: inputMessageText, inputMessageAnimation, +//-inputMessageAudio, inputMessageDocument, inputMessagePhoto, inputMessageRichMessage, inputMessageSticker, inputMessageVideo, inputMessageVideoNote, inputMessageVoiceNote +editChatWelcomeMessage chat_id:int53 welcome_message_id:int32 input_message_content:InputMessageContent = Ok; + +//@description Deletes a welcome message of a chat; requires can_send_welcome_messages administrator right in the chat +//@chat_id The identifier of the chat +//@welcome_message_id The identifier of the welcome message +deleteChatWelcomeMessage chat_id:int53 welcome_message_id:int32 = Ok; + +//@description Deletes all welcome messages of a chat; requires can_send_welcome_messages administrator right in the chat @chat_id The identifier of the chat +deleteAllChatWelcomeMessages chat_id:int53 = Ok; + + //@description Returns the list of custom emoji, which can be used as forum topic icon by all users getForumTopicDefaultIcons = Stickers; @@ -13011,15 +13202,25 @@ sendChatAction chat_id:int53 topic_id:MessageTopic business_connection_id:string //@chat_id Chat identifier //@forum_topic_id The forum topic identifier in which the message will be sent; pass 0 if none //@draft_id Unique identifier of the draft +//@can_stop Pass true to show the user a button to stop further drafts +//@keep_on_stop Pass true to keep the current draft when the user stops further generation //@text Draft text of the message; pass null to show a "Thinking..." placeholder -sendTextMessageDraft chat_id:int53 forum_topic_id:int32 draft_id:int64 text:formattedText = Ok; +sendTextMessageDraft chat_id:int53 forum_topic_id:int32 draft_id:int64 can_stop:Bool keep_on_stop:Bool text:formattedText = Ok; //@description Sends a draft for a being generated rich message; for bots only //@chat_id Chat identifier //@forum_topic_id The forum topic identifier in which the message will be sent; pass 0 if none //@draft_id Unique identifier of the draft +//@can_stop Pass true to show the user a button to stop further drafts +//@keep_on_stop Pass true to keep the current draft when the user stops further generation //@message Draft of the message; file upload isn't supported -sendRichMessageDraft chat_id:int53 forum_topic_id:int32 draft_id:int64 message:inputRichMessage = Ok; +sendRichMessageDraft chat_id:int53 forum_topic_id:int32 draft_id:int64 can_stop:Bool keep_on_stop:Bool message:inputRichMessage = Ok; + +//@description Stops a pending message generation by a bot +//@chat_id Identifier of the chat with the bot +//@topic_id Identifier of the topic in which the action is performed; pass null if none +//@draft_id Unique identifier of the message draft within the message thread +stopPendingMessage chat_id:int53 topic_id:MessageTopic draft_id:int64 = Ok; //@description Informs TDLib that the chat is opened by the user. Many useful activities depend on the chat being opened or closed (e.g., in supergroups and channels all updates are received only for opened chats) @chat_id Chat identifier @@ -13296,7 +13497,7 @@ setChatTheme chat_id:int53 theme:InputChatTheme = Ok; //@description Changes the draft message in a chat or a topic //@chat_id Chat identifier //@topic_id Topic in which the draft will be changed; pass null to change the draft for the chat itself -//@draft_message New draft message; pass null to remove the draft. All files in draft message content must be of the type inputFileLocal. Media thumbnails and captions are ignored +//@draft_message New draft message; pass null to remove the draft setChatDraftMessage chat_id:int53 topic_id:MessageTopic draft_message:draftMessage = Ok; //@description Changes the notification settings of a chat. Notification settings of a chat with the current user (Saved Messages) can't be changed @@ -13384,7 +13585,7 @@ leaveChat chat_id:int53 = Ok; //@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 = 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. +//@description Adds multiple new members to a chat; requires can_invite_users member right. Currently, this method is available only in 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 @@ -13400,7 +13601,7 @@ setChatMemberStatus chat_id:int53 member_id:MessageSender status:ChatMemberStatu //@description Changes the tag or custom title of a chat member; requires can_manage_tags administrator right to change tag of other users; for basic groups and supergroups only //@chat_id Chat identifier -//@user_id Identifier of the user, which tag is changed. Chats can't have member tags +//@user_id Identifier of the user whose tag is changed. Chats can't have member tags //@tag The new tag of the member in the chat; 0-16 characters without emoji setChatMemberTag chat_id:int53 user_id:int53 tag:string = Ok; @@ -13420,8 +13621,8 @@ canTransferOwnership = CanTransferOwnershipResult; //@password The 2-step verification password of the current user transferChatOwnership chat_id:int53 user_id:int53 password:string = Ok; -//@description Returns the user who will become the owner of the chat after 7 days if the current user does not return to the supergroup or channel during that period or immediately for basic groups; requires owner privileges in the chat. -//-Available only for basic groups, supergroups, and channel chats +//@description Returns the user who will become the owner of the chat after 7 days if the current user does not return to the supergroup or channel during that period or immediately for basic groups; +//-requires owner privileges in the chat. Available only for basic groups, supergroups, and channel chats //@chat_id Chat identifier getChatOwnerAfterLeaving chat_id:int53 = User; @@ -13910,7 +14111,7 @@ createChatInviteLink chat_id:int53 name:string expiration_date:int32 member_limi //-Subscription period must be 2592000 in production environment, and 60 or 300 if Telegram test environment is used createChatSubscriptionInviteLink chat_id:int53 name:string subscription_pricing:starSubscriptionPricing = ChatInviteLink; -//@description Edits a non-primary invite link for a chat. Available for basic groups, supergroups, and channels. +//@description Edits a non-primary invite link for a chat. Available in basic groups, supergroups, and channels. //-If the link creates a subscription, then expiration_date, member_limit and creates_join_request must not be used. //-Requires administrator privileges and can_invite_users right in the chat for own links and owner privileges for other links //@chat_id Chat identifier @@ -13952,7 +14153,7 @@ getChatInviteLinks chat_id:int53 creator_user_id:int53 is_revoked:Bool offset_da //@limit The maximum number of chat members to return; up to 100 getChatInviteLinkMembers chat_id:int53 invite_link:string only_with_expired_subscription:Bool offset_member:chatInviteLinkMember limit:int32 = ChatInviteLinkMembers; -//@description Revokes invite link for a chat. Available for basic groups, supergroups, and channels. Requires administrator privileges and can_invite_users right in the chat for own links and owner privileges for other links. +//@description Revokes invite link for a chat. Available in basic groups, supergroups, and channels. Requires administrator privileges and can_invite_users right in the chat for own links and owner privileges for other links. //-If a primary link is revoked, then additionally to the revoked link returns new primary link //@chat_id Chat identifier //@invite_link Invite link to be revoked @@ -15049,7 +15250,7 @@ getSupergroupMembers supergroup_id:int53 filter:SupergroupMembersFilter offset:i closeSecretChat secret_chat_id:int32 = Ok; -//@description Returns a list of service actions taken by chat members and administrators in the last 48 hours. Available only for supergroups and channels. Requires administrator rights. Returns results in reverse chronological order (i.e., in order of decreasing event_id) +//@description Returns a list of service actions taken by chat members and administrators in the last 48 hours. Available only in supergroups and channels. Requires administrator rights. Returns results in reverse chronological order (i.e., in order of decreasing event_id) //@chat_id Chat identifier //@query Search query by which to filter events //@from_event_id Identifier of an event from which to return results. Use 0 to get results from the latest events @@ -15205,7 +15406,10 @@ dropGiftOriginalDetails received_gift_id:string star_count:int53 = Ok; //@gift_name Name of the upgraded gift to send //@owner_id Identifier of the user or the channel chat that will receive the gift //@price The price that the user agreed to pay for the gift -sendResoldGift gift_name:string owner_id:MessageSender price:GiftResalePrice = GiftResaleResult; +//@text Text to show along with the gift; 0-getOption("gift_text_length_max") characters. Only Bold, Italic, Underline, Strikethrough, Spoiler, CustomEmoji, and DateTime entities are allowed. +//-Must be empty if the receiver enabled paid messages and the price of the gift is less than the price of a paid message to the user +//@is_private Pass true to show gift text and sender only to the gift receiver; otherwise, everyone will be able to see them +sendResoldGift gift_name:string owner_id:MessageSender price:GiftResalePrice text:formattedText is_private:Bool = GiftResaleResult; //@description Sends an offer to purchase an upgraded gift //@owner_id Identifier of the user or the channel chat that currently owns the gift and will receive the offer @@ -15264,7 +15468,7 @@ getUpgradedGiftsPromotionalAnimation = Animation; //@received_gift_id Identifier of the unique gift //@price The new price for the unique gift; pass null to disallow gift resale. The current user will receive //-getOption("gift_resale_star_earnings_per_mille") Telegram Stars for each 1000 Telegram Stars paid for the gift if the gift price is in Telegram Stars or -//-getOption("gift_resale_ton_earnings_per_mille") TON Grams for each 1000 Grams paid for the gift if the gift price is in Grams +//-getOption("gift_resale_gram_earnings_per_mille") TON Grams for each 1000 Grams paid for the gift if the gift price is in Grams setGiftResalePrice received_gift_id:string price:GiftResalePrice = Ok; //@description Returns upgraded gifts that can be bought from other owners using sendResoldGift @@ -15837,7 +16041,7 @@ checkPremiumGiftCode code:string = PremiumGiftCodeInfo; applyPremiumGiftCode code:string = Ok; //@description Allows to buy a Telegram Premium subscription for another user with payment in Telegram Stars; for bots only -//@user_id Identifier of the user which will receive Telegram Premium +//@user_id Identifier of the user who will receive Telegram Premium //@star_count The number of Telegram Stars to pay for subscription //@month_count Number of months the Telegram Premium subscription will be active for the user //@text Text to show to the user receiving Telegram Premium; 0-getOption("gift_text_length_max") characters. Only Bold, Italic, Underline, Strikethrough, Spoiler, CustomEmoji, and DateTime entities are allowed