Update to TDLib 1.8.8

This commit is contained in:
c0re100 2022-11-08 02:50:52 +08:00
parent 65692be746
commit abdd0dfd48
No known key found for this signature in database
GPG key ID: 7C3B3004FE745AAF
4 changed files with 1952 additions and 160 deletions

View file

@ -2121,7 +2121,7 @@ type DeleteChatRequest struct {
ChatId int64 `json:"chat_id"` ChatId int64 `json:"chat_id"`
} }
// Deletes a chat along with all messages in the corresponding chat for all chat members. For group chats this will release the username and remove all members. Use the field chat.can_be_deleted_for_all_users to find whether the method can be applied to the chat // Deletes a chat along with all messages in the corresponding chat for all chat members. For group chats this will release the usernames and remove all members. Use the field chat.can_be_deleted_for_all_users to find whether the method can be applied to the chat
func (client *Client) DeleteChat(req *DeleteChatRequest) (*Ok, error) { func (client *Client) DeleteChat(req *DeleteChatRequest) (*Ok, error) {
result, err := client.Send(Request{ result, err := client.Send(Request{
meta: meta{ meta: meta{
@ -2161,7 +2161,7 @@ type SearchChatMessagesRequest struct {
MessageThreadId int64 `json:"message_thread_id"` MessageThreadId int64 `json:"message_thread_id"`
} }
// Searches for messages with given words in the chat. Returns the results in reverse chronological order, i.e. in order of decreasing message_id. Cannot be used in secret chats with a non-empty query (searchSecretMessages must be used instead), or without an enabled message database. For optimal performance, the number of returned messages is chosen by TDLib and can be smaller than the specified limit // Searches for messages with given words in the chat. Returns the results in reverse chronological order, i.e. in order of decreasing message_id. Cannot be used in secret chats with a non-empty query (searchSecretMessages must be used instead), or without an enabled message database. For optimal performance, the number of returned messages is chosen by TDLib and can be smaller than the specified limit. A combination of query, sender_id, filter and message_thread_id search criteria is expected to be supported, only if it is required for Telegram official application implementation
func (client *Client) SearchChatMessages(req *SearchChatMessagesRequest) (*Messages, error) { func (client *Client) SearchChatMessages(req *SearchChatMessagesRequest) (*Messages, error) {
result, err := client.Send(Request{ result, err := client.Send(Request{
meta: meta{ meta: meta{
@ -2540,6 +2540,41 @@ func (client *Client) GetChatMessageCount(req *GetChatMessageCountRequest) (*Cou
return UnmarshalCount(result.Data) return UnmarshalCount(result.Data)
} }
type GetChatMessagePositionRequest struct {
// Identifier of the chat in which to find message position
ChatId int64 `json:"chat_id"`
// Message identifier
MessageId int64 `json:"message_id"`
// Filter for message content; searchMessagesFilterEmpty, searchMessagesFilterUnreadMention, searchMessagesFilterUnreadReaction, and searchMessagesFilterFailedToSend are unsupported in this function
Filter SearchMessagesFilter `json:"filter"`
// If not 0, only messages in the specified thread will be considered; supergroups only
MessageThreadId int64 `json:"message_thread_id"`
}
// Returns approximate 1-based position of a message among messages, which can be found by the specified filter in the chat. Cannot be used in secret chats
func (client *Client) GetChatMessagePosition(req *GetChatMessagePositionRequest) (*Count, error) {
result, err := client.Send(Request{
meta: meta{
Type: "getChatMessagePosition",
},
Data: map[string]interface{}{
"chat_id": req.ChatId,
"message_id": req.MessageId,
"filter": req.Filter,
"message_thread_id": req.MessageThreadId,
},
})
if err != nil {
return nil, err
}
if result.Type == "error" {
return nil, buildResponseError(result.Data)
}
return UnmarshalCount(result.Data)
}
type GetChatScheduledMessagesRequest struct { type GetChatScheduledMessagesRequest struct {
// Chat identifier // Chat identifier
ChatId int64 `json:"chat_id"` ChatId int64 `json:"chat_id"`
@ -2601,16 +2636,16 @@ func (client *Client) GetMessagePublicForwards(req *GetMessagePublicForwardsRequ
return UnmarshalFoundMessages(result.Data) return UnmarshalFoundMessages(result.Data)
} }
type GetChatSponsoredMessageRequest struct { type GetChatSponsoredMessagesRequest struct {
// Identifier of the chat // Identifier of the chat
ChatId int64 `json:"chat_id"` ChatId int64 `json:"chat_id"`
} }
// Returns sponsored message to be shown in a chat; for channel chats only. Returns a 404 error if there is no sponsored message in the chat // Returns sponsored messages to be shown in a chat; for channel chats only
func (client *Client) GetChatSponsoredMessage(req *GetChatSponsoredMessageRequest) (*SponsoredMessage, error) { func (client *Client) GetChatSponsoredMessages(req *GetChatSponsoredMessagesRequest) (*SponsoredMessages, error) {
result, err := client.Send(Request{ result, err := client.Send(Request{
meta: meta{ meta: meta{
Type: "getChatSponsoredMessage", Type: "getChatSponsoredMessages",
}, },
Data: map[string]interface{}{ Data: map[string]interface{}{
"chat_id": req.ChatId, "chat_id": req.ChatId,
@ -2624,7 +2659,7 @@ func (client *Client) GetChatSponsoredMessage(req *GetChatSponsoredMessageReques
return nil, buildResponseError(result.Data) return nil, buildResponseError(result.Data)
} }
return UnmarshalSponsoredMessage(result.Data) return UnmarshalSponsoredMessages(result.Data)
} }
type RemoveNotificationRequest struct { type RemoveNotificationRequest struct {
@ -2694,8 +2729,8 @@ type GetMessageLinkRequest struct {
MediaTimestamp int32 `json:"media_timestamp"` MediaTimestamp int32 `json:"media_timestamp"`
// Pass true to create a link for the whole media album // Pass true to create a link for the whole media album
ForAlbum bool `json:"for_album"` ForAlbum bool `json:"for_album"`
// Pass true to create a link to the message as a channel post comment, or from a message thread // Pass true to create a link to the message as a channel post comment, in a message thread, or a forum topic
ForComment bool `json:"for_comment"` InMessageThread bool `json:"in_message_thread"`
} }
// Returns an HTTPS link to a message in a chat. Available only for already sent messages in supergroups and channels, or if message.can_get_media_timestamp_links and a media timestamp link is generated. This is an offline request // Returns an HTTPS link to a message in a chat. Available only for already sent messages in supergroups and channels, or if message.can_get_media_timestamp_links and a media timestamp link is generated. This is an offline request
@ -2709,7 +2744,7 @@ func (client *Client) GetMessageLink(req *GetMessageLinkRequest) (*MessageLink,
"message_id": req.MessageId, "message_id": req.MessageId,
"media_timestamp": req.MediaTimestamp, "media_timestamp": req.MediaTimestamp,
"for_album": req.ForAlbum, "for_album": req.ForAlbum,
"for_comment": req.ForComment, "in_message_thread": req.InMessageThread,
}, },
}) })
if err != nil { if err != nil {
@ -2820,7 +2855,7 @@ type RecognizeSpeechRequest struct {
MessageId int64 `json:"message_id"` MessageId int64 `json:"message_id"`
} }
// Recognizes speech in a voice note message. The message must be successfully sent and must not be scheduled. May return an error with a message "MSG_VOICE_TOO_LONG" if the voice note is too long to be recognized // Recognizes speech in a video note or a voice note message. The message must be successfully sent and must not be scheduled. May return an error with a message "MSG_VOICE_TOO_LONG" if media duration is too big to be recognized
func (client *Client) RecognizeSpeech(req *RecognizeSpeechRequest) (*Ok, error) { func (client *Client) RecognizeSpeech(req *RecognizeSpeechRequest) (*Ok, error) {
result, err := client.Send(Request{ result, err := client.Send(Request{
meta: meta{ meta: meta{
@ -2851,7 +2886,7 @@ type RateSpeechRecognitionRequest struct {
IsGood bool `json:"is_good"` IsGood bool `json:"is_good"`
} }
// Rates recognized speech in a voice note message // Rates recognized speech in a video note or a voice note message
func (client *Client) RateSpeechRecognition(req *RateSpeechRecognitionRequest) (*Ok, error) { func (client *Client) RateSpeechRecognition(req *RateSpeechRecognitionRequest) (*Ok, error) {
result, err := client.Send(Request{ result, err := client.Send(Request{
meta: meta{ meta: meta{
@ -2880,7 +2915,7 @@ type GetChatAvailableMessageSendersRequest struct {
} }
// Returns list of message sender identifiers, which can be used to send messages in a chat // Returns list of message sender identifiers, which can be used to send messages in a chat
func (client *Client) GetChatAvailableMessageSenders(req *GetChatAvailableMessageSendersRequest) (*MessageSenders, error) { func (client *Client) GetChatAvailableMessageSenders(req *GetChatAvailableMessageSendersRequest) (*ChatMessageSenders, error) {
result, err := client.Send(Request{ result, err := client.Send(Request{
meta: meta{ meta: meta{
Type: "getChatAvailableMessageSenders", Type: "getChatAvailableMessageSenders",
@ -2897,7 +2932,7 @@ func (client *Client) GetChatAvailableMessageSenders(req *GetChatAvailableMessag
return nil, buildResponseError(result.Data) return nil, buildResponseError(result.Data)
} }
return UnmarshalMessageSenders(result.Data) return UnmarshalChatMessageSenders(result.Data)
} }
type SetChatMessageSenderRequest struct { type SetChatMessageSenderRequest struct {
@ -3090,6 +3125,8 @@ func (client *Client) SendInlineQueryResultMessage(req *SendInlineQueryResultMes
type ForwardMessagesRequest struct { type ForwardMessagesRequest struct {
// Identifier of the chat to which to forward messages // Identifier of the chat to which to forward messages
ChatId int64 `json:"chat_id"` ChatId int64 `json:"chat_id"`
// If not 0, a message thread identifier in which the message will be sent; for forum threads only
MessageThreadId int64 `json:"message_thread_id"`
// Identifier of the chat from which to forward messages // Identifier of the chat from which to forward messages
FromChatId int64 `json:"from_chat_id"` FromChatId int64 `json:"from_chat_id"`
// Identifiers of the messages to forward. Message identifiers must be in a strictly increasing order. At most 100 messages can be forwarded simultaneously // Identifiers of the messages to forward. Message identifiers must be in a strictly increasing order. At most 100 messages can be forwarded simultaneously
@ -3112,6 +3149,7 @@ func (client *Client) ForwardMessages(req *ForwardMessagesRequest) (*Messages, e
}, },
Data: map[string]interface{}{ Data: map[string]interface{}{
"chat_id": req.ChatId, "chat_id": req.ChatId,
"message_thread_id": req.MessageThreadId,
"from_chat_id": req.FromChatId, "from_chat_id": req.FromChatId,
"message_ids": req.MessageIds, "message_ids": req.MessageIds,
"options": req.Options, "options": req.Options,
@ -3693,6 +3731,153 @@ func (client *Client) EditMessageSchedulingState(req *EditMessageSchedulingState
return UnmarshalOk(result.Data) return UnmarshalOk(result.Data)
} }
// Returns list of custom emojis, which can be used as forum topic icon by all users
func (client *Client) GetForumTopicDefaultIcons() (*Stickers, error) {
result, err := client.Send(Request{
meta: meta{
Type: "getForumTopicDefaultIcons",
},
Data: map[string]interface{}{},
})
if err != nil {
return nil, err
}
if result.Type == "error" {
return nil, buildResponseError(result.Data)
}
return UnmarshalStickers(result.Data)
}
type CreateForumTopicRequest struct {
// Identifier of the chat
ChatId int64 `json:"chat_id"`
// Name of the topic; 1-128 characters
Name string `json:"name"`
// Icon of the topic. Icon color must be one of 0x6FB9F0, 0xFFD67E, 0xCB86DB, 0x8EEE98, 0xFF93B2, or 0xFB6F5F. Telegram Premium users can use any custom emoji as topic icon, other users can use only a custom emoji returned by getForumTopicDefaultIcons
Icon *ForumTopicIcon `json:"icon"`
}
// Creates a topic in a forum supergroup chat; requires can_manage_topics rights in the supergroup
func (client *Client) CreateForumTopic(req *CreateForumTopicRequest) (*ForumTopicInfo, error) {
result, err := client.Send(Request{
meta: meta{
Type: "createForumTopic",
},
Data: map[string]interface{}{
"chat_id": req.ChatId,
"name": req.Name,
"icon": req.Icon,
},
})
if err != nil {
return nil, err
}
if result.Type == "error" {
return nil, buildResponseError(result.Data)
}
return UnmarshalForumTopicInfo(result.Data)
}
type EditForumTopicRequest struct {
// Identifier of the chat
ChatId int64 `json:"chat_id"`
// Message thread identifier of the forum topic
MessageThreadId int64 `json:"message_thread_id"`
// New name of the topic; 1-128 characters
Name string `json:"name"`
// Identifier of the new custom emoji for topic icon. Telegram Premium users can use any custom emoji, other users can use only a custom emoji returned by getForumTopicDefaultIcons
IconCustomEmojiId JsonInt64 `json:"icon_custom_emoji_id"`
}
// Edits title and icon of a topic in a forum supergroup chat; requires can_manage_topics administrator rights in the supergroup unless the user is creator of the topic
func (client *Client) EditForumTopic(req *EditForumTopicRequest) (*Ok, error) {
result, err := client.Send(Request{
meta: meta{
Type: "editForumTopic",
},
Data: map[string]interface{}{
"chat_id": req.ChatId,
"message_thread_id": req.MessageThreadId,
"name": req.Name,
"icon_custom_emoji_id": req.IconCustomEmojiId,
},
})
if err != nil {
return nil, err
}
if result.Type == "error" {
return nil, buildResponseError(result.Data)
}
return UnmarshalOk(result.Data)
}
type ToggleForumTopicIsClosedRequest struct {
// Identifier of the chat
ChatId int64 `json:"chat_id"`
// Message thread identifier of the forum topic
MessageThreadId int64 `json:"message_thread_id"`
// Pass true to close the topic; pass false to reopen it
IsClosed bool `json:"is_closed"`
}
// Toggles whether a topic is closed in a forum supergroup chat; requires can_manage_topics administrator rights in the supergroup unless the user is creator of the topic
func (client *Client) ToggleForumTopicIsClosed(req *ToggleForumTopicIsClosedRequest) (*Ok, error) {
result, err := client.Send(Request{
meta: meta{
Type: "toggleForumTopicIsClosed",
},
Data: map[string]interface{}{
"chat_id": req.ChatId,
"message_thread_id": req.MessageThreadId,
"is_closed": req.IsClosed,
},
})
if err != nil {
return nil, err
}
if result.Type == "error" {
return nil, buildResponseError(result.Data)
}
return UnmarshalOk(result.Data)
}
type DeleteForumTopicRequest struct {
// Identifier of the chat
ChatId int64 `json:"chat_id"`
// Message thread identifier of the forum topic
MessageThreadId int64 `json:"message_thread_id"`
}
// Deletes all messages in a forum topic; requires can_delete_messages administrator rights in the supergroup unless the user is creator of the topic, the topic has no messages from other users and has at most 11 messages
func (client *Client) DeleteForumTopic(req *DeleteForumTopicRequest) (*Ok, error) {
result, err := client.Send(Request{
meta: meta{
Type: "deleteForumTopic",
},
Data: map[string]interface{}{
"chat_id": req.ChatId,
"message_thread_id": req.MessageThreadId,
},
})
if err != nil {
return nil, err
}
if result.Type == "error" {
return nil, buildResponseError(result.Data)
}
return UnmarshalOk(result.Data)
}
type GetEmojiReactionRequest struct { type GetEmojiReactionRequest struct {
// Text representation of the reaction // Text representation of the reaction
Emoji string `json:"emoji"` Emoji string `json:"emoji"`
@ -3719,8 +3904,8 @@ func (client *Client) GetEmojiReaction(req *GetEmojiReactionRequest) (*EmojiReac
return UnmarshalEmojiReaction(result.Data) return UnmarshalEmojiReaction(result.Data)
} }
// Returns TGS files with generic animations for custom emoji reactions // Returns TGS stickers with generic animations for custom emoji reactions
func (client *Client) GetCustomEmojiReactionAnimations() (*Files, error) { func (client *Client) GetCustomEmojiReactionAnimations() (*Stickers, error) {
result, err := client.Send(Request{ result, err := client.Send(Request{
meta: meta{ meta: meta{
Type: "getCustomEmojiReactionAnimations", Type: "getCustomEmojiReactionAnimations",
@ -3735,7 +3920,7 @@ func (client *Client) GetCustomEmojiReactionAnimations() (*Files, error) {
return nil, buildResponseError(result.Data) return nil, buildResponseError(result.Data)
} }
return UnmarshalFiles(result.Data) return UnmarshalStickers(result.Data)
} }
type GetMessageAvailableReactionsRequest struct { type GetMessageAvailableReactionsRequest struct {
@ -3928,7 +4113,7 @@ type GetTextEntitiesRequest struct {
Text string `json:"text"` Text string `json:"text"`
} }
// Returns all entities (mentions, hashtags, cashtags, bot commands, bank card numbers, URLs, and email addresses) contained in the text. Can be called synchronously // Returns all entities (mentions, hashtags, cashtags, bot commands, bank card numbers, URLs, and email addresses) found in the text. Can be called synchronously
func GetTextEntities(req *GetTextEntitiesRequest) (*TextEntities, error) { func GetTextEntities(req *GetTextEntitiesRequest) (*TextEntities, error) {
result, err := Execute(Request{ result, err := Execute(Request{
meta: meta{ meta: meta{
@ -3950,7 +4135,7 @@ func GetTextEntities(req *GetTextEntitiesRequest) (*TextEntities, error) {
} }
// deprecated // deprecated
// Returns all entities (mentions, hashtags, cashtags, bot commands, bank card numbers, URLs, and email addresses) contained in the text. Can be called synchronously // Returns all entities (mentions, hashtags, cashtags, bot commands, bank card numbers, URLs, and email addresses) found in the text. Can be called synchronously
func (client *Client) GetTextEntities(req *GetTextEntitiesRequest) (*TextEntities, error) { func (client *Client) GetTextEntities(req *GetTextEntitiesRequest) (*TextEntities, error) {
return GetTextEntities(req)} return GetTextEntities(req)}
@ -3961,7 +4146,7 @@ type ParseTextEntitiesRequest struct {
ParseMode TextParseMode `json:"parse_mode"` ParseMode TextParseMode `json:"parse_mode"`
} }
// Parses Bold, Italic, Underline, Strikethrough, Spoiler, CustomEmoji, Code, Pre, PreCode, TextUrl and MentionName entities contained in the text. Can be called synchronously // Parses Bold, Italic, Underline, Strikethrough, Spoiler, CustomEmoji, Code, Pre, PreCode, TextUrl and MentionName entities from a marked-up text. Can be called synchronously
func ParseTextEntities(req *ParseTextEntitiesRequest) (*FormattedText, error) { func ParseTextEntities(req *ParseTextEntitiesRequest) (*FormattedText, error) {
result, err := Execute(Request{ result, err := Execute(Request{
meta: meta{ meta: meta{
@ -3984,7 +4169,7 @@ func ParseTextEntities(req *ParseTextEntitiesRequest) (*FormattedText, error) {
} }
// deprecated // deprecated
// Parses Bold, Italic, Underline, Strikethrough, Spoiler, CustomEmoji, Code, Pre, PreCode, TextUrl and MentionName entities contained in the text. Can be called synchronously // Parses Bold, Italic, Underline, Strikethrough, Spoiler, CustomEmoji, Code, Pre, PreCode, TextUrl and MentionName entities from a marked-up text. Can be called synchronously
func (client *Client) ParseTextEntities(req *ParseTextEntitiesRequest) (*FormattedText, error) { func (client *Client) ParseTextEntities(req *ParseTextEntitiesRequest) (*FormattedText, error) {
return ParseTextEntities(req)} return ParseTextEntities(req)}
@ -4673,6 +4858,8 @@ type OpenWebAppRequest struct {
Theme *ThemeParameters `json:"theme"` Theme *ThemeParameters `json:"theme"`
// Short name of the application; 0-64 English letters, digits, and underscores // Short name of the application; 0-64 English letters, digits, and underscores
ApplicationName string `json:"application_name"` ApplicationName string `json:"application_name"`
// If not 0, a message thread identifier in which the message will be sent
MessageThreadId int64 `json:"message_thread_id"`
// Identifier of the replied message for the message sent by the Web App; 0 if none // Identifier of the replied message for the message sent by the Web App; 0 if none
ReplyToMessageId int64 `json:"reply_to_message_id"` ReplyToMessageId int64 `json:"reply_to_message_id"`
} }
@ -4689,6 +4876,7 @@ func (client *Client) OpenWebApp(req *OpenWebAppRequest) (*WebAppInfo, error) {
"url": req.Url, "url": req.Url,
"theme": req.Theme, "theme": req.Theme,
"application_name": req.ApplicationName, "application_name": req.ApplicationName,
"message_thread_id": req.MessageThreadId,
"reply_to_message_id": req.ReplyToMessageId, "reply_to_message_id": req.ReplyToMessageId,
}, },
}) })
@ -5453,12 +5641,41 @@ func (client *Client) ReadAllChatMentions(req *ReadAllChatMentionsRequest) (*Ok,
return UnmarshalOk(result.Data) return UnmarshalOk(result.Data)
} }
type ReadAllMessageThreadMentionsRequest struct {
// Chat identifier
ChatId int64 `json:"chat_id"`
// Message thread identifier in which mentions are marked as read
MessageThreadId int64 `json:"message_thread_id"`
}
// Marks all mentions in a forum topic as read
func (client *Client) ReadAllMessageThreadMentions(req *ReadAllMessageThreadMentionsRequest) (*Ok, error) {
result, err := client.Send(Request{
meta: meta{
Type: "readAllMessageThreadMentions",
},
Data: map[string]interface{}{
"chat_id": req.ChatId,
"message_thread_id": req.MessageThreadId,
},
})
if err != nil {
return nil, err
}
if result.Type == "error" {
return nil, buildResponseError(result.Data)
}
return UnmarshalOk(result.Data)
}
type ReadAllChatReactionsRequest struct { type ReadAllChatReactionsRequest struct {
// Chat identifier // Chat identifier
ChatId int64 `json:"chat_id"` ChatId int64 `json:"chat_id"`
} }
// Marks all reactions in a chat as read // Marks all reactions in a chat or a forum topic as read
func (client *Client) ReadAllChatReactions(req *ReadAllChatReactionsRequest) (*Ok, error) { func (client *Client) ReadAllChatReactions(req *ReadAllChatReactionsRequest) (*Ok, error) {
result, err := client.Send(Request{ result, err := client.Send(Request{
meta: meta{ meta: meta{
@ -5479,6 +5696,35 @@ func (client *Client) ReadAllChatReactions(req *ReadAllChatReactionsRequest) (*O
return UnmarshalOk(result.Data) return UnmarshalOk(result.Data)
} }
type ReadAllMessageThreadReactionsRequest struct {
// Chat identifier
ChatId int64 `json:"chat_id"`
// Message thread identifier in which reactions are marked as read
MessageThreadId int64 `json:"message_thread_id"`
}
// Marks all reactions in a forum topic as read
func (client *Client) ReadAllMessageThreadReactions(req *ReadAllMessageThreadReactionsRequest) (*Ok, error) {
result, err := client.Send(Request{
meta: meta{
Type: "readAllMessageThreadReactions",
},
Data: map[string]interface{}{
"chat_id": req.ChatId,
"message_thread_id": req.MessageThreadId,
},
})
if err != nil {
return nil, err
}
if result.Type == "error" {
return nil, buildResponseError(result.Data)
}
return UnmarshalOk(result.Data)
}
type CreatePrivateChatRequest struct { type CreatePrivateChatRequest struct {
// User identifier // User identifier
UserId int64 `json:"user_id"` UserId int64 `json:"user_id"`
@ -6509,6 +6755,35 @@ func (client *Client) UnpinAllChatMessages(req *UnpinAllChatMessagesRequest) (*O
return UnmarshalOk(result.Data) return UnmarshalOk(result.Data)
} }
type UnpinAllMessageThreadMessagesRequest struct {
// Identifier of the chat
ChatId int64 `json:"chat_id"`
// Message thread identifier in which messages will be unpinned
MessageThreadId int64 `json:"message_thread_id"`
}
// Removes all pinned messages from a forum topic; requires can_pin_messages rights in the supergroup
func (client *Client) UnpinAllMessageThreadMessages(req *UnpinAllMessageThreadMessagesRequest) (*Ok, error) {
result, err := client.Send(Request{
meta: meta{
Type: "unpinAllMessageThreadMessages",
},
Data: map[string]interface{}{
"chat_id": req.ChatId,
"message_thread_id": req.MessageThreadId,
},
})
if err != nil {
return nil, err
}
if result.Type == "error" {
return nil, buildResponseError(result.Data)
}
return UnmarshalOk(result.Data)
}
type JoinChatRequest struct { type JoinChatRequest struct {
// Chat identifier // Chat identifier
ChatId int64 `json:"chat_id"` ChatId int64 `json:"chat_id"`
@ -6795,7 +7070,7 @@ type SearchChatMembersRequest struct {
Filter ChatMembersFilter `json:"filter"` Filter ChatMembersFilter `json:"filter"`
} }
// Searches for a specified query in the first name, last name and username of the members of a specified chat. Requires administrator rights in channels // Searches for a specified query in the first name, last name and usernames of the members of a specified chat. Requires administrator rights in channels
func (client *Client) SearchChatMembers(req *SearchChatMembersRequest) (*ChatMembers, error) { func (client *Client) SearchChatMembers(req *SearchChatMembersRequest) (*ChatMembers, error) {
result, err := client.Send(Request{ result, err := client.Send(Request{
meta: meta{ meta: meta{
@ -9839,17 +10114,17 @@ func (client *Client) GetUserProfilePhotos(req *GetUserProfilePhotosRequest) (*C
} }
type GetStickersRequest struct { type GetStickersRequest struct {
// Type of the sticker sets to return // Type of the stickers to return
StickerType StickerType `json:"sticker_type"` StickerType StickerType `json:"sticker_type"`
// String representation of emoji. If empty, returns all known installed stickers // Search query; an emoji or a keyword prefix. If empty, returns all known installed stickers
Emoji string `json:"emoji"` Query string `json:"query"`
// The maximum number of stickers to be returned // The maximum number of stickers to be returned
Limit int32 `json:"limit"` Limit int32 `json:"limit"`
// Chat identifier for which to return stickers. Available custom emoji may be different for different chats // Chat identifier for which to return stickers. Available custom emoji stickers may be different for different chats
ChatId int64 `json:"chat_id"` ChatId int64 `json:"chat_id"`
} }
// Returns stickers from the installed sticker sets that correspond to a given emoji. If the emoji is non-empty, then favorite, recently used or trending stickers may also be returned // Returns stickers from the installed sticker sets that correspond to a given emoji or can be found by sticker-specific keywords. If the query is non-empty, then favorite, recently used or trending stickers may also be returned
func (client *Client) GetStickers(req *GetStickersRequest) (*Stickers, error) { func (client *Client) GetStickers(req *GetStickersRequest) (*Stickers, error) {
result, err := client.Send(Request{ result, err := client.Send(Request{
meta: meta{ meta: meta{
@ -9857,7 +10132,7 @@ func (client *Client) GetStickers(req *GetStickersRequest) (*Stickers, error) {
}, },
Data: map[string]interface{}{ Data: map[string]interface{}{
"sticker_type": req.StickerType, "sticker_type": req.StickerType,
"emoji": req.Emoji, "query": req.Query,
"limit": req.Limit, "limit": req.Limit,
"chat_id": req.ChatId, "chat_id": req.ChatId,
}, },
@ -10866,11 +11141,11 @@ func (client *Client) SetBio(req *SetBioRequest) (*Ok, error) {
} }
type SetUsernameRequest struct { type SetUsernameRequest struct {
// The new value of the username. Use an empty string to remove the username // The new value of the username. Use an empty string to remove the username. The username can't be completely removed if there is another active or disabled username
Username string `json:"username"` Username string `json:"username"`
} }
// Changes the username of the current user // Changes the editable username of the current user
func (client *Client) SetUsername(req *SetUsernameRequest) (*Ok, error) { func (client *Client) SetUsername(req *SetUsernameRequest) (*Ok, error) {
result, err := client.Send(Request{ result, err := client.Send(Request{
meta: meta{ meta: meta{
@ -10891,6 +11166,61 @@ func (client *Client) SetUsername(req *SetUsernameRequest) (*Ok, error) {
return UnmarshalOk(result.Data) return UnmarshalOk(result.Data)
} }
type ToggleUsernameIsActiveRequest struct {
// The username to change
Username string `json:"username"`
// Pass true to activate the username; pass false to disable it
IsActive bool `json:"is_active"`
}
// Changes active state for a username of the current user. The editable username can't be disabled. May return an error with a message "USERNAMES_ACTIVE_TOO_MUCH" if the maximum number of active usernames has been reached
func (client *Client) ToggleUsernameIsActive(req *ToggleUsernameIsActiveRequest) (*Ok, error) {
result, err := client.Send(Request{
meta: meta{
Type: "toggleUsernameIsActive",
},
Data: map[string]interface{}{
"username": req.Username,
"is_active": req.IsActive,
},
})
if err != nil {
return nil, err
}
if result.Type == "error" {
return nil, buildResponseError(result.Data)
}
return UnmarshalOk(result.Data)
}
type ReorderActiveUsernamesRequest struct {
// The new order of active usernames. All currently active usernames must be specified
Usernames []string `json:"usernames"`
}
// Changes order of active usernames of the current user
func (client *Client) ReorderActiveUsernames(req *ReorderActiveUsernamesRequest) (*Ok, error) {
result, err := client.Send(Request{
meta: meta{
Type: "reorderActiveUsernames",
},
Data: map[string]interface{}{
"usernames": req.Usernames,
},
})
if err != nil {
return nil, err
}
if result.Type == "error" {
return nil, buildResponseError(result.Data)
}
return UnmarshalOk(result.Data)
}
type SetEmojiStatusRequest struct { type SetEmojiStatusRequest struct {
// New emoji status; pass null to switch to the default badge // New emoji status; pass null to switch to the default badge
EmojiStatus *EmojiStatus `json:"emoji_status"` EmojiStatus *EmojiStatus `json:"emoji_status"`
@ -11432,11 +11762,11 @@ func (client *Client) DisconnectAllWebsites() (*Ok, error) {
type SetSupergroupUsernameRequest struct { type SetSupergroupUsernameRequest struct {
// Identifier of the supergroup or channel // Identifier of the supergroup or channel
SupergroupId int64 `json:"supergroup_id"` SupergroupId int64 `json:"supergroup_id"`
// New value of the username. Use an empty string to remove the username // New value of the username. Use an empty string to remove the username. The username can't be completely removed if there is another active or disabled username
Username string `json:"username"` Username string `json:"username"`
} }
// Changes the username of a supergroup or channel, requires owner privileges in the supergroup or channel // Changes the editable username of a supergroup or channel, requires owner privileges in the supergroup or channel
func (client *Client) SetSupergroupUsername(req *SetSupergroupUsernameRequest) (*Ok, error) { func (client *Client) SetSupergroupUsername(req *SetSupergroupUsernameRequest) (*Ok, error) {
result, err := client.Send(Request{ result, err := client.Send(Request{
meta: meta{ meta: meta{
@ -11458,6 +11788,93 @@ func (client *Client) SetSupergroupUsername(req *SetSupergroupUsernameRequest) (
return UnmarshalOk(result.Data) return UnmarshalOk(result.Data)
} }
type ToggleSupergroupUsernameIsActiveRequest struct {
// Identifier of the supergroup or channel
SupergroupId int64 `json:"supergroup_id"`
// The username to change
Username string `json:"username"`
// Pass true to activate the username; pass false to disable it
IsActive bool `json:"is_active"`
}
// Changes active state for a username of a supergroup or channel, requires owner privileges in the supergroup or channel. The editable username can't be disabled. May return an error with a message "USERNAMES_ACTIVE_TOO_MUCH" if the maximum number of active usernames has been reached
func (client *Client) ToggleSupergroupUsernameIsActive(req *ToggleSupergroupUsernameIsActiveRequest) (*Ok, error) {
result, err := client.Send(Request{
meta: meta{
Type: "toggleSupergroupUsernameIsActive",
},
Data: map[string]interface{}{
"supergroup_id": req.SupergroupId,
"username": req.Username,
"is_active": req.IsActive,
},
})
if err != nil {
return nil, err
}
if result.Type == "error" {
return nil, buildResponseError(result.Data)
}
return UnmarshalOk(result.Data)
}
type DisableAllSupergroupUsernamesRequest struct {
// Identifier of the supergroup or channel
SupergroupId int64 `json:"supergroup_id"`
}
// Disables all active non-editable usernames of a supergroup or channel, requires owner privileges in the supergroup or channel
func (client *Client) DisableAllSupergroupUsernames(req *DisableAllSupergroupUsernamesRequest) (*Ok, error) {
result, err := client.Send(Request{
meta: meta{
Type: "disableAllSupergroupUsernames",
},
Data: map[string]interface{}{
"supergroup_id": req.SupergroupId,
},
})
if err != nil {
return nil, err
}
if result.Type == "error" {
return nil, buildResponseError(result.Data)
}
return UnmarshalOk(result.Data)
}
type ReorderSupergroupActiveUsernamesRequest struct {
// Identifier of the supergroup or channel
SupergroupId int64 `json:"supergroup_id"`
// The new order of active usernames. All currently active usernames must be specified
Usernames []string `json:"usernames"`
}
// Changes order of active usernames of a supergroup or channel, requires owner privileges in the supergroup or channel
func (client *Client) ReorderSupergroupActiveUsernames(req *ReorderSupergroupActiveUsernamesRequest) (*Ok, error) {
result, err := client.Send(Request{
meta: meta{
Type: "reorderSupergroupActiveUsernames",
},
Data: map[string]interface{}{
"supergroup_id": req.SupergroupId,
"usernames": req.Usernames,
},
})
if err != nil {
return nil, err
}
if result.Type == "error" {
return nil, buildResponseError(result.Data)
}
return UnmarshalOk(result.Data)
}
type SetSupergroupStickerSetRequest struct { type SetSupergroupStickerSetRequest struct {
// Identifier of the supergroup // Identifier of the supergroup
SupergroupId int64 `json:"supergroup_id"` SupergroupId int64 `json:"supergroup_id"`
@ -11603,6 +12020,35 @@ func (client *Client) ToggleSupergroupIsAllHistoryAvailable(req *ToggleSupergrou
return UnmarshalOk(result.Data) return UnmarshalOk(result.Data)
} }
type ToggleSupergroupIsForumRequest struct {
// Identifier of the supergroup
SupergroupId int64 `json:"supergroup_id"`
// New value of is_forum. A supergroup can be converted to a forum, only if it has at least GetOption("forum_member_count_min") members
IsForum bool `json:"is_forum"`
}
// Toggles whether the supergroup is a forum; requires owner privileges in the supergroup
func (client *Client) ToggleSupergroupIsForum(req *ToggleSupergroupIsForumRequest) (*Ok, error) {
result, err := client.Send(Request{
meta: meta{
Type: "toggleSupergroupIsForum",
},
Data: map[string]interface{}{
"supergroup_id": req.SupergroupId,
"is_forum": req.IsForum,
},
})
if err != nil {
return nil, err
}
if result.Type == "error" {
return nil, buildResponseError(result.Data)
}
return UnmarshalOk(result.Data)
}
type ToggleSupergroupIsBroadcastGroupRequest struct { type ToggleSupergroupIsBroadcastGroupRequest struct {
// Identifier of the supergroup // Identifier of the supergroup
SupergroupId int64 `json:"supergroup_id"` SupergroupId int64 `json:"supergroup_id"`
@ -15603,6 +16049,9 @@ func (client *Client) TestUseUpdate() (Update, error) {
case TypeUpdateChatOnlineMemberCount: case TypeUpdateChatOnlineMemberCount:
return UnmarshalUpdateChatOnlineMemberCount(result.Data) return UnmarshalUpdateChatOnlineMemberCount(result.Data)
case TypeUpdateForumTopicInfo:
return UnmarshalUpdateForumTopicInfo(result.Data)
case TypeUpdateScopeNotificationSettings: case TypeUpdateScopeNotificationSettings:
return UnmarshalUpdateScopeNotificationSettings(result.Data) return UnmarshalUpdateScopeNotificationSettings(result.Data)

File diff suppressed because it is too large Load diff

View file

@ -1610,6 +1610,46 @@ func UnmarshalListOfInputInvoice(dataList []json.RawMessage) ([]InputInvoice, er
return list, nil return list, nil
} }
func UnmarshalMessageExtendedMedia(data json.RawMessage) (MessageExtendedMedia, error) {
var meta meta
err := json.Unmarshal(data, &meta)
if err != nil {
return nil, err
}
switch meta.Type {
case TypeMessageExtendedMediaPreview:
return UnmarshalMessageExtendedMediaPreview(data)
case TypeMessageExtendedMediaPhoto:
return UnmarshalMessageExtendedMediaPhoto(data)
case TypeMessageExtendedMediaVideo:
return UnmarshalMessageExtendedMediaVideo(data)
case TypeMessageExtendedMediaUnsupported:
return UnmarshalMessageExtendedMediaUnsupported(data)
default:
return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type)
}
}
func UnmarshalListOfMessageExtendedMedia(dataList []json.RawMessage) ([]MessageExtendedMedia, error) {
list := []MessageExtendedMedia{}
for _, data := range dataList {
entity, err := UnmarshalMessageExtendedMedia(data)
if err != nil {
return nil, err
}
list = append(list, entity)
}
return list, nil
}
func UnmarshalPassportElementType(data json.RawMessage) (PassportElementType, error) { func UnmarshalPassportElementType(data json.RawMessage) (PassportElementType, error) {
var meta meta var meta meta
@ -2047,6 +2087,15 @@ func UnmarshalMessageContent(data json.RawMessage) (MessageContent, error) {
case TypeMessageChatSetTtl: case TypeMessageChatSetTtl:
return UnmarshalMessageChatSetTtl(data) return UnmarshalMessageChatSetTtl(data)
case TypeMessageForumTopicCreated:
return UnmarshalMessageForumTopicCreated(data)
case TypeMessageForumTopicEdited:
return UnmarshalMessageForumTopicEdited(data)
case TypeMessageForumTopicIsClosedToggled:
return UnmarshalMessageForumTopicIsClosedToggled(data)
case TypeMessageCustomServiceAction: case TypeMessageCustomServiceAction:
return UnmarshalMessageCustomServiceAction(data) return UnmarshalMessageCustomServiceAction(data)
@ -3033,6 +3082,9 @@ func UnmarshalChatEventAction(data json.RawMessage) (ChatEventAction, error) {
case TypeChatEventUsernameChanged: case TypeChatEventUsernameChanged:
return UnmarshalChatEventUsernameChanged(data) return UnmarshalChatEventUsernameChanged(data)
case TypeChatEventActiveUsernamesChanged:
return UnmarshalChatEventActiveUsernamesChanged(data)
case TypeChatEventHasProtectedContentToggled: case TypeChatEventHasProtectedContentToggled:
return UnmarshalChatEventHasProtectedContentToggled(data) return UnmarshalChatEventHasProtectedContentToggled(data)
@ -3069,6 +3121,24 @@ func UnmarshalChatEventAction(data json.RawMessage) (ChatEventAction, error) {
case TypeChatEventVideoChatParticipantVolumeLevelChanged: case TypeChatEventVideoChatParticipantVolumeLevelChanged:
return UnmarshalChatEventVideoChatParticipantVolumeLevelChanged(data) return UnmarshalChatEventVideoChatParticipantVolumeLevelChanged(data)
case TypeChatEventIsForumToggled:
return UnmarshalChatEventIsForumToggled(data)
case TypeChatEventForumTopicCreated:
return UnmarshalChatEventForumTopicCreated(data)
case TypeChatEventForumTopicEdited:
return UnmarshalChatEventForumTopicEdited(data)
case TypeChatEventForumTopicToggleIsClosed:
return UnmarshalChatEventForumTopicToggleIsClosed(data)
case TypeChatEventForumTopicDeleted:
return UnmarshalChatEventForumTopicDeleted(data)
case TypeChatEventForumTopicPinned:
return UnmarshalChatEventForumTopicPinned(data)
default: default:
return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type)
} }
@ -3228,6 +3298,9 @@ func UnmarshalPremiumFeature(data json.RawMessage) (PremiumFeature, error) {
case TypePremiumFeatureAnimatedProfilePhoto: case TypePremiumFeatureAnimatedProfilePhoto:
return UnmarshalPremiumFeatureAnimatedProfilePhoto(data) return UnmarshalPremiumFeatureAnimatedProfilePhoto(data)
case TypePremiumFeatureForumTopicIcon:
return UnmarshalPremiumFeatureForumTopicIcon(data)
case TypePremiumFeatureAppIcons: case TypePremiumFeatureAppIcons:
return UnmarshalPremiumFeatureAppIcons(data) return UnmarshalPremiumFeatureAppIcons(data)
@ -5064,6 +5137,9 @@ func UnmarshalUpdate(data json.RawMessage) (Update, error) {
case TypeUpdateChatOnlineMemberCount: case TypeUpdateChatOnlineMemberCount:
return UnmarshalUpdateChatOnlineMemberCount(data) return UnmarshalUpdateChatOnlineMemberCount(data)
case TypeUpdateForumTopicInfo:
return UnmarshalUpdateForumTopicInfo(data)
case TypeUpdateScopeNotificationSettings: case TypeUpdateScopeNotificationSettings:
return UnmarshalUpdateScopeNotificationSettings(data) return UnmarshalUpdateScopeNotificationSettings(data)
@ -5584,14 +5660,6 @@ func UnmarshalFile(data json.RawMessage) (*File, error) {
return &resp, err return &resp, err
} }
func UnmarshalFiles(data json.RawMessage) (*Files, error) {
var resp Files
err := json.Unmarshal(data, &resp)
return &resp, err
}
func UnmarshalInputFileId(data json.RawMessage) (*InputFileId, error) { func UnmarshalInputFileId(data json.RawMessage) (*InputFileId, error) {
var resp InputFileId var resp InputFileId
@ -6104,6 +6172,14 @@ func UnmarshalEmojiStatuses(data json.RawMessage) (*EmojiStatuses, error) {
return &resp, err return &resp, err
} }
func UnmarshalUsernames(data json.RawMessage) (*Usernames, error) {
var resp Usernames
err := json.Unmarshal(data, &resp)
return &resp, err
}
func UnmarshalUser(data json.RawMessage) (*User, error) { func UnmarshalUser(data json.RawMessage) (*User, error) {
var resp User var resp User
@ -6504,6 +6580,22 @@ func UnmarshalMessageSenders(data json.RawMessage) (*MessageSenders, error) {
return &resp, err return &resp, err
} }
func UnmarshalChatMessageSender(data json.RawMessage) (*ChatMessageSender, error) {
var resp ChatMessageSender
err := json.Unmarshal(data, &resp)
return &resp, err
}
func UnmarshalChatMessageSenders(data json.RawMessage) (*ChatMessageSenders, error) {
var resp ChatMessageSenders
err := json.Unmarshal(data, &resp)
return &resp, err
}
func UnmarshalMessageForwardOriginUser(data json.RawMessage) (*MessageForwardOriginUser, error) { func UnmarshalMessageForwardOriginUser(data json.RawMessage) (*MessageForwardOriginUser, error) {
var resp MessageForwardOriginUser var resp MessageForwardOriginUser
@ -6680,6 +6772,14 @@ func UnmarshalSponsoredMessage(data json.RawMessage) (*SponsoredMessage, error)
return &resp, err return &resp, err
} }
func UnmarshalSponsoredMessages(data json.RawMessage) (*SponsoredMessages, error) {
var resp SponsoredMessages
err := json.Unmarshal(data, &resp)
return &resp, err
}
func UnmarshalFileDownload(data json.RawMessage) (*FileDownload, error) { func UnmarshalFileDownload(data json.RawMessage) (*FileDownload, error) {
var resp FileDownload var resp FileDownload
@ -7192,6 +7292,30 @@ func UnmarshalMessageThreadInfo(data json.RawMessage) (*MessageThreadInfo, error
return &resp, err return &resp, err
} }
func UnmarshalForumTopicIcon(data json.RawMessage) (*ForumTopicIcon, error) {
var resp ForumTopicIcon
err := json.Unmarshal(data, &resp)
return &resp, err
}
func UnmarshalForumTopicInfo(data json.RawMessage) (*ForumTopicInfo, error) {
var resp ForumTopicInfo
err := json.Unmarshal(data, &resp)
return &resp, err
}
func UnmarshalForumTopic(data json.RawMessage) (*ForumTopic, error) {
var resp ForumTopic
err := json.Unmarshal(data, &resp)
return &resp, err
}
func UnmarshalRichTextPlain(data json.RawMessage) (*RichTextPlain, error) { func UnmarshalRichTextPlain(data json.RawMessage) (*RichTextPlain, error) {
var resp RichTextPlain var resp RichTextPlain
@ -7864,6 +7988,38 @@ func UnmarshalInputInvoiceName(data json.RawMessage) (*InputInvoiceName, error)
return &resp, err return &resp, err
} }
func UnmarshalMessageExtendedMediaPreview(data json.RawMessage) (*MessageExtendedMediaPreview, error) {
var resp MessageExtendedMediaPreview
err := json.Unmarshal(data, &resp)
return &resp, err
}
func UnmarshalMessageExtendedMediaPhoto(data json.RawMessage) (*MessageExtendedMediaPhoto, error) {
var resp MessageExtendedMediaPhoto
err := json.Unmarshal(data, &resp)
return &resp, err
}
func UnmarshalMessageExtendedMediaVideo(data json.RawMessage) (*MessageExtendedMediaVideo, error) {
var resp MessageExtendedMediaVideo
err := json.Unmarshal(data, &resp)
return &resp, err
}
func UnmarshalMessageExtendedMediaUnsupported(data json.RawMessage) (*MessageExtendedMediaUnsupported, error) {
var resp MessageExtendedMediaUnsupported
err := json.Unmarshal(data, &resp)
return &resp, err
}
func UnmarshalDatedFile(data json.RawMessage) (*DatedFile, error) { func UnmarshalDatedFile(data json.RawMessage) (*DatedFile, error) {
var resp DatedFile var resp DatedFile
@ -8760,6 +8916,30 @@ func UnmarshalMessageChatSetTtl(data json.RawMessage) (*MessageChatSetTtl, error
return &resp, err return &resp, err
} }
func UnmarshalMessageForumTopicCreated(data json.RawMessage) (*MessageForumTopicCreated, error) {
var resp MessageForumTopicCreated
err := json.Unmarshal(data, &resp)
return &resp, err
}
func UnmarshalMessageForumTopicEdited(data json.RawMessage) (*MessageForumTopicEdited, error) {
var resp MessageForumTopicEdited
err := json.Unmarshal(data, &resp)
return &resp, err
}
func UnmarshalMessageForumTopicIsClosedToggled(data json.RawMessage) (*MessageForumTopicIsClosedToggled, error) {
var resp MessageForumTopicIsClosedToggled
err := json.Unmarshal(data, &resp)
return &resp, err
}
func UnmarshalMessageCustomServiceAction(data json.RawMessage) (*MessageCustomServiceAction, error) { func UnmarshalMessageCustomServiceAction(data json.RawMessage) (*MessageCustomServiceAction, error) {
var resp MessageCustomServiceAction var resp MessageCustomServiceAction
@ -10432,6 +10612,14 @@ func UnmarshalChatEventUsernameChanged(data json.RawMessage) (*ChatEventUsername
return &resp, err return &resp, err
} }
func UnmarshalChatEventActiveUsernamesChanged(data json.RawMessage) (*ChatEventActiveUsernamesChanged, error) {
var resp ChatEventActiveUsernamesChanged
err := json.Unmarshal(data, &resp)
return &resp, err
}
func UnmarshalChatEventHasProtectedContentToggled(data json.RawMessage) (*ChatEventHasProtectedContentToggled, error) { func UnmarshalChatEventHasProtectedContentToggled(data json.RawMessage) (*ChatEventHasProtectedContentToggled, error) {
var resp ChatEventHasProtectedContentToggled var resp ChatEventHasProtectedContentToggled
@ -10528,6 +10716,54 @@ func UnmarshalChatEventVideoChatParticipantVolumeLevelChanged(data json.RawMessa
return &resp, err return &resp, err
} }
func UnmarshalChatEventIsForumToggled(data json.RawMessage) (*ChatEventIsForumToggled, error) {
var resp ChatEventIsForumToggled
err := json.Unmarshal(data, &resp)
return &resp, err
}
func UnmarshalChatEventForumTopicCreated(data json.RawMessage) (*ChatEventForumTopicCreated, error) {
var resp ChatEventForumTopicCreated
err := json.Unmarshal(data, &resp)
return &resp, err
}
func UnmarshalChatEventForumTopicEdited(data json.RawMessage) (*ChatEventForumTopicEdited, error) {
var resp ChatEventForumTopicEdited
err := json.Unmarshal(data, &resp)
return &resp, err
}
func UnmarshalChatEventForumTopicToggleIsClosed(data json.RawMessage) (*ChatEventForumTopicToggleIsClosed, error) {
var resp ChatEventForumTopicToggleIsClosed
err := json.Unmarshal(data, &resp)
return &resp, err
}
func UnmarshalChatEventForumTopicDeleted(data json.RawMessage) (*ChatEventForumTopicDeleted, error) {
var resp ChatEventForumTopicDeleted
err := json.Unmarshal(data, &resp)
return &resp, err
}
func UnmarshalChatEventForumTopicPinned(data json.RawMessage) (*ChatEventForumTopicPinned, error) {
var resp ChatEventForumTopicPinned
err := json.Unmarshal(data, &resp)
return &resp, err
}
func UnmarshalChatEvent(data json.RawMessage) (*ChatEvent, error) { func UnmarshalChatEvent(data json.RawMessage) (*ChatEvent, error) {
var resp ChatEvent var resp ChatEvent
@ -10784,6 +11020,14 @@ func UnmarshalPremiumFeatureAnimatedProfilePhoto(data json.RawMessage) (*Premium
return &resp, err return &resp, err
} }
func UnmarshalPremiumFeatureForumTopicIcon(data json.RawMessage) (*PremiumFeatureForumTopicIcon, error) {
var resp PremiumFeatureForumTopicIcon
err := json.Unmarshal(data, &resp)
return &resp, err
}
func UnmarshalPremiumFeatureAppIcons(data json.RawMessage) (*PremiumFeatureAppIcons, error) { func UnmarshalPremiumFeatureAppIcons(data json.RawMessage) (*PremiumFeatureAppIcons, error) {
var resp PremiumFeatureAppIcons var resp PremiumFeatureAppIcons
@ -13392,6 +13636,14 @@ func UnmarshalUpdateChatOnlineMemberCount(data json.RawMessage) (*UpdateChatOnli
return &resp, err return &resp, err
} }
func UnmarshalUpdateForumTopicInfo(data json.RawMessage) (*UpdateForumTopicInfo, error) {
var resp UpdateForumTopicInfo
err := json.Unmarshal(data, &resp)
return &resp, err
}
func UnmarshalUpdateScopeNotificationSettings(data json.RawMessage) (*UpdateScopeNotificationSettings, error) { func UnmarshalUpdateScopeNotificationSettings(data json.RawMessage) (*UpdateScopeNotificationSettings, error) {
var resp UpdateScopeNotificationSettings var resp UpdateScopeNotificationSettings
@ -14127,9 +14379,6 @@ func UnmarshalType(data json.RawMessage) (Type, error) {
case TypeFile: case TypeFile:
return UnmarshalFile(data) return UnmarshalFile(data)
case TypeFiles:
return UnmarshalFiles(data)
case TypeInputFileId: case TypeInputFileId:
return UnmarshalInputFileId(data) return UnmarshalInputFileId(data)
@ -14322,6 +14571,9 @@ func UnmarshalType(data json.RawMessage) (Type, error) {
case TypeEmojiStatuses: case TypeEmojiStatuses:
return UnmarshalEmojiStatuses(data) return UnmarshalEmojiStatuses(data)
case TypeUsernames:
return UnmarshalUsernames(data)
case TypeUser: case TypeUser:
return UnmarshalUser(data) return UnmarshalUser(data)
@ -14472,6 +14724,12 @@ func UnmarshalType(data json.RawMessage) (Type, error) {
case TypeMessageSenders: case TypeMessageSenders:
return UnmarshalMessageSenders(data) return UnmarshalMessageSenders(data)
case TypeChatMessageSender:
return UnmarshalChatMessageSender(data)
case TypeChatMessageSenders:
return UnmarshalChatMessageSenders(data)
case TypeMessageForwardOriginUser: case TypeMessageForwardOriginUser:
return UnmarshalMessageForwardOriginUser(data) return UnmarshalMessageForwardOriginUser(data)
@ -14538,6 +14796,9 @@ func UnmarshalType(data json.RawMessage) (Type, error) {
case TypeSponsoredMessage: case TypeSponsoredMessage:
return UnmarshalSponsoredMessage(data) return UnmarshalSponsoredMessage(data)
case TypeSponsoredMessages:
return UnmarshalSponsoredMessages(data)
case TypeFileDownload: case TypeFileDownload:
return UnmarshalFileDownload(data) return UnmarshalFileDownload(data)
@ -14730,6 +14991,15 @@ func UnmarshalType(data json.RawMessage) (Type, error) {
case TypeMessageThreadInfo: case TypeMessageThreadInfo:
return UnmarshalMessageThreadInfo(data) return UnmarshalMessageThreadInfo(data)
case TypeForumTopicIcon:
return UnmarshalForumTopicIcon(data)
case TypeForumTopicInfo:
return UnmarshalForumTopicInfo(data)
case TypeForumTopic:
return UnmarshalForumTopic(data)
case TypeRichTextPlain: case TypeRichTextPlain:
return UnmarshalRichTextPlain(data) return UnmarshalRichTextPlain(data)
@ -14982,6 +15252,18 @@ func UnmarshalType(data json.RawMessage) (Type, error) {
case TypeInputInvoiceName: case TypeInputInvoiceName:
return UnmarshalInputInvoiceName(data) return UnmarshalInputInvoiceName(data)
case TypeMessageExtendedMediaPreview:
return UnmarshalMessageExtendedMediaPreview(data)
case TypeMessageExtendedMediaPhoto:
return UnmarshalMessageExtendedMediaPhoto(data)
case TypeMessageExtendedMediaVideo:
return UnmarshalMessageExtendedMediaVideo(data)
case TypeMessageExtendedMediaUnsupported:
return UnmarshalMessageExtendedMediaUnsupported(data)
case TypeDatedFile: case TypeDatedFile:
return UnmarshalDatedFile(data) return UnmarshalDatedFile(data)
@ -15318,6 +15600,15 @@ func UnmarshalType(data json.RawMessage) (Type, error) {
case TypeMessageChatSetTtl: case TypeMessageChatSetTtl:
return UnmarshalMessageChatSetTtl(data) return UnmarshalMessageChatSetTtl(data)
case TypeMessageForumTopicCreated:
return UnmarshalMessageForumTopicCreated(data)
case TypeMessageForumTopicEdited:
return UnmarshalMessageForumTopicEdited(data)
case TypeMessageForumTopicIsClosedToggled:
return UnmarshalMessageForumTopicIsClosedToggled(data)
case TypeMessageCustomServiceAction: case TypeMessageCustomServiceAction:
return UnmarshalMessageCustomServiceAction(data) return UnmarshalMessageCustomServiceAction(data)
@ -15945,6 +16236,9 @@ func UnmarshalType(data json.RawMessage) (Type, error) {
case TypeChatEventUsernameChanged: case TypeChatEventUsernameChanged:
return UnmarshalChatEventUsernameChanged(data) return UnmarshalChatEventUsernameChanged(data)
case TypeChatEventActiveUsernamesChanged:
return UnmarshalChatEventActiveUsernamesChanged(data)
case TypeChatEventHasProtectedContentToggled: case TypeChatEventHasProtectedContentToggled:
return UnmarshalChatEventHasProtectedContentToggled(data) return UnmarshalChatEventHasProtectedContentToggled(data)
@ -15981,6 +16275,24 @@ func UnmarshalType(data json.RawMessage) (Type, error) {
case TypeChatEventVideoChatParticipantVolumeLevelChanged: case TypeChatEventVideoChatParticipantVolumeLevelChanged:
return UnmarshalChatEventVideoChatParticipantVolumeLevelChanged(data) return UnmarshalChatEventVideoChatParticipantVolumeLevelChanged(data)
case TypeChatEventIsForumToggled:
return UnmarshalChatEventIsForumToggled(data)
case TypeChatEventForumTopicCreated:
return UnmarshalChatEventForumTopicCreated(data)
case TypeChatEventForumTopicEdited:
return UnmarshalChatEventForumTopicEdited(data)
case TypeChatEventForumTopicToggleIsClosed:
return UnmarshalChatEventForumTopicToggleIsClosed(data)
case TypeChatEventForumTopicDeleted:
return UnmarshalChatEventForumTopicDeleted(data)
case TypeChatEventForumTopicPinned:
return UnmarshalChatEventForumTopicPinned(data)
case TypeChatEvent: case TypeChatEvent:
return UnmarshalChatEvent(data) return UnmarshalChatEvent(data)
@ -16077,6 +16389,9 @@ func UnmarshalType(data json.RawMessage) (Type, error) {
case TypePremiumFeatureAnimatedProfilePhoto: case TypePremiumFeatureAnimatedProfilePhoto:
return UnmarshalPremiumFeatureAnimatedProfilePhoto(data) return UnmarshalPremiumFeatureAnimatedProfilePhoto(data)
case TypePremiumFeatureForumTopicIcon:
return UnmarshalPremiumFeatureForumTopicIcon(data)
case TypePremiumFeatureAppIcons: case TypePremiumFeatureAppIcons:
return UnmarshalPremiumFeatureAppIcons(data) return UnmarshalPremiumFeatureAppIcons(data)
@ -17055,6 +17370,9 @@ func UnmarshalType(data json.RawMessage) (Type, error) {
case TypeUpdateChatOnlineMemberCount: case TypeUpdateChatOnlineMemberCount:
return UnmarshalUpdateChatOnlineMemberCount(data) return UnmarshalUpdateChatOnlineMemberCount(data)
case TypeUpdateForumTopicInfo:
return UnmarshalUpdateForumTopicInfo(data)
case TypeUpdateScopeNotificationSettings: case TypeUpdateScopeNotificationSettings:
return UnmarshalUpdateScopeNotificationSettings(data) return UnmarshalUpdateScopeNotificationSettings(data)

View file

@ -66,7 +66,7 @@ textEntity offset:int32 length:int32 type:TextEntityType = TextEntity;
textEntities entities:vector<textEntity> = TextEntities; textEntities entities:vector<textEntity> = TextEntities;
//@description A text with some entities @text The text @entities Entities contained in the text. Entities can be nested, but must not mutually intersect with each other. //@description A text with some entities @text The text @entities Entities contained in the text. Entities can be nested, but must not mutually intersect with each other.
//-Pre, Code and PreCode entities can't contain other entities. Bold, Italic, Underline, Strikethrough, and Spoiler entities can contain and to be contained in all other entities. All other entities can't contain each other //-Pre, Code and PreCode entities can't contain other entities. Bold, Italic, Underline, Strikethrough, and Spoiler entities can contain and can be part of any other entities. All other entities can't contain each other
formattedText text:string entities:vector<textEntity> = FormattedText; formattedText text:string entities:vector<textEntity> = FormattedText;
@ -157,16 +157,13 @@ remoteFile id:string unique_id:string is_uploading_active:Bool is_uploading_comp
//@description Represents a file //@description Represents a file
//@id Unique file identifier //@id Unique file identifier
//@dc_id File data center //@dc_id File data center
//@size File size, in bytes; 0 if unknown //@size File size, in bytes; 0 if unknown
//@expected_size Approximate file size in bytes in case the exact file size is unknown. Can be used to show download/upload progress //@expected_size Approximate file size in bytes in case the exact file size is unknown. Can be used to show download/upload progress
//@local Information about the local copy of the file //@local Information about the local copy of the file
//@remote Information about the remote copy of the file //@remote Information about the remote copy of the file
file id:int32 dc_id:int32 size:int53 expected_size:int53 local:localFile remote:remoteFile = File; file id:int32 dc_id:int32 size:int53 expected_size:int53 local:localFile remote:remoteFile = File;
//@description Represents a list of files @files List of files
files files:vector<file> = Files;
//@class InputFile @description Points to a file //@class InputFile @description Points to a file
@ -324,9 +321,9 @@ sticker set_id:int64 width:int32 height:int32 emoji:string format:StickerFormat
video duration:int32 width:int32 height:int32 file_name:string mime_type:string has_stickers:Bool supports_streaming:Bool minithumbnail:minithumbnail thumbnail:thumbnail video:file = Video; video duration:int32 width:int32 height:int32 file_name:string mime_type:string has_stickers:Bool supports_streaming:Bool minithumbnail:minithumbnail thumbnail:thumbnail video:file = Video;
//@description Describes a video note. The video must be equal in width and height, cropped to a circle, and stored in MPEG4 format @duration Duration of the video, in seconds; as defined by the sender //@description Describes a video note. The video must be equal in width and height, cropped to a circle, and stored in MPEG4 format @duration Duration of the video, in seconds; as defined by the sender
//@length Video width and height; as defined by the sender @minithumbnail Video minithumbnail; may be null //@waveform A waveform representation of the video note's audio in 5-bit format; may be empty if unknown @length Video width and height; as defined by the sender @minithumbnail Video minithumbnail; may be null
//@thumbnail Video thumbnail in JPEG format; as defined by the sender; may be null @video File containing the video //@thumbnail Video thumbnail in JPEG format; as defined by the sender; may be null @speech_recognition_result Result of speech recognition in the video note; may be null @video File containing the video
videoNote duration:int32 length:int32 minithumbnail:minithumbnail thumbnail:thumbnail video:file = VideoNote; videoNote duration:int32 waveform:bytes length:int32 minithumbnail:minithumbnail thumbnail:thumbnail speech_recognition_result:SpeechRecognitionResult video:file = VideoNote;
//@description Describes a voice note. The voice note must be encoded with the Opus codec, and stored inside an OGG container. Voice notes can have only a single audio channel //@description Describes a voice note. The voice note must be encoded with the Opus codec, and stored inside an OGG container. Voice notes can have only a single audio channel
//@duration Duration of the voice note, in seconds; as defined by the sender @waveform A waveform representation of the voice note in 5-bit format //@duration Duration of the voice note, in seconds; as defined by the sender @waveform A waveform representation of the voice note in 5-bit format
@ -335,9 +332,11 @@ voiceNote duration:int32 waveform:bytes mime_type:string speech_recognition_resu
//@description Describes an animated or custom representation of an emoji //@description Describes an animated or custom representation of an emoji
//@sticker Sticker for the emoji; may be null if yet unknown for a custom emoji. If the sticker is a custom emoji, it can have arbitrary format different from stickerFormatTgs //@sticker Sticker for the emoji; may be null if yet unknown for a custom emoji. If the sticker is a custom emoji, it can have arbitrary format different from stickerFormatTgs
//@sticker_width Expected width of the sticker, which can be used if the sticker is null
//@sticker_height Expected height of the sticker, which can be used if the sticker is null
//@fitzpatrick_type Emoji modifier fitzpatrick type; 0-6; 0 if none //@fitzpatrick_type Emoji modifier fitzpatrick type; 0-6; 0 if none
//@sound File containing the sound to be played when the sticker is clicked; may be null. The sound is encoded with the Opus codec, and stored inside an OGG container //@sound File containing the sound to be played when the sticker is clicked; may be null. The sound is encoded with the Opus codec, and stored inside an OGG container
animatedEmoji sticker:sticker fitzpatrick_type:int32 sound:file = AnimatedEmoji; animatedEmoji sticker:sticker sticker_width:int32 sticker_height:int32 fitzpatrick_type:int32 sound:file = AnimatedEmoji;
//@description Describes a user contact @phone_number Phone number of the user @first_name First name of the user; 1-255 characters in length @last_name Last name of the user @vcard Additional data about the user in a form of vCard; 0-2048 bytes in length @user_id Identifier of the user, if known; otherwise 0 //@description Describes a user contact @phone_number Phone number of the user @first_name First name of the user; 1-255 characters in length @last_name Last name of the user @vcard Additional data about the user in a form of vCard; 0-2048 bytes in length @user_id Identifier of the user, if known; otherwise 0
contact phone_number:string first_name:string last_name:string vcard:string user_id:int53 = Contact; contact phone_number:string first_name:string last_name:string vcard:string user_id:int53 = Contact;
@ -457,7 +456,8 @@ inputChatPhotoAnimation animation:InputFile main_frame_timestamp:double = InputC
//@can_change_info True, if the user can change the chat title, photo, and other settings //@can_change_info True, if the user can change the chat title, photo, and other settings
//@can_invite_users True, if the user can invite new users to the chat //@can_invite_users True, if the user can invite new users to the chat
//@can_pin_messages True, if the user can pin messages //@can_pin_messages True, if the user can pin messages
chatPermissions can_send_messages:Bool can_send_media_messages:Bool can_send_polls:Bool can_send_stickers:Bool can_send_animations:Bool can_send_games:Bool can_use_inline_bots:Bool can_add_web_page_previews:Bool can_change_info:Bool can_invite_users:Bool can_pin_messages:Bool = ChatPermissions; //@can_manage_topics True, if the user can manage topics
chatPermissions can_send_messages:Bool can_send_media_messages:Bool can_send_polls:Bool can_send_stickers:Bool can_send_animations:Bool can_send_games:Bool can_use_inline_bots:Bool can_add_web_page_previews:Bool can_change_info:Bool can_invite_users:Bool can_pin_messages:Bool can_manage_topics:Bool = ChatPermissions;
//@description Describes rights of the administrator //@description Describes rights of the administrator
//@can_manage_chat True, if the administrator can get chat event log, get chat statistics, get message statistics in channels, get channel members, see anonymous administrators in supergroups and ignore slow mode. Implied by any other privilege; applicable to supergroups and channels only //@can_manage_chat True, if the administrator can get chat event log, get chat statistics, get message statistics in channels, get channel members, see anonymous administrators in supergroups and ignore slow mode. Implied by any other privilege; applicable to supergroups and channels only
@ -468,10 +468,11 @@ chatPermissions can_send_messages:Bool can_send_media_messages:Bool can_send_pol
//@can_invite_users True, if the administrator can invite new users to the chat //@can_invite_users True, if the administrator can invite new users to the chat
//@can_restrict_members True, if the administrator can restrict, ban, or unban chat members; always true for channels //@can_restrict_members True, if the administrator can restrict, ban, or unban chat members; always true for channels
//@can_pin_messages True, if the administrator can pin messages; applicable to basic groups and supergroups only //@can_pin_messages True, if the administrator can pin messages; applicable to basic groups and supergroups only
//@can_manage_topics True, if the administrator can manage topics; applicable to forum supergroups only
//@can_promote_members True, if the administrator can add new administrators with a subset of their own privileges or demote administrators that were directly or indirectly promoted by them //@can_promote_members True, if the administrator can add new administrators with a subset of their own privileges or demote administrators that were directly or indirectly promoted by them
//@can_manage_video_chats True, if the administrator can manage video chats //@can_manage_video_chats True, if the administrator can manage video chats
//@is_anonymous True, if the administrator isn't shown in the chat member list and sends messages anonymously; applicable to supergroups only //@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_promote_members:Bool can_manage_video_chats: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 is_anonymous:Bool = ChatAdministratorRights;
//@description Describes an option for buying Telegram Premium to a user //@description Describes an option for buying Telegram Premium to a user
@ -483,6 +484,7 @@ chatAdministratorRights can_manage_chat:Bool can_change_info:Bool can_post_messa
//@payment_link An internal link to be opened for buying Telegram Premium to the user if store payment isn't possible; may be null if direct payment isn't available //@payment_link An internal link to be opened for buying Telegram Premium to the user if store payment isn't possible; may be null if direct payment isn't available
premiumPaymentOption currency:string amount:int53 discount_percentage:int32 month_count:int32 store_product_id:string payment_link:InternalLinkType = PremiumPaymentOption; premiumPaymentOption currency:string amount:int53 discount_percentage:int32 month_count:int32 store_product_id:string payment_link:InternalLinkType = PremiumPaymentOption;
//@description Describes a custom emoji to be shown instead of the Telegram Premium badge @custom_emoji_id Identifier of the custom emoji in stickerFormatTgs format. If the custom emoji belongs to the sticker set GetOption("themed_emoji_statuses_sticker_set_id"), then it's color must be changed to the color of the Telegram Premium badge //@description Describes a custom emoji to be shown instead of the Telegram Premium badge @custom_emoji_id Identifier of the custom emoji in stickerFormatTgs format. If the custom emoji belongs to the sticker set GetOption("themed_emoji_statuses_sticker_set_id"), then it's color must be changed to the color of the Telegram Premium badge
emojiStatus custom_emoji_id:int64 = EmojiStatus; emojiStatus custom_emoji_id:int64 = EmojiStatus;
@ -490,12 +492,19 @@ emojiStatus custom_emoji_id:int64 = EmojiStatus;
emojiStatuses emoji_statuses:vector<emojiStatus> = EmojiStatuses; emojiStatuses emoji_statuses:vector<emojiStatus> = EmojiStatuses;
//@description Describes usernames assigned to a user, a supergroup, or a channel
//@active_usernames List of active usernames; the first one must be shown as the primary username. The order of active usernames can be changed with reorderActiveUsernames or reorderSupergroupActiveUsernames
//@disabled_usernames List of currently disabled usernames; the username can be activated with toggleUsernameIsActive/toggleSupergroupUsernameIsActive
//@editable_username The active username, which can be changed with setUsername/setSupergroupUsername
usernames active_usernames:vector<string> disabled_usernames:vector<string> editable_username:string = Usernames;
//@description Represents a user //@description Represents a user
//@id User identifier //@id User identifier
//@access_hash User access hash //@access_hash User access hash
//@first_name First name of the user //@first_name First name of the user
//@last_name Last name of the user //@last_name Last name of the user
//@username Username of the user //@usernames Usernames of the user; may be null
//@phone_number Phone number of the user //@phone_number Phone number of the user
//@status Current online status of the user //@status Current online status of the user
//@profile_photo Profile photo of the user; may be null //@profile_photo Profile photo of the user; may be null
@ -512,7 +521,7 @@ emojiStatuses emoji_statuses:vector<emojiStatus> = EmojiStatuses;
//@type Type of the user //@type Type of the user
//@language_code IETF language tag of the user's language; only available to bots //@language_code IETF language tag of the user's language; only available to bots
//@added_to_attachment_menu True, if the user added the current bot to attachment menu; only available to bots //@added_to_attachment_menu True, if the user added the current bot to attachment menu; only available to bots
user id:int53 access_hash:int64 first_name:string last_name:string username:string phone_number:string status:UserStatus profile_photo:profilePhoto emoji_status:emojiStatus is_contact:Bool is_mutual_contact:Bool is_verified:Bool is_premium:Bool is_support:Bool restriction_reason:string is_scam:Bool is_fake:Bool have_access:Bool type:UserType language_code:string added_to_attachment_menu:Bool = User; user id:int53 access_hash:int64 first_name:string last_name:string usernames:usernames phone_number:string status:UserStatus profile_photo:profilePhoto emoji_status:emojiStatus is_contact:Bool is_mutual_contact:Bool is_verified:Bool is_premium:Bool is_support:Bool restriction_reason:string is_scam:Bool is_fake:Bool have_access:Bool type:UserType language_code:string added_to_attachment_menu:Bool = User;
//@description Contains information about a bot //@description Contains information about a bot
@ -527,7 +536,7 @@ user id:int53 access_hash:int64 first_name:string last_name:string username:stri
botInfo share_text:string description:string photo:photo animation:animation menu_button:botMenuButton commands:vector<botCommand> default_group_administrator_rights:chatAdministratorRights default_channel_administrator_rights:chatAdministratorRights = BotInfo; botInfo share_text:string description:string photo:photo animation:animation menu_button:botMenuButton commands:vector<botCommand> default_group_administrator_rights:chatAdministratorRights default_channel_administrator_rights:chatAdministratorRights = BotInfo;
//@description Contains full information about a user //@description Contains full information about a user
//@photo User profile photo; may be null //@photo User profile photo; may be null if empty or unknown. If non-null, then it is the same photo as in user.profile_photo and chat.photo
//@is_blocked True, if the user is blocked by the current user //@is_blocked True, if the user is blocked by the current user
//@can_be_called True, if the user can be called //@can_be_called True, if the user can be called
//@supports_video_calls True, if a video call can be created with the user //@supports_video_calls True, if a video call can be created with the user
@ -711,7 +720,7 @@ chatJoinRequestsInfo total_count:int32 user_ids:vector<int53> = ChatJoinRequests
basicGroup id:int53 access_hash:int64 member_count:int32 status:ChatMemberStatus is_active:Bool upgraded_to_supergroup_id:int53 = BasicGroup; basicGroup id:int53 access_hash:int64 member_count:int32 status:ChatMemberStatus is_active:Bool upgraded_to_supergroup_id:int53 = BasicGroup;
//@description Contains full information about a basic group //@description Contains full information about a basic group
//@photo Chat photo; may be null //@photo Chat photo; may be null if empty or unknown. If non-null, then it is the same photo as in chat.photo
//@param_description Group description. Updated only after the basic group is opened //@param_description Group description. Updated only after the basic group is opened
//@creator_user_id User identifier of the creator of the group; 0 if unknown //@creator_user_id User identifier of the creator of the group; 0 if unknown
//@members Group members //@members Group members
@ -723,9 +732,9 @@ basicGroupFullInfo photo:chatPhoto description:string creator_user_id:int53 memb
//@description Represents a supergroup or channel with zero or more members (subscribers in the case of channels). From the point of view of the system, a channel is a special kind of a supergroup: only administrators can post and see the list of members, and posts from all administrators use the name and photo of the channel instead of individual names and profile photos. Unlike supergroups, channels can have an unlimited number of subscribers //@description Represents a supergroup or channel with zero or more members (subscribers in the case of channels). From the point of view of the system, a channel is a special kind of a supergroup: only administrators can post and see the list of members, and posts from all administrators use the name and photo of the channel instead of individual names and profile photos. Unlike supergroups, channels can have an unlimited number of subscribers
//@id Supergroup or channel identifier //@id Supergroup or channel identifier
//@access_hash Supergroup or channel access hash //@access_hash Supergroup or channel access hash
//@username Username of the supergroup or channel; empty for private supergroups or channels //@usernames Usernames of the supergroup or channel; may be null
//@date Point in time (Unix timestamp) when the current user joined, or the point in time when the supergroup or channel was created, in case the user is not a member //@date Point in time (Unix timestamp) when the current user joined, or the point in time when the supergroup or channel was created, in case the user is not a member
//@status Status of the current user in the supergroup or channel; custom title will be always empty //@status Status of the current user in the supergroup or channel; custom title will always be empty
//@member_count Number of members in the supergroup or channel; 0 if unknown. Currently, it is guaranteed to be known only if the supergroup or channel was received through searchPublicChats, searchChatsNearby, getInactiveSupergroupChats, getSuitableDiscussionChats, getGroupsInCommon, or getUserPrivacySettingRules //@member_count Number of members in the supergroup or channel; 0 if unknown. Currently, it is guaranteed to be known only if the supergroup or channel was received through searchPublicChats, searchChatsNearby, getInactiveSupergroupChats, getSuitableDiscussionChats, getGroupsInCommon, or getUserPrivacySettingRules
//@has_linked_chat True, if the channel has a discussion group, or the supergroup is the designated discussion group for a channel //@has_linked_chat True, if the channel has a discussion group, or the supergroup is the designated discussion group for a channel
//@has_location True, if the supergroup is connected to a location, i.e. the supergroup is a location-based supergroup //@has_location True, if the supergroup is connected to a location, i.e. the supergroup is a location-based supergroup
@ -735,14 +744,15 @@ basicGroupFullInfo photo:chatPhoto description:string creator_user_id:int53 memb
//@is_slow_mode_enabled True, if the slow mode is enabled in the supergroup //@is_slow_mode_enabled True, if the slow mode is enabled in the supergroup
//@is_channel True, if the supergroup is a channel //@is_channel True, if the supergroup is a channel
//@is_broadcast_group True, if the supergroup is a broadcast group, i.e. only administrators can send messages and there is no limit on the number of members //@is_broadcast_group True, if the supergroup is a broadcast group, i.e. only administrators can send messages and there is no limit on the number of members
//@is_forum True, if the supergroup must be shown as a forum by default
//@is_verified True, if the supergroup or channel is verified //@is_verified True, if the supergroup or channel is verified
//@restriction_reason If non-empty, contains a human-readable description of the reason why access to this supergroup or channel must be restricted //@restriction_reason If non-empty, contains a human-readable description of the reason why access to this supergroup or channel must be restricted
//@is_scam True, if many users reported this supergroup or channel as a scam //@is_scam True, if many users reported this supergroup or channel as a scam
//@is_fake True, if many users reported this supergroup or channel as a fake account //@is_fake True, if many users reported this supergroup or channel as a fake account
supergroup id:int53 access_hash:int64 username:string date:int32 status:ChatMemberStatus member_count:int32 has_linked_chat:Bool has_location:Bool sign_messages:Bool join_to_send_messages:Bool join_by_request:Bool is_slow_mode_enabled:Bool is_channel:Bool is_broadcast_group:Bool is_verified:Bool restriction_reason:string is_scam:Bool is_fake:Bool = Supergroup; supergroup id:int53 access_hash:int64 usernames:usernames date:int32 status:ChatMemberStatus member_count:int32 has_linked_chat:Bool has_location:Bool sign_messages:Bool join_to_send_messages:Bool join_by_request:Bool is_slow_mode_enabled:Bool is_channel:Bool is_broadcast_group:Bool is_forum:Bool is_verified:Bool restriction_reason:string is_scam:Bool is_fake:Bool = Supergroup;
//@description Contains full information about a supergroup or channel //@description Contains full information about a supergroup or channel
//@photo Chat photo; may be null //@photo Chat photo; may be null if empty or unknown. If non-null, then it is the same photo as in chat.photo
//@param_description Supergroup or channel description //@param_description Supergroup or channel description
//@member_count Number of members in the supergroup or channel; 0 if unknown //@member_count Number of members in the supergroup or channel; 0 if unknown
//@administrator_count Number of privileged users in the supergroup or channel; 0 if unknown //@administrator_count Number of privileged users in the supergroup or channel; 0 if unknown
@ -756,7 +766,7 @@ supergroup id:int53 access_hash:int64 username:string date:int32 status:ChatMemb
//@can_set_sticker_set True, if the supergroup sticker set can be changed //@can_set_sticker_set True, if the supergroup sticker set can be changed
//@can_set_location True, if the supergroup location can be changed //@can_set_location True, if the supergroup location can be changed
//@can_get_statistics True, if the supergroup or channel statistics are available //@can_get_statistics True, if the supergroup or channel statistics are available
//@is_all_history_available True, if new chat members will have access to old messages. In public or discussion groups and both public and private channels, old messages are always available, so this option affects only private supergroups without a linked chat. The value of this field is only available for chat administrators //@is_all_history_available True, if new chat members will have access to old messages. In public, discussion, of forum groups and all channels, old messages are always available, so this option affects only private non-forum supergroups without a linked chat. The value of this field is only available for chat administrators
//@sticker_set_id Identifier of the supergroup sticker set; 0 if none //@sticker_set_id Identifier of the supergroup sticker set; 0 if none
//@location Location to which the supergroup is connected; may be null //@location Location to which the supergroup is connected; may be null
//@invite_link Primary invite link for the chat; may be null. For chat administrators with can_invite_users right only //@invite_link Primary invite link for the chat; may be null. For chat administrators with can_invite_users right only
@ -802,6 +812,13 @@ messageSenderChat chat_id:int53 = MessageSender;
messageSenders total_count:int32 senders:vector<MessageSender> = MessageSenders; messageSenders total_count:int32 senders:vector<MessageSender> = MessageSenders;
//@description Represents a message sender, which can be used to send messages in a chat @sender Available message senders @needs_premium True, if Telegram Premium is needed to use the message sender
chatMessageSender sender:MessageSender needs_premium:Bool = ChatMessageSender;
//@description Represents a list of message senders, which can be used to send messages in a chat @senders List of available message senders
chatMessageSenders senders:vector<chatMessageSender> = ChatMessageSenders;
//@class MessageForwardOrigin @description Contains information about the origin of a forwarded message //@class MessageForwardOrigin @description Contains information about the origin of a forwarded message
//@description The message was originally sent by a known user @sender_user_id Identifier of the user that originally sent the message //@description The message was originally sent by a known user @sender_user_id Identifier of the user that originally sent the message
@ -904,6 +921,7 @@ messageSendingStateFailed error_code:int32 error_message:string can_retry:Bool n
//@can_report_reactions True, if reactions on the message can be reported through reportMessageReactions //@can_report_reactions True, if reactions on the message can be reported through reportMessageReactions
//@has_timestamped_media True, if media timestamp entities refers to a media in this message as opposed to a media in the replied message //@has_timestamped_media True, if media timestamp entities refers to a media in this message as opposed to a media in the replied message
//@is_channel_post True, if the message is a channel post. All messages to channels are channel posts, all other messages are not channel posts //@is_channel_post True, if the message is a channel post. All messages to channels are channel posts, all other messages are not channel posts
//@is_topic_message True, if the message is a forum topic message
//@contains_unread_mention True, if the message contains an unread mention for the current user //@contains_unread_mention True, if the message contains an unread mention for the current user
//@date Point in time (Unix timestamp) when the message was sent //@date Point in time (Unix timestamp) when the message was sent
//@edit_date Point in time (Unix timestamp) when the message was last edited //@edit_date Point in time (Unix timestamp) when the message was last edited
@ -921,7 +939,7 @@ messageSendingStateFailed error_code:int32 error_message:string can_retry:Bool n
//@restriction_reason If non-empty, contains a human-readable description of the reason why access to this message must be restricted //@restriction_reason If non-empty, contains a human-readable description of the reason why access to this message must be restricted
//@content Content of the message //@content Content of the message
//@reply_markup Reply markup for the message; may be null //@reply_markup Reply markup for the message; may be null
message id:int53 sender_id:MessageSender chat_id:int53 sending_state:MessageSendingState scheduling_state:MessageSchedulingState is_outgoing:Bool is_pinned:Bool can_be_edited:Bool can_be_forwarded:Bool can_be_saved:Bool can_be_deleted_only_for_self:Bool can_be_deleted_for_all_users:Bool can_get_added_reactions:Bool can_get_statistics:Bool can_get_message_thread:Bool can_get_viewers:Bool can_get_media_timestamp_links:Bool can_report_reactions:Bool has_timestamped_media:Bool is_channel_post:Bool contains_unread_mention:Bool date:int32 edit_date:int32 forward_info:messageForwardInfo interaction_info:messageInteractionInfo unread_reactions:vector<unreadReaction> reply_in_chat_id:int53 reply_to_message_id:int53 message_thread_id:int53 ttl:int32 ttl_expires_in:double via_bot_user_id:int53 author_signature:string media_album_id:int64 restriction_reason:string content:MessageContent reply_markup:ReplyMarkup = Message; message id:int53 sender_id:MessageSender chat_id:int53 sending_state:MessageSendingState scheduling_state:MessageSchedulingState is_outgoing:Bool is_pinned:Bool can_be_edited:Bool can_be_forwarded:Bool can_be_saved:Bool can_be_deleted_only_for_self:Bool can_be_deleted_for_all_users:Bool can_get_added_reactions:Bool can_get_statistics:Bool can_get_message_thread:Bool can_get_viewers:Bool can_get_media_timestamp_links:Bool can_report_reactions:Bool has_timestamped_media:Bool is_channel_post:Bool is_topic_message:Bool contains_unread_mention:Bool date:int32 edit_date:int32 forward_info:messageForwardInfo interaction_info:messageInteractionInfo unread_reactions:vector<unreadReaction> reply_in_chat_id:int53 reply_to_message_id:int53 message_thread_id:int53 ttl:int32 ttl_expires_in:double via_bot_user_id:int53 author_signature:string media_album_id:int64 restriction_reason:string content:MessageContent reply_markup:ReplyMarkup = Message;
//@description Contains a list of messages @total_count Approximate total number of messages found @messages List of messages; messages may be null //@description Contains a list of messages @total_count Approximate total number of messages found @messages List of messages; messages may be null
messages total_count:int32 messages:vector<message> = Messages; messages total_count:int32 messages:vector<message> = Messages;
@ -947,9 +965,13 @@ messageCalendar total_count:int32 days:vector<messageCalendarDay> = MessageCalen
//@is_recommended True, if the message needs to be labeled as "recommended" instead of "sponsored" //@is_recommended True, if the message needs to be labeled as "recommended" instead of "sponsored"
//@sponsor_chat_id Sponsor chat identifier; 0 if the sponsor chat is accessible through an invite link //@sponsor_chat_id Sponsor chat identifier; 0 if the sponsor chat is accessible through an invite link
//@sponsor_chat_info Information about the sponsor chat; may be null unless sponsor_chat_id == 0 //@sponsor_chat_info Information about the sponsor chat; may be null unless sponsor_chat_id == 0
//@show_chat_photo True, if the sponsor's chat photo must be shown
//@link An internal link to be opened when the sponsored message is clicked; may be null if the sponsor chat needs to be opened instead //@link An internal link to be opened when the sponsored message is clicked; may be null if the sponsor chat needs to be opened instead
//@content Content of the message. Currently, can be only of the type messageText //@content Content of the message. Currently, can be only of the type messageText
sponsoredMessage message_id:int53 is_recommended:Bool sponsor_chat_id:int53 sponsor_chat_info:chatInviteLinkInfo link:InternalLinkType content:MessageContent = SponsoredMessage; sponsoredMessage message_id:int53 is_recommended:Bool sponsor_chat_id:int53 sponsor_chat_info:chatInviteLinkInfo show_chat_photo:Bool link:InternalLinkType content:MessageContent = SponsoredMessage;
//@description Contains a list of sponsored messages @messages List of sponsored messages @messages_between The minimum number of messages between shown sponsored messages, or 0 if only one sponsored message must be shown after all ordinary messages
sponsoredMessages messages:vector<sponsoredMessage> messages_between:int32 = SponsoredMessages;
//@description Describes a file added to file download list //@description Describes a file added to file download list
@ -1149,7 +1171,7 @@ chatsNearby users_nearby:vector<chatNearby> supergroups_nearby:vector<chatNearby
//@class PublicChatType @description Describes a type of public chats //@class PublicChatType @description Describes a type of public chats
//@description The chat is public, because it has username //@description The chat is public, because it has an active username
publicChatTypeHasUsername = PublicChatType; publicChatTypeHasUsername = PublicChatType;
//@description The chat is public, because it is a location-based supergroup //@description The chat is public, because it is a location-based supergroup
@ -1158,7 +1180,7 @@ publicChatTypeIsLocationBased = PublicChatType;
//@class ChatActionBar @description Describes actions which must be possible to do through a chat action bar //@class ChatActionBar @description Describes actions which must be possible to do through a chat action bar
//@description The chat can be reported as spam using the method reportChat with the reason chatReportReasonSpam //@description The chat can be reported as spam using the method reportChat with the reason chatReportReasonSpam. If the chat is a private chat with a user with an emoji status, then a notice about emoji status usage must be shown
//@can_unarchive If true, the chat was automatically archived and can be moved back to the main chat list using addChatToList simultaneously with setting chat notification settings to default using setChatNotificationSettings //@can_unarchive If true, the chat was automatically archived and can be moved back to the main chat list using addChatToList simultaneously with setting chat notification settings to default using setChatNotificationSettings
chatActionBarReportSpam can_unarchive:Bool = ChatActionBar; chatActionBarReportSpam can_unarchive:Bool = ChatActionBar;
@ -1168,7 +1190,7 @@ chatActionBarReportUnrelatedLocation = ChatActionBar;
//@description The chat is a recently created group chat to which new members can be invited //@description The chat is a recently created group chat to which new members can be invited
chatActionBarInviteMembers = ChatActionBar; chatActionBarInviteMembers = ChatActionBar;
//@description The chat is a private or secret chat, which can be reported using the method reportChat, or the other user can be blocked using the method toggleMessageSenderIsBlocked, or the other user can be added to the contact list using the method addContact //@description The chat is a private or secret chat, which can be reported using the method reportChat, or the other user can be blocked using the method toggleMessageSenderIsBlocked, or the other user can be added to the contact list using the method addContact. If the chat is a private chat with a user with an emoji status, then a notice about emoji status usage must be shown
//@can_unarchive If true, the chat was automatically archived and can be moved back to the main chat list using addChatToList simultaneously with setting chat notification settings to default using setChatNotificationSettings //@can_unarchive If true, the chat was automatically archived and can be moved back to the main chat list using addChatToList simultaneously with setting chat notification settings to default using setChatNotificationSettings
//@distance If non-negative, the current user was found by the peer through searchChatsNearby and this is the distance between the users //@distance If non-negative, the current user was found by the peer through searchChatsNearby and this is the distance between the users
chatActionBarReportAddBlock can_unarchive:Bool distance:int32 = ChatActionBar; chatActionBarReportAddBlock can_unarchive:Bool distance:int32 = ChatActionBar;
@ -1283,13 +1305,40 @@ webAppInfo launch_id:int64 url:string = WebAppInfo;
//@description Contains information about a message thread //@description Contains information about a message thread
//@chat_id Identifier of the chat to which the message thread belongs //@chat_id Identifier of the chat to which the message thread belongs
//@message_thread_id Message thread identifier, unique within the chat //@message_thread_id Message thread identifier, unique within the chat
//@reply_info Information about the message thread //@reply_info Information about the message thread; may be null for forum topic threads
//@unread_message_count Approximate number of unread messages in the message thread //@unread_message_count Approximate number of unread messages in the message thread
//@messages The messages from which the thread starts. The messages are returned in a reverse chronological order (i.e., in order of decreasing message_id) //@messages The messages from which the thread starts. The messages are returned in a reverse chronological order (i.e., in order of decreasing message_id)
//@draft_message A draft of a message in the message thread; may be null //@draft_message A draft of a message in the message thread; may be null
messageThreadInfo chat_id:int53 message_thread_id:int53 reply_info:messageReplyInfo unread_message_count:int32 messages:vector<message> draft_message:draftMessage = MessageThreadInfo; messageThreadInfo chat_id:int53 message_thread_id:int53 reply_info:messageReplyInfo unread_message_count:int32 messages:vector<message> draft_message:draftMessage = MessageThreadInfo;
//@description Describes a forum topic icon @color Color of the topic icon in RGB format @custom_emoji_id Unique identifier of the custom emoji shown on the topic icon; 0 if none
forumTopicIcon color:int32 custom_emoji_id:int64 = ForumTopicIcon;
//@description Contains basic information about a forum topic
//@message_thread_id Message thread identifier of the topic
//@name Name of the topic
//@icon Icon of the topic
//@creation_date Date the topic was created
//@creator_id Identifier of the creator of the topic
//@is_outgoing True, if the topic was created by the current user
//@is_closed True, if the topic is closed
forumTopicInfo message_thread_id:int53 name:string icon:forumTopicIcon creation_date:int32 creator_id:MessageSender is_outgoing:Bool is_closed:Bool = ForumTopicInfo;
//@description Describes a forum topic
//@info Basic information about the topic
//@last_message Last message in the topic; may be null
//@is_pinned True, if the topic is pinned in the topic list
//@unread_count Number of unread messages in the topic
//@last_read_inbox_message_id Identifier of the last read incoming message
//@last_read_outbox_message_id Identifier of the last read outgoing message
//@unread_mention_count Number of unread messages with a mention/reply in the topic
//@unread_reaction_count Number of messages with unread reactions in the topic
//@notification_settings Notification settings for the topic
//@draft_message A draft of a message in the topic; may be null
forumTopic info:forumTopicInfo last_message:message is_pinned:Bool unread_count:int32 last_read_inbox_message_id:int53 last_read_outbox_message_id:int53 unread_mention_count:int32 unread_reaction_count:int32 notification_settings:chatNotificationSettings draft_message:draftMessage = ForumTopic;
//@class RichText @description Describes a text object inside an instant-view web page //@class RichText @description Describes a text object inside an instant-view web page
//@description A plain text @text Text //@description A plain text @text Text
@ -1641,7 +1690,7 @@ paymentResult success:Bool verification_url:string = PaymentResult;
paymentReceipt title:string description:formattedText photo:photo date:int32 seller_bot_user_id:int53 payment_provider_user_id:int53 invoice:invoice order_info:orderInfo shipping_option:shippingOption credentials_title:string tip_amount:int53 = PaymentReceipt; paymentReceipt title:string description:formattedText photo:photo date:int32 seller_bot_user_id:int53 payment_provider_user_id:int53 invoice:invoice order_info:orderInfo shipping_option:shippingOption credentials_title:string tip_amount:int53 = PaymentReceipt;
//@class InputInvoice @description Describe an invoice to process //@class InputInvoice @description Describes an invoice to process
//@description An invoice from a message of the type messageInvoice @chat_id Chat identifier of the message @message_id Message identifier //@description An invoice from a message of the type messageInvoice @chat_id Chat identifier of the message @message_id Message identifier
inputInvoiceMessage chat_id:int53 message_id:int53 = InputInvoice; inputInvoiceMessage chat_id:int53 message_id:int53 = InputInvoice;
@ -1650,6 +1699,27 @@ inputInvoiceMessage chat_id:int53 message_id:int53 = InputInvoice;
inputInvoiceName name:string = InputInvoice; inputInvoiceName name:string = InputInvoice;
//@class MessageExtendedMedia @description Describes a media, which is attached to an invoice
//@description The media is hidden until the invoice is paid
//@width Media width; 0 if unknown
//@height Media height; 0 if unknown
//@duration Media duration; 0 if unknown
//@minithumbnail Media minithumbnail; may be null
//@caption Media caption
messageExtendedMediaPreview width:int32 height:int32 duration:int32 minithumbnail:minithumbnail caption:formattedText = MessageExtendedMedia;
//@description The media is a photo @photo The photo @caption Photo caption
messageExtendedMediaPhoto photo:photo caption:formattedText = MessageExtendedMedia;
//@description The media is a video @video The video @caption Photo caption
messageExtendedMediaVideo video:video caption:formattedText = MessageExtendedMedia;
//@description The media is unuspported @caption Media caption
messageExtendedMediaUnsupported caption:formattedText = MessageExtendedMedia;
//@description File with the date it was uploaded @file The file @date Point in time (Unix timestamp) when the file was uploaded //@description File with the date it was uploaded @file The file @date Point in time (Unix timestamp) when the file was uploaded
datedFile file:file date:int32 = DatedFile; datedFile file:file date:int32 = DatedFile;
@ -1967,7 +2037,8 @@ messagePoll poll:poll = MessageContent;
//@description A message with an invoice from a bot @title Product title @param_description Product description @photo Product photo; may be null @currency Currency for the product price @total_amount Product total price in the smallest units of the currency //@description A message with an invoice from a bot @title Product title @param_description Product description @photo Product photo; may be null @currency Currency for the product price @total_amount Product total price in the smallest units of the currency
//@start_parameter Unique invoice bot start_parameter. To share an invoice use the URL https://t.me/{bot_username}?start={start_parameter} @is_test True, if the invoice is a test invoice //@start_parameter Unique invoice bot start_parameter. To share an invoice use the URL https://t.me/{bot_username}?start={start_parameter} @is_test True, if the invoice is a test invoice
//@need_shipping_address True, if the shipping address must be specified @receipt_message_id The identifier of the message with the receipt, after the product has been purchased //@need_shipping_address True, if the shipping address must be specified @receipt_message_id The identifier of the message with the receipt, after the product has been purchased
messageInvoice title:string description:formattedText photo:photo currency:string total_amount:int53 start_parameter:string is_test:Bool need_shipping_address:Bool receipt_message_id:int53 = MessageContent; //@extended_media Extended media attached to the invoice; may be null
messageInvoice title:string description:formattedText photo:photo currency:string total_amount:int53 start_parameter:string is_test:Bool need_shipping_address:Bool receipt_message_id:int53 extended_media:MessageExtendedMedia = MessageContent;
//@description A message with information about an ended call @is_video True, if the call was a video call @discard_reason Reason why the call was discarded @duration Call duration, in seconds //@description A message with information about an ended call @is_video True, if the call was a video call @discard_reason Reason why the call was discarded @duration Call duration, in seconds
messageCall is_video:Bool discard_reason:CallDiscardReason duration:int32 = MessageContent; messageCall is_video:Bool discard_reason:CallDiscardReason duration:int32 = MessageContent;
@ -2029,13 +2100,22 @@ messageChatSetTheme theme_name:string = MessageContent;
//@description The TTL (Time To Live) setting for messages in the chat has been changed @ttl New message TTL //@description The TTL (Time To Live) setting for messages in the chat has been changed @ttl New message TTL
messageChatSetTtl ttl:int32 = MessageContent; messageChatSetTtl ttl:int32 = MessageContent;
//@description A forum topic has been created @name Name of the topic @icon Icon of the topic
messageForumTopicCreated name:string icon:forumTopicIcon = MessageContent;
//@description A forum topic has been edited @name If non-empty, the new name of the topic @edit_icon_custom_emoji_id True, if icon's custom_emoji_id is changed @icon_custom_emoji_id New unique identifier of the custom emoji shown on the topic icon; 0 if none. Must be ignored if edit_icon_custom_emoji_id is false
messageForumTopicEdited name:string edit_icon_custom_emoji_id:Bool icon_custom_emoji_id:int64 = MessageContent;
//@description A forum topic has been closed or opened @is_closed True if the topic was closed or reopened
messageForumTopicIsClosedToggled is_closed:Bool = MessageContent;
//@description A non-standard action has happened in the chat @text Message text to be shown in the chat //@description A non-standard action has happened in the chat @text Message text to be shown in the chat
messageCustomServiceAction text:string = MessageContent; 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 //@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; messageGameScore game_message_id:int53 game_id:int64 score:int32 = MessageContent;
//@description A payment has been completed @invoice_chat_id Identifier of the chat, containing the corresponding invoice message; 0 if unknown @invoice_message_id Identifier of the message with the corresponding invoice; can be 0 or an identifier of a deleted message //@description A payment has been completed @invoice_chat_id Identifier of the chat, containing the corresponding invoice message @invoice_message_id Identifier of the message with the corresponding invoice; can be 0 or an identifier of a deleted message
//@currency Currency for the price of the product @total_amount Total price for the product, in the smallest units of the currency //@currency Currency for the price of the product @total_amount Total price for the product, in the smallest units of the currency
//@is_recurring True, if this is a recurring payment @is_first_recurring True, if this is the first recurring payment @invoice_name Name of the invoice; may be empty if unknown //@is_recurring True, if this is a recurring payment @is_first_recurring True, if this is the first recurring payment @invoice_name Name of the invoice; may be empty if unknown
messagePaymentSuccessful invoice_chat_id:int53 invoice_message_id:int53 currency:string total_amount:int53 is_recurring:Bool is_first_recurring:Bool invoice_name:string = MessageContent; messagePaymentSuccessful invoice_chat_id:int53 invoice_message_id:int53 currency:string total_amount:int53 is_recurring:Bool is_first_recurring:Bool invoice_name:string = MessageContent;
@ -2077,7 +2157,7 @@ messageUnsupported = MessageContent;
//@class TextEntityType @description Represents a part of the text which must be formatted differently //@class TextEntityType @description Represents a part of the text which must be formatted differently
//@description A mention of a user by their username //@description A mention of a user, a supergroup, or a channel by their username
textEntityTypeMention = TextEntityType; textEntityTypeMention = TextEntityType;
//@description A hashtag text, beginning with "#" //@description A hashtag text, beginning with "#"
@ -2183,7 +2263,7 @@ inputMessageAnimation animation:InputFile thumbnail:inputThumbnail added_sticker
//@performer Performer of the audio; 0-64 characters, may be replaced by the server @caption Audio caption; pass null to use an empty caption; 0-GetOption("message_caption_length_max") characters //@performer Performer of the audio; 0-64 characters, may be replaced by the server @caption Audio caption; pass null to use an empty caption; 0-GetOption("message_caption_length_max") characters
inputMessageAudio audio:InputFile album_cover_thumbnail:inputThumbnail duration:int32 title:string performer:string caption:formattedText = InputMessageContent; inputMessageAudio audio:InputFile album_cover_thumbnail:inputThumbnail duration:int32 title:string performer:string caption:formattedText = InputMessageContent;
//@description A document message (general file) @document Document to be sent @thumbnail Document thumbnail; pass null to skip thumbnail uploading @disable_content_type_detection If true, automatic file type detection will be disabled and the document will be always sent as file. Always true for files sent to secret chats @caption Document caption; pass null to use an empty caption; 0-GetOption("message_caption_length_max") characters //@description A document message (general file) @document Document to be sent @thumbnail Document thumbnail; pass null to skip thumbnail uploading @disable_content_type_detection If true, automatic file type detection will be disabled and the document will always be sent as file. Always true for files sent to secret chats @caption Document caption; pass null to use an empty caption; 0-GetOption("message_caption_length_max") characters
inputMessageDocument document:InputFile thumbnail:inputThumbnail disable_content_type_detection:Bool caption:formattedText = InputMessageContent; inputMessageDocument document:InputFile thumbnail:inputThumbnail disable_content_type_detection:Bool caption:formattedText = InputMessageContent;
//@description A photo message @photo Photo to send. The photo must be at most 10 MB in size. The photo's width and height must not exceed 10000 in total. Width and height ratio must be at most 20 @thumbnail Photo thumbnail to be sent; pass null to skip thumbnail uploading. The thumbnail is sent to the other party only in secret chats @added_sticker_file_ids File identifiers of the stickers added to the photo, if applicable @width Photo width @height Photo height @caption Photo caption; pass null to use an empty caption; 0-GetOption("message_caption_length_max") characters //@description A photo message @photo Photo to send. The photo must be at most 10 MB in size. The photo's width and height must not exceed 10000 in total. Width and height ratio must be at most 20 @thumbnail Photo thumbnail to be sent; pass null to skip thumbnail uploading. The thumbnail is sent to the other party only in secret chats @added_sticker_file_ids File identifiers of the stickers added to the photo, if applicable @width Photo width @height Photo height @caption Photo caption; pass null to use an empty caption; 0-GetOption("message_caption_length_max") characters
@ -2201,7 +2281,7 @@ inputMessageVideo video:InputFile thumbnail:inputThumbnail added_sticker_file_id
//@description A video note message @video_note Video note to be sent @thumbnail Video thumbnail; pass null to skip thumbnail uploading @duration Duration of the video, in seconds @length Video width and height; must be positive and not greater than 640 //@description A video note message @video_note Video note to be sent @thumbnail Video thumbnail; pass null to skip thumbnail uploading @duration Duration of the video, in seconds @length Video width and height; must be positive and not greater than 640
inputMessageVideoNote video_note:InputFile thumbnail:inputThumbnail duration:int32 length:int32 = InputMessageContent; inputMessageVideoNote video_note:InputFile thumbnail:inputThumbnail duration:int32 length:int32 = InputMessageContent;
//@description A voice note message @voice_note Voice note to be sent @duration Duration of the voice note, in seconds @waveform Waveform representation of the voice note, in 5-bit format @caption Voice note caption; pass null to use an empty caption; 0-GetOption("message_caption_length_max") characters //@description A voice note message @voice_note Voice note to be sent @duration Duration of the voice note, in seconds @waveform Waveform representation of the voice note in 5-bit format @caption Voice note caption; pass null to use an empty caption; 0-GetOption("message_caption_length_max") characters
inputMessageVoiceNote voice_note:InputFile duration:int32 waveform:bytes caption:formattedText = InputMessageContent; inputMessageVoiceNote voice_note:InputFile duration:int32 waveform:bytes caption:formattedText = InputMessageContent;
//@description A message with a location @location Location to be sent @live_period Period for which the location can be updated, in seconds; must be between 60 and 86400 for a live location and 0 otherwise //@description A message with a location @location Location to be sent @live_period Period for which the location can be updated, in seconds; must be between 60 and 86400 for a live location and 0 otherwise
@ -2225,7 +2305,8 @@ inputMessageGame bot_user_id:int53 game_short_name:string = InputMessageContent;
//@photo_url Product photo URL; optional @photo_size Product photo size @photo_width Product photo width @photo_height Product photo height //@photo_url Product photo URL; optional @photo_size Product photo size @photo_width Product photo width @photo_height Product photo height
//@payload The invoice payload @provider_token Payment provider token @provider_data JSON-encoded data about the invoice, which will be shared with the payment provider //@payload The invoice payload @provider_token Payment provider token @provider_data JSON-encoded data about the invoice, which will be shared with the payment provider
//@start_parameter Unique invoice bot deep link parameter for the generation of this invoice. If empty, it would be possible to pay directly from forwards of the invoice message //@start_parameter Unique invoice bot deep link parameter for the generation of this invoice. If empty, it would be possible to pay directly from forwards of the invoice message
inputMessageInvoice invoice:invoice title:string description:string photo_url:string photo_size:int32 photo_width:int32 photo_height:int32 payload:bytes provider_token:string provider_data:string start_parameter:string = InputMessageContent; //@extended_media_content The content of extended media attached to the invoice. The content of the message to be sent. Must be one of the following types: inputMessagePhoto, inputMessageVideo
inputMessageInvoice invoice:invoice title:string description:string photo_url:string photo_size:int32 photo_width:int32 photo_height:int32 payload:bytes provider_token:string provider_data:string start_parameter:string extended_media_content:InputMessageContent = InputMessageContent;
//@description A message with a poll. Polls can't be sent to secret chats. Polls can be sent only to a private chat with a bot @question Poll question; 1-255 characters (up to 300 characters for bots) @options List of poll answer options, 2-10 strings 1-100 characters each //@description A message with a poll. Polls can't be sent to secret chats. Polls can be sent only to a private chat with a bot @question Poll question; 1-255 characters (up to 300 characters for bots) @options List of poll answer options, 2-10 strings 1-100 characters each
//@is_anonymous True, if the poll voters are anonymous. Non-anonymous polls can't be sent or forwarded to channels @type Type of the poll //@is_anonymous True, if the poll voters are anonymous. Non-anonymous polls can't be sent or forwarded to channels @type Type of the poll
@ -2894,9 +2975,12 @@ chatEventStickerSetChanged old_sticker_set_id:int64 new_sticker_set_id:int64 = C
//@description The chat title was changed @old_title Previous chat title @new_title New chat title //@description The chat title was changed @old_title Previous chat title @new_title New chat title
chatEventTitleChanged old_title:string new_title:string = ChatEventAction; chatEventTitleChanged old_title:string new_title:string = ChatEventAction;
//@description The chat username was changed @old_username Previous chat username @new_username New chat username //@description The chat editable username was changed @old_username Previous chat username @new_username New chat username
chatEventUsernameChanged old_username:string new_username:string = ChatEventAction; chatEventUsernameChanged old_username:string new_username:string = ChatEventAction;
//@description The chat active usernames were changed @old_usernames Previous list of active usernames @new_usernames New list of active usernames
chatEventActiveUsernamesChanged old_usernames:vector<string> new_usernames:vector<string> = ChatEventAction;
//@description The has_protected_content setting of a channel was toggled @has_protected_content New value of has_protected_content //@description The has_protected_content setting of a channel was toggled @has_protected_content New value of has_protected_content
chatEventHasProtectedContentToggled has_protected_content:Bool = ChatEventAction; chatEventHasProtectedContentToggled has_protected_content:Bool = ChatEventAction;
@ -2933,6 +3017,24 @@ chatEventVideoChatParticipantIsMutedToggled participant_id:MessageSender is_mute
//@description A video chat participant volume level was changed @participant_id Identifier of the affected group call participant @volume_level New value of volume_level; 1-20000 in hundreds of percents //@description A video chat participant volume level was changed @participant_id Identifier of the affected group call participant @volume_level New value of volume_level; 1-20000 in hundreds of percents
chatEventVideoChatParticipantVolumeLevelChanged participant_id:MessageSender volume_level:int32 = ChatEventAction; chatEventVideoChatParticipantVolumeLevelChanged participant_id:MessageSender volume_level:int32 = ChatEventAction;
//@description The is_forum setting of a channel was toggled @is_forum New value of is_forum
chatEventIsForumToggled is_forum:Bool = ChatEventAction;
//@description A new forum topic was created @topic_info Information about the topic
chatEventForumTopicCreated topic_info:forumTopicInfo = ChatEventAction;
//@description A forum topic was edited @old_topic_info Old information about the topic @new_topic_info New information about the topic
chatEventForumTopicEdited old_topic_info:forumTopicInfo new_topic_info:forumTopicInfo = ChatEventAction;
//@description A forum topic was closed or reopened @topic_info New information about the topic
chatEventForumTopicToggleIsClosed topic_info:forumTopicInfo = ChatEventAction;
//@description A forum topic was deleted @topic_info Information about the topic
chatEventForumTopicDeleted topic_info:forumTopicInfo = ChatEventAction;
//@description A pinned forum topic was changed @old_topic_info Information about the old pinned topic; may be null @new_topic_info Information about the new pinned topic; may be null
chatEventForumTopicPinned old_topic_info:forumTopicInfo new_topic_info:forumTopicInfo = ChatEventAction;
//@description Represents a chat event @id Chat event identifier @date Point in time (Unix timestamp) when the event happened @member_id Identifier of the user or chat who performed the action @action The action //@description Represents a chat event @id Chat event identifier @date Point in time (Unix timestamp) when the event happened @member_id Identifier of the user or chat who performed the action @action The action
chatEvent id:int64 date:int32 member_id:MessageSender action:ChatEventAction = ChatEvent; chatEvent id:int64 date:int32 member_id:MessageSender action:ChatEventAction = ChatEvent;
@ -2952,7 +3054,8 @@ chatEvents events:vector<chatEvent> = ChatEvents;
//@setting_changes True, if changes in chat settings need to be returned //@setting_changes True, if changes in chat settings need to be returned
//@invite_link_changes True, if changes to invite links need to be returned //@invite_link_changes True, if changes to invite links need to be returned
//@video_chat_changes True, if video chat actions need to be returned //@video_chat_changes True, if video chat actions need to be returned
chatEventLogFilters message_edits:Bool message_deletions:Bool message_pins:Bool member_joins:Bool member_leaves:Bool member_invites:Bool member_promotions:Bool member_restrictions:Bool info_changes:Bool setting_changes:Bool invite_link_changes:Bool video_chat_changes:Bool = ChatEventLogFilters; //@forum_changes True, if forum-related actions need to be returned
chatEventLogFilters message_edits:Bool message_deletions:Bool message_pins:Bool member_joins:Bool member_leaves:Bool member_invites:Bool member_promotions:Bool member_restrictions:Bool info_changes:Bool setting_changes:Bool invite_link_changes:Bool video_chat_changes:Bool forum_changes:Bool = ChatEventLogFilters;
//@class LanguagePackStringValue @description Represents the value of a string in a language pack //@class LanguagePackStringValue @description Represents the value of a string in a language pack
@ -3060,6 +3163,9 @@ premiumFeatureEmojiStatus = PremiumFeature;
//@description Profile photo animation on message and chat screens //@description Profile photo animation on message and chat screens
premiumFeatureAnimatedProfilePhoto = PremiumFeature; premiumFeatureAnimatedProfilePhoto = PremiumFeature;
//@description The ability to set a custom emoji as a forum topic icon
premiumFeatureForumTopicIcon = PremiumFeature;
//@description Allowed to set a premium appllication icons //@description Allowed to set a premium appllication icons
premiumFeatureAppIcons = PremiumFeature; premiumFeatureAppIcons = PremiumFeature;
@ -3153,7 +3259,7 @@ pushReceiverId id:int64 = PushReceiverId;
backgroundFillSolid color:int32 = BackgroundFill; backgroundFillSolid color:int32 = BackgroundFill;
//@description Describes a gradient fill of a background @top_color A top color of the background in the RGB24 format @bottom_color A bottom color of the background in the RGB24 format //@description Describes a gradient fill of a background @top_color A top color of the background in the RGB24 format @bottom_color A bottom color of the background in the RGB24 format
//@rotation_angle Clockwise rotation angle of the gradient, in degrees; 0-359. Must be always divisible by 45 //@rotation_angle Clockwise rotation angle of the gradient, in degrees; 0-359. Must always be divisible by 45
backgroundFillGradient top_color:int32 bottom_color:int32 rotation_angle:int32 = BackgroundFill; backgroundFillGradient top_color:int32 bottom_color:int32 rotation_angle:int32 = BackgroundFill;
//@description Describes a freeform gradient fill of a background @colors A list of 3 or 4 colors of the freeform gradients in the RGB24 format //@description Describes a freeform gradient fill of a background @colors A list of 3 or 4 colors of the freeform gradients in the RGB24 format
@ -3732,8 +3838,8 @@ internalLinkTypeFilterSettings = InternalLinkType;
//@bot_username Username of the bot that owns the game @game_short_name Short name of the game //@bot_username Username of the bot that owns the game @game_short_name Short name of the game
internalLinkTypeGame bot_username:string game_short_name:string = InternalLinkType; internalLinkTypeGame bot_username:string game_short_name:string = InternalLinkType;
//@description The link must be opened in an Instant View. Call getWebPageInstantView with the given URL to process the link @url URL to be passed to getWebPageInstantView //@description The link must be opened in an Instant View. Call getWebPageInstantView with the given URL to process the link @url URL to be passed to getWebPageInstantView @fallback_url An URL to open if getWebPageInstantView fails
internalLinkTypeInstantView url:string = InternalLinkType; internalLinkTypeInstantView url:string fallback_url:string = InternalLinkType;
//@description The link is a link to an invoice. Call getPaymentForm with the given invoice name to process the link @invoice_name Name of the invoice //@description The link is a link to an invoice. Call getPaymentForm with the given invoice name to process the link @invoice_name Name of the invoice
internalLinkTypeInvoice invoice_name:string = InternalLinkType; internalLinkTypeInvoice invoice_name:string = InternalLinkType;
@ -3813,11 +3919,11 @@ messageLink link:string is_public:Bool = MessageLink;
//@description Contains information about a link to a message in a chat //@description Contains information about a link to a message in a chat
//@is_public True, if the link is a public link for a message in a chat //@is_public True, if the link is a public link for a message in a chat
//@chat_id If found, identifier of the chat to which the message belongs, 0 otherwise //@chat_id If found, identifier of the chat to which the message belongs, 0 otherwise
//@message_thread_id If found, identifier of the message thread in which to open the message, or which to open in case of a missing message
//@message If found, the linked message; may be null //@message If found, the linked message; may be null
//@media_timestamp Timestamp from which the video/audio/video note/voice note playing must start, in seconds; 0 if not specified. The media can be in the message content or in its web page preview //@media_timestamp Timestamp from which the video/audio/video note/voice note playing must start, in seconds; 0 if not specified. The media can be in the message content or in its web page preview
//@for_album True, if the whole media album to which the message belongs is linked //@for_album True, if the whole media album to which the message belongs is linked
//@for_comment True, if the message is linked as a channel post comment or from a message thread messageLinkInfo is_public:Bool chat_id:int53 message_thread_id:int53 message:message media_timestamp:int32 for_album:Bool = MessageLinkInfo;
messageLinkInfo is_public:Bool chat_id:int53 message:message media_timestamp:int32 for_album:Bool for_comment:Bool = MessageLinkInfo;
//@description Contains a part of a file @data File bytes //@description Contains a part of a file @data File bytes
@ -4341,6 +4447,9 @@ updateChatFilters chat_filters:vector<chatFilterInfo> main_chat_list_position:in
//@description The number of online group members has changed. This update with non-zero number of online group members is sent only for currently opened chats. There is no guarantee that it will be sent just after the number of online users has changed @chat_id Identifier of the chat @online_member_count New number of online members in the chat, or 0 if unknown //@description The number of online group members has changed. This update with non-zero number of online group members is sent only for currently opened chats. There is no guarantee that it will be sent just after the number of online users has changed @chat_id Identifier of the chat @online_member_count New number of online members in the chat, or 0 if unknown
updateChatOnlineMemberCount chat_id:int53 online_member_count:int32 = Update; updateChatOnlineMemberCount chat_id:int53 online_member_count:int32 = Update;
//@description Basic information about a topic in a forum chat was changed @chat_id Chat identifier @info New information about the topic
updateForumTopicInfo chat_id:int53 info:forumTopicInfo = Update;
//@description Notification settings for some type of chats were updated @scope Types of chats for which notification settings were updated @notification_settings The new notification settings //@description Notification settings for some type of chats were updated @scope Types of chats for which notification settings were updated @notification_settings The new notification settings
updateScopeNotificationSettings scope:NotificationSettingsScope notification_settings:scopeNotificationSettings = Update; updateScopeNotificationSettings scope:NotificationSettingsScope notification_settings:scopeNotificationSettings = Update;
@ -4903,11 +5012,12 @@ getMessageThreadHistory chat_id:int53 message_id:int53 from_message_id:int53 off
//@chat_id Chat identifier @remove_from_chat_list Pass true to remove the chat from all chat lists @revoke Pass true to delete chat history for all users //@chat_id Chat identifier @remove_from_chat_list Pass true to remove the chat from all chat lists @revoke Pass true to delete chat history for all users
deleteChatHistory chat_id:int53 remove_from_chat_list:Bool revoke:Bool = Ok; deleteChatHistory chat_id:int53 remove_from_chat_list:Bool revoke:Bool = Ok;
//@description Deletes a chat along with all messages in the corresponding chat for all chat members. For group chats this will release the username and remove all members. Use the field chat.can_be_deleted_for_all_users to find whether the method can be applied to the chat @chat_id Chat identifier //@description Deletes a chat along with all messages in the corresponding chat for all chat members. For group chats this will release the usernames and remove all members. Use the field chat.can_be_deleted_for_all_users to find whether the method can be applied to the chat @chat_id Chat identifier
deleteChat chat_id:int53 = Ok; deleteChat chat_id:int53 = Ok;
//@description Searches for messages with given words in the chat. Returns the results in reverse chronological order, i.e. in order of decreasing message_id. Cannot be used in secret chats with a non-empty query //@description Searches for messages with given words in the chat. Returns the results in reverse chronological order, i.e. in order of decreasing message_id. Cannot be used in secret chats with a non-empty query
//-(searchSecretMessages must be used instead), or without an enabled message database. For optimal performance, the number of returned messages is chosen by TDLib and can be smaller than the specified limit //-(searchSecretMessages must be used instead), or without an enabled message database. For optimal performance, the number of returned messages is chosen by TDLib and can be smaller than the specified limit.
//-A combination of query, sender_id, filter and message_thread_id search criteria is expected to be supported, only if it is required for Telegram official application implementation
//@chat_id Identifier of the chat in which to search messages //@chat_id Identifier of the chat in which to search messages
//@query Query to search for //@query Query to search for
//@sender_id Identifier of the sender of messages to search for; pass null to search for messages from any sender. Not supported in secret chats //@sender_id Identifier of the sender of messages to search for; pass null to search for messages from any sender. Not supported in secret chats
@ -4979,6 +5089,12 @@ getChatMessageCalendar chat_id:int53 filter:SearchMessagesFilter from_message_id
//@description Returns approximate number of messages of the specified type in the chat @chat_id Identifier of the chat in which to count messages @filter Filter for message content; searchMessagesFilterEmpty is unsupported in this function @return_local Pass true to get the number of messages without sending network requests, or -1 if the number of messages is unknown locally //@description Returns approximate number of messages of the specified type in the chat @chat_id Identifier of the chat in which to count messages @filter Filter for message content; searchMessagesFilterEmpty is unsupported in this function @return_local Pass true to get the number of messages without sending network requests, or -1 if the number of messages is unknown locally
getChatMessageCount chat_id:int53 filter:SearchMessagesFilter return_local:Bool = Count; getChatMessageCount chat_id:int53 filter:SearchMessagesFilter return_local:Bool = Count;
//@description Returns approximate 1-based position of a message among messages, which can be found by the specified filter in the chat. Cannot be used in secret chats
//@chat_id Identifier of the chat in which to find message position @message_id Message identifier
//@filter Filter for message content; searchMessagesFilterEmpty, searchMessagesFilterUnreadMention, searchMessagesFilterUnreadReaction, and searchMessagesFilterFailedToSend are unsupported in this function
//@message_thread_id If not 0, only messages in the specified thread will be considered; supergroups only
getChatMessagePosition chat_id:int53 message_id:int53 filter:SearchMessagesFilter message_thread_id:int53 = Count;
//@description Returns all scheduled messages in a chat. The messages are returned in a reverse chronological order (i.e., in order of decreasing message_id) @chat_id Chat identifier //@description Returns all scheduled messages in a chat. The messages are returned in a reverse chronological order (i.e., in order of decreasing message_id) @chat_id Chat identifier
getChatScheduledMessages chat_id:int53 = Messages; getChatScheduledMessages chat_id:int53 = Messages;
@ -4989,8 +5105,8 @@ getChatScheduledMessages chat_id:int53 = Messages;
//@limit The maximum number of messages to be returned; must be positive and can't be greater than 100. For optimal performance, the number of returned messages is chosen by TDLib and can be smaller than the specified limit //@limit The maximum number of messages to be returned; must be positive and can't be greater than 100. For optimal performance, the number of returned messages is chosen by TDLib and can be smaller than the specified limit
getMessagePublicForwards chat_id:int53 message_id:int53 offset:string limit:int32 = FoundMessages; getMessagePublicForwards chat_id:int53 message_id:int53 offset:string limit:int32 = FoundMessages;
//@description Returns sponsored message to be shown in a chat; for channel chats only. Returns a 404 error if there is no sponsored message in the chat @chat_id Identifier of the chat //@description Returns sponsored messages to be shown in a chat; for channel chats only @chat_id Identifier of the chat
getChatSponsoredMessage chat_id:int53 = SponsoredMessage; getChatSponsoredMessages chat_id:int53 = SponsoredMessages;
//@description Removes an active notification from notification list. Needs to be called only if the notification is removed by the current user @notification_group_id Identifier of notification group to which the notification belongs @notification_id Identifier of removed notification //@description Removes an active notification from notification list. Needs to be called only if the notification is removed by the current user @notification_group_id Identifier of notification group to which the notification belongs @notification_id Identifier of removed notification
@ -5005,8 +5121,8 @@ removeNotificationGroup notification_group_id:int32 max_notification_id:int32 =
//@message_id Identifier of the message //@message_id Identifier of the message
//@media_timestamp If not 0, timestamp from which the video/audio/video note/voice note playing must start, in seconds. The media can be in the message content or in its web page preview //@media_timestamp If not 0, timestamp from which the video/audio/video note/voice note playing must start, in seconds. The media can be in the message content or in its web page preview
//@for_album Pass true to create a link for the whole media album //@for_album Pass true to create a link for the whole media album
//@for_comment Pass true to create a link to the message as a channel post comment, or from a message thread //@in_message_thread Pass true to create a link to the message as a channel post comment, in a message thread, or a forum topic
getMessageLink chat_id:int53 message_id:int53 media_timestamp:int32 for_album:Bool for_comment:Bool = MessageLink; getMessageLink chat_id:int53 message_id:int53 media_timestamp:int32 for_album:Bool in_message_thread:Bool = MessageLink;
//@description Returns an HTML code for embedding the message. Available only for messages in supergroups and channels with a username //@description Returns an HTML code for embedding the message. Available only for messages in supergroups and channels with a username
//@chat_id Identifier of the chat to which the message belongs //@chat_id Identifier of the chat to which the message belongs
@ -5024,17 +5140,17 @@ getMessageLinkInfo url:string = MessageLinkInfo;
//@to_language_code A two-letter ISO 639-1 language code of the language to which the message is translated //@to_language_code A two-letter ISO 639-1 language code of the language to which the message is translated
translateText text:string from_language_code:string to_language_code:string = Text; translateText text:string from_language_code:string to_language_code:string = Text;
//@description Recognizes speech in a voice note message. The message must be successfully sent and must not be scheduled. May return an error with a message "MSG_VOICE_TOO_LONG" if the voice note is too long to be recognized //@description Recognizes speech in a video note or a voice note message. The message must be successfully sent and must not be scheduled. May return an error with a message "MSG_VOICE_TOO_LONG" if media duration is too big to be recognized
//@chat_id Identifier of the chat to which the message belongs //@chat_id Identifier of the chat to which the message belongs
//@message_id Identifier of the message //@message_id Identifier of the message
recognizeSpeech chat_id:int53 message_id:int53 = Ok; recognizeSpeech chat_id:int53 message_id:int53 = Ok;
//@description Rates recognized speech in a voice note message @chat_id Identifier of the chat to which the message belongs @message_id Identifier of the message @is_good Pass true if the speech recognition is good //@description Rates recognized speech in a video note or a voice note message @chat_id Identifier of the chat to which the message belongs @message_id Identifier of the message @is_good Pass true if the speech recognition is good
rateSpeechRecognition chat_id:int53 message_id:int53 is_good:Bool = Ok; rateSpeechRecognition chat_id:int53 message_id:int53 is_good:Bool = Ok;
//@description Returns list of message sender identifiers, which can be used to send messages in a chat @chat_id Chat identifier //@description Returns list of message sender identifiers, which can be used to send messages in a chat @chat_id Chat identifier
getChatAvailableMessageSenders chat_id:int53 = MessageSenders; getChatAvailableMessageSenders chat_id:int53 = ChatMessageSenders;
//@description Selects a message sender to send messages in a chat @chat_id Chat identifier @message_sender_id New message sender for the chat //@description Selects a message sender to send messages in a chat @chat_id Chat identifier @message_sender_id New message sender for the chat
setChatMessageSender chat_id:int53 message_sender_id:MessageSender = Ok; setChatMessageSender chat_id:int53 message_sender_id:MessageSender = Ok;
@ -5073,13 +5189,14 @@ sendInlineQueryResultMessage chat_id:int53 message_thread_id:int53 reply_to_mess
//@description Forwards previously sent messages. Returns the forwarded messages in the same order as the message identifiers passed in message_ids. If a message can't be forwarded, null will be returned instead of the message //@description Forwards previously sent messages. Returns the forwarded messages in the same order as the message identifiers passed in message_ids. If a message can't be forwarded, null will be returned instead of the message
//@chat_id Identifier of the chat to which to forward messages //@chat_id Identifier of the chat to which to forward messages
//@message_thread_id If not 0, a message thread identifier in which the message will be sent; for forum threads only
//@from_chat_id Identifier of the chat from which to forward messages //@from_chat_id Identifier of the chat from which to forward messages
//@message_ids Identifiers of the messages to forward. Message identifiers must be in a strictly increasing order. At most 100 messages can be forwarded simultaneously //@message_ids Identifiers of the messages to forward. Message identifiers must be in a strictly increasing order. At most 100 messages can be forwarded simultaneously
//@options Options to be used to send the messages; pass null to use default options //@options Options to be used to send the messages; pass null to use default options
//@send_copy Pass true to copy content of the messages without reference to the original sender. Always true if the messages are forwarded to a secret chat or are local //@send_copy Pass true to copy content of the messages without reference to the original sender. Always true if the messages are forwarded to a secret chat or are local
//@remove_caption Pass true to remove media captions of message copies. Ignored if send_copy is false //@remove_caption Pass true to remove media captions of message copies. Ignored if send_copy is false
//@only_preview Pass true to get fake messages instead of actually forwarding them //@only_preview Pass true to get fake messages instead of actually forwarding them
forwardMessages chat_id:int53 from_chat_id:int53 message_ids:vector<int53> options:messageSendOptions send_copy:Bool remove_caption:Bool only_preview:Bool = Messages; forwardMessages chat_id:int53 message_thread_id:int53 from_chat_id:int53 message_ids:vector<int53> options:messageSendOptions send_copy:Bool remove_caption:Bool only_preview:Bool = Messages;
//@description Resends messages which failed to send. Can be called only for messages for which messageSendingStateFailed.can_retry is true and after specified in messageSendingStateFailed.retry_after time passed. //@description Resends messages which failed to send. 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-sent, 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-sent, null will be returned instead of the message //-If a message is re-sent, 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-sent, null will be returned instead of the message
@ -5183,11 +5300,39 @@ editInlineMessageReplyMarkup inline_message_id:string reply_markup:ReplyMarkup =
editMessageSchedulingState chat_id:int53 message_id:int53 scheduling_state:MessageSchedulingState = Ok; editMessageSchedulingState chat_id:int53 message_id:int53 scheduling_state:MessageSchedulingState = Ok;
//@description Returns list of custom emojis, which can be used as forum topic icon by all users
getForumTopicDefaultIcons = Stickers;
//@description Creates a topic in a forum supergroup chat; requires can_manage_topics rights in the supergroup
//@chat_id Identifier of the chat
//@name Name of the topic; 1-128 characters
//@icon Icon of the topic. Icon color must be one of 0x6FB9F0, 0xFFD67E, 0xCB86DB, 0x8EEE98, 0xFF93B2, or 0xFB6F5F. Telegram Premium users can use any custom emoji as topic icon, other users can use only a custom emoji returned by getForumTopicDefaultIcons
createForumTopic chat_id:int53 name:string icon:forumTopicIcon = ForumTopicInfo;
//@description Edits title and icon of a topic in a forum supergroup chat; requires can_manage_topics administrator rights in the supergroup unless the user is creator of the topic
//@chat_id Identifier of the chat
//@message_thread_id Message thread identifier of the forum topic
//@name New name of the topic; 1-128 characters
//@icon_custom_emoji_id Identifier of the new custom emoji for topic icon. Telegram Premium users can use any custom emoji, other users can use only a custom emoji returned by getForumTopicDefaultIcons
editForumTopic chat_id:int53 message_thread_id:int53 name:string icon_custom_emoji_id:int64 = Ok;
//@description Toggles whether a topic is closed in a forum supergroup chat; requires can_manage_topics administrator rights in the supergroup unless the user is creator of the topic
//@chat_id Identifier of the chat
//@message_thread_id Message thread identifier of the forum topic
//@is_closed Pass true to close the topic; pass false to reopen it
toggleForumTopicIsClosed chat_id:int53 message_thread_id:int53 is_closed:Bool = Ok;
//@description Deletes all messages in a forum topic; requires can_delete_messages administrator rights in the supergroup unless the user is creator of the topic, the topic has no messages from other users and has at most 11 messages
//@chat_id Identifier of the chat
//@message_thread_id Message thread identifier of the forum topic
deleteForumTopic chat_id:int53 message_thread_id:int53 = Ok;
//@description Returns information about a emoji reaction. Returns a 404 error if the reaction is not found @emoji Text representation of the reaction //@description Returns information about a emoji reaction. Returns a 404 error if the reaction is not found @emoji Text representation of the reaction
getEmojiReaction emoji:string = EmojiReaction; getEmojiReaction emoji:string = EmojiReaction;
//@description Returns TGS files with generic animations for custom emoji reactions //@description Returns TGS stickers with generic animations for custom emoji reactions
getCustomEmojiReactionAnimations = Files; getCustomEmojiReactionAnimations = Stickers;
//@description Returns reactions, which can be added to a message. The list can change after updateActiveEmojiReactions, updateChatAvailableReactions for the chat, or updateMessageInteractionInfo for the message //@description Returns reactions, which can be added to a message. The list can change after updateActiveEmojiReactions, updateChatAvailableReactions for the chat, or updateMessageInteractionInfo for the message
//@chat_id Identifier of the chat to which the message belongs //@chat_id Identifier of the chat to which the message belongs
@ -5224,10 +5369,10 @@ getMessageAddedReactions chat_id:int53 message_id:int53 reaction_type:ReactionTy
setDefaultReactionType reaction_type:ReactionType = Ok; setDefaultReactionType reaction_type:ReactionType = Ok;
//@description Returns all entities (mentions, hashtags, cashtags, bot commands, bank card numbers, URLs, and email addresses) contained in the text. Can be called synchronously @text The text in which to look for entites //@description Returns all entities (mentions, hashtags, cashtags, bot commands, bank card numbers, URLs, and email addresses) found in the text. Can be called synchronously @text The text in which to look for entites
getTextEntities text:string = TextEntities; getTextEntities text:string = TextEntities;
//@description Parses Bold, Italic, Underline, Strikethrough, Spoiler, CustomEmoji, Code, Pre, PreCode, TextUrl and MentionName entities contained in the text. Can be called synchronously @text The text to parse @parse_mode Text parse mode //@description Parses Bold, Italic, Underline, Strikethrough, Spoiler, CustomEmoji, Code, Pre, PreCode, TextUrl and MentionName entities from a marked-up text. Can be called synchronously @text The text to parse @parse_mode Text parse mode
parseTextEntities text:string parse_mode:TextParseMode = FormattedText; parseTextEntities text:string parse_mode:TextParseMode = FormattedText;
//@description Parses Markdown entities in a human-friendly format, ignoring markup errors. Can be called synchronously //@description Parses Markdown entities in a human-friendly format, ignoring markup errors. Can be called synchronously
@ -5333,8 +5478,9 @@ sendWebAppData bot_user_id:int53 button_text:string data:string = Ok;
//@url The URL from an inlineKeyboardButtonTypeWebApp button, a botMenuButton button, or an internalLinkTypeAttachmentMenuBot link, or an empty string otherwise //@url The URL from an inlineKeyboardButtonTypeWebApp button, a botMenuButton button, or an internalLinkTypeAttachmentMenuBot link, or an empty string otherwise
//@theme Preferred Web App theme; pass null to use the default theme //@theme Preferred Web App theme; pass null to use the default theme
//@application_name Short name of the application; 0-64 English letters, digits, and underscores //@application_name Short name of the application; 0-64 English letters, digits, and underscores
//@message_thread_id If not 0, a message thread identifier in which the message will be sent
//@reply_to_message_id Identifier of the replied message for the message sent by the Web App; 0 if none //@reply_to_message_id Identifier of the replied message for the message sent by the Web App; 0 if none
openWebApp chat_id:int53 bot_user_id:int53 url:string theme:themeParameters application_name:string reply_to_message_id:int53 = WebAppInfo; openWebApp chat_id:int53 bot_user_id:int53 url:string theme:themeParameters application_name:string message_thread_id:int53 reply_to_message_id:int53 = WebAppInfo;
//@description Informs TDLib that a previously opened Web App was closed @web_app_launch_id Identifier of Web App launch, received from openWebApp //@description Informs TDLib that a previously opened Web App was closed @web_app_launch_id Identifier of Web App launch, received from openWebApp
closeWebApp web_app_launch_id:int64 = Ok; closeWebApp web_app_launch_id:int64 = Ok;
@ -5418,9 +5564,15 @@ getExternalLink link:string allow_write_access:Bool = HttpUrl;
//@description Marks all mentions in a chat as read @chat_id Chat identifier //@description Marks all mentions in a chat as read @chat_id Chat identifier
readAllChatMentions chat_id:int53 = Ok; readAllChatMentions chat_id:int53 = Ok;
//@description Marks all reactions in a chat as read @chat_id Chat identifier //@description Marks all mentions in a forum topic as read @chat_id Chat identifier @message_thread_id Message thread identifier in which mentions are marked as read
readAllMessageThreadMentions chat_id:int53 message_thread_id:int53 = Ok;
//@description Marks all reactions in a chat or a forum topic as read @chat_id Chat identifier
readAllChatReactions chat_id:int53 = Ok; readAllChatReactions chat_id:int53 = Ok;
//@description Marks all reactions in a forum topic as read @chat_id Chat identifier @message_thread_id Message thread identifier in which reactions are marked as read
readAllMessageThreadReactions chat_id:int53 message_thread_id:int53 = Ok;
//@description Returns an existing chat corresponding to a given user @user_id User identifier @force Pass true to create the chat without a network request. In this case all information about the chat except its type, title and photo can be incorrect //@description Returns an existing chat corresponding to a given user @user_id User identifier @force Pass true to create the chat without a network request. In this case all information about the chat except its type, title and photo can be incorrect
createPrivateChat user_id:int53 force:Bool = Chat; createPrivateChat user_id:int53 force:Bool = Chat;
@ -5550,6 +5702,10 @@ unpinChatMessage chat_id:int53 message_id:int53 = Ok;
//@description Removes all pinned messages from a chat; requires can_pin_messages rights in the group or can_edit_messages rights in the channel @chat_id Identifier of the chat //@description Removes all pinned messages from a chat; requires can_pin_messages rights in the group or can_edit_messages rights in the channel @chat_id Identifier of the chat
unpinAllChatMessages chat_id:int53 = Ok; unpinAllChatMessages chat_id:int53 = Ok;
//@description Removes all pinned messages from a forum topic; requires can_pin_messages rights in the supergroup @chat_id Identifier of the chat
//@message_thread_id Message thread identifier in which messages will be unpinned
unpinAllMessageThreadMessages chat_id:int53 message_thread_id:int53 = Ok;
//@description Adds the current user as a new member to a chat. Private and secret chats can't be joined using this method. May return an error with a message "INVITE_REQUEST_SENT" if only a join request was created @chat_id Chat identifier //@description Adds the current user as a new member to a chat. Private and secret chats can't be joined using this method. May return an error with a message "INVITE_REQUEST_SENT" if only a join request was created @chat_id Chat identifier
joinChat chat_id:int53 = Ok; joinChat chat_id:int53 = Ok;
@ -5586,7 +5742,7 @@ transferChatOwnership chat_id:int53 user_id:int53 password:string = Ok;
//@description Returns information about a single member of a chat @chat_id Chat identifier @member_id Member identifier //@description Returns information about a single member of a chat @chat_id Chat identifier @member_id Member identifier
getChatMember chat_id:int53 member_id:MessageSender = ChatMember; getChatMember chat_id:int53 member_id:MessageSender = ChatMember;
//@description Searches for a specified query in the first name, last name and username of the members of a specified chat. Requires administrator rights in channels //@description Searches for a specified query in the first name, last name and usernames of the members of a specified chat. Requires administrator rights in channels
//@chat_id Chat identifier //@chat_id Chat identifier
//@query Query to search for //@query Query to search for
//@limit The maximum number of users to be returned; up to 200 //@limit The maximum number of users to be returned; up to 200
@ -6031,12 +6187,12 @@ sharePhoneNumber user_id:int53 = Ok;
getUserProfilePhotos user_id:int53 offset:int32 limit:int32 = ChatPhotos; getUserProfilePhotos user_id:int53 offset:int32 limit:int32 = ChatPhotos;
//@description Returns stickers from the installed sticker sets that correspond to a given emoji. If the emoji is non-empty, then favorite, recently used or trending stickers may also be returned //@description Returns stickers from the installed sticker sets that correspond to a given emoji or can be found by sticker-specific keywords. If the query is non-empty, then favorite, recently used or trending stickers may also be returned
//@sticker_type Type of the sticker sets to return //@sticker_type Type of the stickers to return
//@emoji String representation of emoji. If empty, returns all known installed stickers //@query Search query; an emoji or a keyword prefix. If empty, returns all known installed stickers
//@limit The maximum number of stickers to be returned //@limit The maximum number of stickers to be returned
//@chat_id Chat identifier for which to return stickers. Available custom emoji may be different for different chats //@chat_id Chat identifier for which to return stickers. Available custom emoji stickers may be different for different chats
getStickers sticker_type:StickerType emoji:string limit:int32 chat_id:int53 = Stickers; getStickers sticker_type:StickerType query:string limit:int32 chat_id:int53 = Stickers;
//@description Searches for stickers from public sticker sets that correspond to a given emoji @emoji String representation of emoji; must be non-empty @limit The maximum number of stickers to be returned; 0-100 //@description Searches for stickers from public sticker sets that correspond to a given emoji @emoji String representation of emoji; must be non-empty @limit The maximum number of stickers to be returned; 0-100
searchStickers emoji:string limit:int32 = Stickers; searchStickers emoji:string limit:int32 = Stickers;
@ -6160,9 +6316,15 @@ setName first_name:string last_name:string = Ok;
//@description Changes the bio of the current user @bio The new value of the user bio; 0-GetOption("bio_length_max") characters without line feeds //@description Changes the bio of the current user @bio The new value of the user bio; 0-GetOption("bio_length_max") characters without line feeds
setBio bio:string = Ok; setBio bio:string = Ok;
//@description Changes the username of the current user @username The new value of the username. Use an empty string to remove the username //@description Changes the editable username of the current user @username The new value of the username. Use an empty string to remove the username. The username can't be completely removed if there is another active or disabled username
setUsername username:string = Ok; setUsername username:string = Ok;
//@description Changes active state for a username of the current user. The editable username can't be disabled. May return an error with a message "USERNAMES_ACTIVE_TOO_MUCH" if the maximum number of active usernames has been reached @username The username to change @is_active Pass true to activate the username; pass false to disable it
toggleUsernameIsActive username:string is_active:Bool = Ok;
//@description Changes order of active usernames of the current user @usernames The new order of active usernames. All currently active usernames must be specified
reorderActiveUsernames usernames:vector<string> = Ok;
//@description Changes the emoji status of the current user; for Telegram Premium users only //@description Changes the emoji status of the current user; for Telegram Premium users only
//@emoji_status New emoji status; pass null to switch to the default badge //@emoji_status New emoji status; pass null to switch to the default badge
//@duration Duration of the status, in seconds; pass 0 to keep the status active until it will be changed manually //@duration Duration of the status, in seconds; pass 0 to keep the status active until it will be changed manually
@ -6242,9 +6404,18 @@ disconnectWebsite website_id:int64 = Ok;
disconnectAllWebsites = Ok; disconnectAllWebsites = Ok;
//@description Changes the username of a supergroup or channel, requires owner privileges in the supergroup or channel @supergroup_id Identifier of the supergroup or channel @username New value of the username. Use an empty string to remove the username //@description Changes the editable username of a supergroup or channel, requires owner privileges in the supergroup or channel @supergroup_id Identifier of the supergroup or channel @username New value of the username. Use an empty string to remove the username. The username can't be completely removed if there is another active or disabled username
setSupergroupUsername supergroup_id:int53 username:string = Ok; setSupergroupUsername supergroup_id:int53 username:string = Ok;
//@description Changes active state for a username of a supergroup or channel, requires owner privileges in the supergroup or channel. The editable username can't be disabled. May return an error with a message "USERNAMES_ACTIVE_TOO_MUCH" if the maximum number of active usernames has been reached @supergroup_id Identifier of the supergroup or channel @username The username to change @is_active Pass true to activate the username; pass false to disable it
toggleSupergroupUsernameIsActive supergroup_id:int53 username:string is_active:Bool = Ok;
//@description Disables all active non-editable usernames of a supergroup or channel, requires owner privileges in the supergroup or channel @supergroup_id Identifier of the supergroup or channel
disableAllSupergroupUsernames supergroup_id:int53 = Ok;
//@description Changes order of active usernames of a supergroup or channel, requires owner privileges in the supergroup or channel @supergroup_id Identifier of the supergroup or channel @usernames The new order of active usernames. All currently active usernames must be specified
reorderSupergroupActiveUsernames supergroup_id:int53 usernames:vector<string> = Ok;
//@description Changes the sticker set of a supergroup; requires can_change_info administrator right @supergroup_id Identifier of the supergroup @sticker_set_id New value of the supergroup sticker set identifier. Use 0 to remove the supergroup sticker set //@description Changes the sticker set of a supergroup; requires can_change_info administrator right @supergroup_id Identifier of the supergroup @sticker_set_id New value of the supergroup sticker set identifier. Use 0 to remove the supergroup sticker set
setSupergroupStickerSet supergroup_id:int53 sticker_set_id:int64 = Ok; setSupergroupStickerSet supergroup_id:int53 sticker_set_id:int64 = Ok;
@ -6260,6 +6431,9 @@ toggleSupergroupJoinByRequest supergroup_id:int53 join_by_request:Bool = Ok;
//@description Toggles whether the message history of a supergroup is available to new members; requires can_change_info administrator right @supergroup_id The identifier of the supergroup @is_all_history_available The new value of is_all_history_available //@description Toggles whether the message history of a supergroup is available to new members; requires can_change_info administrator right @supergroup_id The identifier of the supergroup @is_all_history_available The new value of is_all_history_available
toggleSupergroupIsAllHistoryAvailable supergroup_id:int53 is_all_history_available:Bool = Ok; toggleSupergroupIsAllHistoryAvailable supergroup_id:int53 is_all_history_available:Bool = Ok;
//@description Toggles whether the supergroup is a forum; requires owner privileges in the supergroup @supergroup_id Identifier of the supergroup @is_forum New value of is_forum. A supergroup can be converted to a forum, only if it has at least GetOption("forum_member_count_min") members
toggleSupergroupIsForum supergroup_id:int53 is_forum:Bool = Ok;
//@description Upgrades supergroup to a broadcast group; requires owner privileges in the supergroup @supergroup_id Identifier of the supergroup //@description Upgrades supergroup to a broadcast group; requires owner privileges in the supergroup @supergroup_id Identifier of the supergroup
toggleSupergroupIsBroadcastGroup supergroup_id:int53 = Ok; toggleSupergroupIsBroadcastGroup supergroup_id:int53 = Ok;