mirror of
https://github.com/c0re100/gotdlib.git
synced 2026-02-22 12:40:17 +01:00
Update to TDLib 1.8.9
This commit is contained in:
parent
abdd0dfd48
commit
712b01c11c
4 changed files with 920 additions and 122 deletions
|
|
@ -528,7 +528,7 @@ func (client *Client) ConfirmQrCodeAuthentication(req *ConfirmQrCodeAuthenticati
|
|||
return UnmarshalSession(result.Data)
|
||||
}
|
||||
|
||||
// Returns all updates needed to restore current TDLib state, i.e. all actual UpdateAuthorizationState/UpdateUser/UpdateNewChat and others. This is especially useful if TDLib is run in a separate process. Can be called before initialization
|
||||
// Returns all updates needed to restore current TDLib state, i.e. all actual updateAuthorizationState/updateUser/updateNewChat and others. This is especially useful if TDLib is run in a separate process. Can be called before initialization
|
||||
func (client *Client) GetCurrentState() (*Updates, error) {
|
||||
result, err := client.Send(Request{
|
||||
meta: meta{
|
||||
|
|
@ -1268,7 +1268,7 @@ type GetRepliedMessageRequest struct {
|
|||
MessageId int64 `json:"message_id"`
|
||||
}
|
||||
|
||||
// Returns information about a message that is replied by a given message. Also returns the pinned message, the game message, and the invoice message for messages of the types messagePinMessage, messageGameScore, and messagePaymentSuccessful respectively
|
||||
// Returns information about a message that is replied by a given message. Also returns the pinned message, the game message, the invoice message, and the topic creation message for messages of the types messagePinMessage, messageGameScore, messagePaymentSuccessful, and topic messages without replied message respectively
|
||||
func (client *Client) GetRepliedMessage(req *GetRepliedMessageRequest) (*Message, error) {
|
||||
result, err := client.Send(Request{
|
||||
meta: meta{
|
||||
|
|
@ -1875,8 +1875,11 @@ func (client *Client) CheckChatUsername(req *CheckChatUsernameRequest) (CheckCha
|
|||
case TypeCheckChatUsernameResultUsernameOccupied:
|
||||
return UnmarshalCheckChatUsernameResultUsernameOccupied(result.Data)
|
||||
|
||||
case TypeCheckChatUsernameResultPublicChatsTooMuch:
|
||||
return UnmarshalCheckChatUsernameResultPublicChatsTooMuch(result.Data)
|
||||
case TypeCheckChatUsernameResultUsernamePurchasable:
|
||||
return UnmarshalCheckChatUsernameResultUsernamePurchasable(result.Data)
|
||||
|
||||
case TypeCheckChatUsernameResultPublicChatsTooMany:
|
||||
return UnmarshalCheckChatUsernameResultPublicChatsTooMany(result.Data)
|
||||
|
||||
case TypeCheckChatUsernameResultPublicGroupsUnavailable:
|
||||
return UnmarshalCheckChatUsernameResultPublicGroupsUnavailable(result.Data)
|
||||
|
|
@ -3091,7 +3094,7 @@ type SendInlineQueryResultMessageRequest struct {
|
|||
QueryId JsonInt64 `json:"query_id"`
|
||||
// Identifier of the inline result
|
||||
ResultId string `json:"result_id"`
|
||||
// Pass true to hide the bot, via which the message is sent. Can be used only for bots GetOption("animation_search_bot_username"), GetOption("photo_search_bot_username"), and GetOption("venue_search_bot_username")
|
||||
// Pass true to hide the bot, via which the message is sent. Can be used only for bots getOption("animation_search_bot_username"), getOption("photo_search_bot_username"), and getOption("venue_search_bot_username")
|
||||
HideViaBot bool `json:"hide_via_bot"`
|
||||
}
|
||||
|
||||
|
|
@ -3476,7 +3479,7 @@ type EditMessageCaptionRequest struct {
|
|||
MessageId int64 `json:"message_id"`
|
||||
// The new message reply markup; pass null if none; for bots only
|
||||
ReplyMarkup ReplyMarkup `json:"reply_markup"`
|
||||
// New message content caption; 0-GetOption("message_caption_length_max") characters; pass null to remove caption
|
||||
// New message content caption; 0-getOption("message_caption_length_max") characters; pass null to remove caption
|
||||
Caption *FormattedText `json:"caption"`
|
||||
}
|
||||
|
||||
|
|
@ -3643,7 +3646,7 @@ type EditInlineMessageCaptionRequest struct {
|
|||
InlineMessageId string `json:"inline_message_id"`
|
||||
// The new message reply markup; pass null if none
|
||||
ReplyMarkup ReplyMarkup `json:"reply_markup"`
|
||||
// New message content caption; pass null to remove caption; 0-GetOption("message_caption_length_max") characters
|
||||
// New message content caption; pass null to remove caption; 0-getOption("message_caption_length_max") characters
|
||||
Caption *FormattedText `json:"caption"`
|
||||
}
|
||||
|
||||
|
|
@ -3787,9 +3790,11 @@ type EditForumTopicRequest struct {
|
|||
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
|
||||
// New name of the topic; 0-128 characters. If empty, the previous topic name is kept
|
||||
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
|
||||
// Pass true to edit the icon of the topic. Icon of the General topic can't be edited
|
||||
EditIconCustomEmoji bool `json:"edit_icon_custom_emoji"`
|
||||
// Identifier of the new custom emoji for topic icon; pass 0 to remove the custom emoji. Ignored if edit_icon_custom_emoji is false. 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"`
|
||||
}
|
||||
|
||||
|
|
@ -3803,6 +3808,7 @@ func (client *Client) EditForumTopic(req *EditForumTopicRequest) (*Ok, error) {
|
|||
"chat_id": req.ChatId,
|
||||
"message_thread_id": req.MessageThreadId,
|
||||
"name": req.Name,
|
||||
"edit_icon_custom_emoji": req.EditIconCustomEmoji,
|
||||
"icon_custom_emoji_id": req.IconCustomEmojiId,
|
||||
},
|
||||
})
|
||||
|
|
@ -3817,6 +3823,137 @@ func (client *Client) EditForumTopic(req *EditForumTopicRequest) (*Ok, error) {
|
|||
return UnmarshalOk(result.Data)
|
||||
}
|
||||
|
||||
type GetForumTopicRequest struct {
|
||||
// Identifier of the chat
|
||||
ChatId int64 `json:"chat_id"`
|
||||
// Message thread identifier of the forum topic
|
||||
MessageThreadId int64 `json:"message_thread_id"`
|
||||
}
|
||||
|
||||
// Returns information about a forum topic
|
||||
func (client *Client) GetForumTopic(req *GetForumTopicRequest) (*ForumTopic, error) {
|
||||
result, err := client.Send(Request{
|
||||
meta: meta{
|
||||
Type: "getForumTopic",
|
||||
},
|
||||
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 UnmarshalForumTopic(result.Data)
|
||||
}
|
||||
|
||||
type GetForumTopicLinkRequest struct {
|
||||
// Identifier of the chat
|
||||
ChatId int64 `json:"chat_id"`
|
||||
// Message thread identifier of the forum topic
|
||||
MessageThreadId int64 `json:"message_thread_id"`
|
||||
}
|
||||
|
||||
// Returns an HTTPS link to a topic in a forum chat. This is an offline request
|
||||
func (client *Client) GetForumTopicLink(req *GetForumTopicLinkRequest) (*HttpUrl, error) {
|
||||
result, err := client.Send(Request{
|
||||
meta: meta{
|
||||
Type: "getForumTopicLink",
|
||||
},
|
||||
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 UnmarshalHttpUrl(result.Data)
|
||||
}
|
||||
|
||||
type GetForumTopicsRequest struct {
|
||||
// Identifier of the forum chat
|
||||
ChatId int64 `json:"chat_id"`
|
||||
// Query to search for in the forum topic's name
|
||||
Query string `json:"query"`
|
||||
// The date starting from which the results need to be fetched. Use 0 or any date in the future to get results from the last topic
|
||||
OffsetDate int32 `json:"offset_date"`
|
||||
// The message identifier of the last message in the last found topic, or 0 for the first request
|
||||
OffsetMessageId int64 `json:"offset_message_id"`
|
||||
// The message thread identifier of the last found topic, or 0 for the first request
|
||||
OffsetMessageThreadId int64 `json:"offset_message_thread_id"`
|
||||
// The maximum number of forum topics to be returned; up to 100. For optimal performance, the number of returned forum topics is chosen by TDLib and can be smaller than the specified limit
|
||||
Limit int32 `json:"limit"`
|
||||
}
|
||||
|
||||
// Returns found forum topics in a forum chat. This is a temporary method for getting information about topic list from the server
|
||||
func (client *Client) GetForumTopics(req *GetForumTopicsRequest) (*ForumTopics, error) {
|
||||
result, err := client.Send(Request{
|
||||
meta: meta{
|
||||
Type: "getForumTopics",
|
||||
},
|
||||
Data: map[string]interface{}{
|
||||
"chat_id": req.ChatId,
|
||||
"query": req.Query,
|
||||
"offset_date": req.OffsetDate,
|
||||
"offset_message_id": req.OffsetMessageId,
|
||||
"offset_message_thread_id": req.OffsetMessageThreadId,
|
||||
"limit": req.Limit,
|
||||
},
|
||||
})
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
if result.Type == "error" {
|
||||
return nil, buildResponseError(result.Data)
|
||||
}
|
||||
|
||||
return UnmarshalForumTopics(result.Data)
|
||||
}
|
||||
|
||||
type SetForumTopicNotificationSettingsRequest struct {
|
||||
// Chat identifier
|
||||
ChatId int64 `json:"chat_id"`
|
||||
// Message thread identifier of the forum topic
|
||||
MessageThreadId int64 `json:"message_thread_id"`
|
||||
// New notification settings for the forum topic. If the topic is muted for more than 366 days, it is considered to be muted forever
|
||||
NotificationSettings *ChatNotificationSettings `json:"notification_settings"`
|
||||
}
|
||||
|
||||
// Changes the notification settings of a forum topic
|
||||
func (client *Client) SetForumTopicNotificationSettings(req *SetForumTopicNotificationSettingsRequest) (*Ok, error) {
|
||||
result, err := client.Send(Request{
|
||||
meta: meta{
|
||||
Type: "setForumTopicNotificationSettings",
|
||||
},
|
||||
Data: map[string]interface{}{
|
||||
"chat_id": req.ChatId,
|
||||
"message_thread_id": req.MessageThreadId,
|
||||
"notification_settings": req.NotificationSettings,
|
||||
},
|
||||
})
|
||||
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"`
|
||||
|
|
@ -3849,6 +3986,35 @@ func (client *Client) ToggleForumTopicIsClosed(req *ToggleForumTopicIsClosedRequ
|
|||
return UnmarshalOk(result.Data)
|
||||
}
|
||||
|
||||
type ToggleGeneralForumTopicIsHiddenRequest struct {
|
||||
// Identifier of the chat
|
||||
ChatId int64 `json:"chat_id"`
|
||||
// Pass true to hide and close the General topic; pass false to unhide it
|
||||
IsHidden bool `json:"is_hidden"`
|
||||
}
|
||||
|
||||
// Toggles whether a General topic is hidden in a forum supergroup chat; requires can_manage_topics administrator rights in the supergroup
|
||||
func (client *Client) ToggleGeneralForumTopicIsHidden(req *ToggleGeneralForumTopicIsHiddenRequest) (*Ok, error) {
|
||||
result, err := client.Send(Request{
|
||||
meta: meta{
|
||||
Type: "toggleGeneralForumTopicIsHidden",
|
||||
},
|
||||
Data: map[string]interface{}{
|
||||
"chat_id": req.ChatId,
|
||||
"is_hidden": req.IsHidden,
|
||||
},
|
||||
})
|
||||
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"`
|
||||
|
|
@ -5224,7 +5390,7 @@ type DeleteChatReplyMarkupRequest struct {
|
|||
MessageId int64 `json:"message_id"`
|
||||
}
|
||||
|
||||
// Deletes the default reply markup from a chat. Must be called after a one-time keyboard or a ForceReply reply markup has been used. UpdateChatReplyMarkup will be sent if the reply markup is changed
|
||||
// Deletes the default reply markup from a chat. Must be called after a one-time keyboard or a replyMarkupForceReply reply markup has been used. An updateChatReplyMarkup update will be sent if the reply markup is changed
|
||||
func (client *Client) DeleteChatReplyMarkup(req *DeleteChatReplyMarkupRequest) (*Ok, error) {
|
||||
result, err := client.Send(Request{
|
||||
meta: meta{
|
||||
|
|
@ -5543,6 +5709,9 @@ func (client *Client) GetInternalLinkType(req *GetInternalLinkTypeRequest) (Inte
|
|||
case TypeInternalLinkTypeUserPhoneNumber:
|
||||
return UnmarshalInternalLinkTypeUserPhoneNumber(result.Data)
|
||||
|
||||
case TypeInternalLinkTypeUserToken:
|
||||
return UnmarshalInternalLinkTypeUserToken(result.Data)
|
||||
|
||||
case TypeInternalLinkTypeVideoChat:
|
||||
return UnmarshalInternalLinkTypeVideoChat(result.Data)
|
||||
|
||||
|
|
@ -5843,6 +6012,8 @@ type CreateNewBasicGroupChatRequest struct {
|
|||
UserIds []int64 `json:"user_ids"`
|
||||
// Title of the new basic group; 1-128 characters
|
||||
Title string `json:"title"`
|
||||
// Message TTL value, in seconds; must be from 0 up to 365 * 86400 and be divisible by 86400. If 0, then messages aren't deleted automatically
|
||||
MessageTtl int32 `json:"message_ttl"`
|
||||
}
|
||||
|
||||
// Creates a new basic group and sends a corresponding messageBasicGroupChatCreate. Returns the newly created chat
|
||||
|
|
@ -5854,6 +6025,7 @@ func (client *Client) CreateNewBasicGroupChat(req *CreateNewBasicGroupChatReques
|
|||
Data: map[string]interface{}{
|
||||
"user_ids": req.UserIds,
|
||||
"title": req.Title,
|
||||
"message_ttl": req.MessageTtl,
|
||||
},
|
||||
})
|
||||
if err != nil {
|
||||
|
|
@ -5876,6 +6048,8 @@ type CreateNewSupergroupChatRequest struct {
|
|||
Description string `json:"description"`
|
||||
// Chat location if a location-based supergroup is being created; pass null to create an ordinary supergroup chat
|
||||
Location *ChatLocation `json:"location"`
|
||||
// Message TTL value, in seconds; must be from 0 up to 365 * 86400 and be divisible by 86400. If 0, then messages aren't deleted automatically
|
||||
MessageTtl int32 `json:"message_ttl"`
|
||||
// Pass true to create a supergroup for importing messages using importMessage
|
||||
ForImport bool `json:"for_import"`
|
||||
}
|
||||
|
|
@ -5891,6 +6065,7 @@ func (client *Client) CreateNewSupergroupChat(req *CreateNewSupergroupChatReques
|
|||
"is_channel": req.IsChannel,
|
||||
"description": req.Description,
|
||||
"location": req.Location,
|
||||
"message_ttl": req.MessageTtl,
|
||||
"for_import": req.ForImport,
|
||||
},
|
||||
})
|
||||
|
|
@ -6043,7 +6218,7 @@ type CreateChatFilterRequest struct {
|
|||
Filter *ChatFilter `json:"filter"`
|
||||
}
|
||||
|
||||
// Creates new chat filter. Returns information about the created chat filter. There can be up to GetOption("chat_filter_count_max") chat filters, but the limit can be increased with Telegram Premium
|
||||
// Creates new chat filter. Returns information about the created chat filter. There can be up to getOption("chat_filter_count_max") chat filters, but the limit can be increased with Telegram Premium
|
||||
func (client *Client) CreateChatFilter(req *CreateChatFilterRequest) (*ChatFilterInfo, error) {
|
||||
result, err := client.Send(Request{
|
||||
meta: meta{
|
||||
|
|
@ -6259,11 +6434,11 @@ func (client *Client) SetChatPhoto(req *SetChatPhotoRequest) (*Ok, error) {
|
|||
type SetChatMessageTtlRequest struct {
|
||||
// Chat identifier
|
||||
ChatId int64 `json:"chat_id"`
|
||||
// New TTL value, in seconds; unless the chat is secret, it must be from 0 up to 365 * 86400 and be divisible by 86400
|
||||
// New TTL value, in seconds; unless the chat is secret, it must be from 0 up to 365 * 86400 and be divisible by 86400. If 0, then messages aren't deleted automatically
|
||||
Ttl int32 `json:"ttl"`
|
||||
}
|
||||
|
||||
// Changes the message TTL in a chat. Requires can_delete_messages administrator right in basic groups, supergroups and channels Message TTL can't be changed in a chat with the current user (Saved Messages) and the chat 777000 (Telegram).
|
||||
// Changes the message TTL in a chat. Requires change_info administrator right in basic groups, supergroups and channels Message TTL can't be changed in a chat with the current user (Saved Messages) and the chat 777000 (Telegram).
|
||||
func (client *Client) SetChatMessageTtl(req *SetChatMessageTtlRequest) (*Ok, error) {
|
||||
result, err := client.Send(Request{
|
||||
meta: meta{
|
||||
|
|
@ -7355,7 +7530,7 @@ type ToggleChatIsPinnedRequest struct {
|
|||
IsPinned bool `json:"is_pinned"`
|
||||
}
|
||||
|
||||
// Changes the pinned state of a chat. There can be up to GetOption("pinned_chat_count_max")/GetOption("pinned_archived_chat_count_max") pinned non-secret chats and the same number of secret chats in the main/archive chat list. The limit can be increased with Telegram Premium
|
||||
// Changes the pinned state of a chat. There can be up to getOption("pinned_chat_count_max")/getOption("pinned_archived_chat_count_max") pinned non-secret chats and the same number of secret chats in the main/archive chat list. The limit can be increased with Telegram Premium
|
||||
func (client *Client) ToggleChatIsPinned(req *ToggleChatIsPinnedRequest) (*Ok, error) {
|
||||
result, err := client.Send(Request{
|
||||
meta: meta{
|
||||
|
|
@ -9157,7 +9332,7 @@ func (client *Client) StartGroupCallScreenSharing(req *StartGroupCallScreenShari
|
|||
type ToggleGroupCallScreenSharingIsPausedRequest struct {
|
||||
// Group call identifier
|
||||
GroupCallId int32 `json:"group_call_id"`
|
||||
// True if screen sharing is paused
|
||||
// True, if screen sharing is paused
|
||||
IsPaused bool `json:"is_paused"`
|
||||
}
|
||||
|
||||
|
|
@ -11115,7 +11290,7 @@ func (client *Client) SetName(req *SetNameRequest) (*Ok, error) {
|
|||
}
|
||||
|
||||
type SetBioRequest struct {
|
||||
// The new value of the user bio; 0-GetOption("bio_length_max") characters without line feeds
|
||||
// The new value of the user bio; 0-getOption("bio_length_max") characters without line feeds
|
||||
Bio string `json:"bio"`
|
||||
}
|
||||
|
||||
|
|
@ -11255,7 +11430,7 @@ type SetLocationRequest struct {
|
|||
Location *Location `json:"location"`
|
||||
}
|
||||
|
||||
// Changes the location of the current user. Needs to be called if GetOption("is_location_visible") is true and location changes for more than 1 kilometer
|
||||
// Changes the location of the current user. Needs to be called if getOption("is_location_visible") is true and location changes for more than 1 kilometer
|
||||
func (client *Client) SetLocation(req *SetLocationRequest) (*Ok, error) {
|
||||
result, err := client.Send(Request{
|
||||
meta: meta{
|
||||
|
|
@ -11350,6 +11525,51 @@ func (client *Client) CheckChangePhoneNumberCode(req *CheckChangePhoneNumberCode
|
|||
return UnmarshalOk(result.Data)
|
||||
}
|
||||
|
||||
// Returns an HTTPS link, which can be used to get information about the current user
|
||||
func (client *Client) GetUserLink() (*UserLink, error) {
|
||||
result, err := client.Send(Request{
|
||||
meta: meta{
|
||||
Type: "getUserLink",
|
||||
},
|
||||
Data: map[string]interface{}{},
|
||||
})
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
if result.Type == "error" {
|
||||
return nil, buildResponseError(result.Data)
|
||||
}
|
||||
|
||||
return UnmarshalUserLink(result.Data)
|
||||
}
|
||||
|
||||
type SearchUserByTokenRequest struct {
|
||||
// Token to search for
|
||||
Token string `json:"token"`
|
||||
}
|
||||
|
||||
// Searches a user by a token from the user's link
|
||||
func (client *Client) SearchUserByToken(req *SearchUserByTokenRequest) (*User, error) {
|
||||
result, err := client.Send(Request{
|
||||
meta: meta{
|
||||
Type: "searchUserByToken",
|
||||
},
|
||||
Data: map[string]interface{}{
|
||||
"token": req.Token,
|
||||
},
|
||||
})
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
if result.Type == "error" {
|
||||
return nil, buildResponseError(result.Data)
|
||||
}
|
||||
|
||||
return UnmarshalUser(result.Data)
|
||||
}
|
||||
|
||||
type SetCommandsRequest struct {
|
||||
// The scope to which the commands are relevant; pass null to change commands in the default bot command scope
|
||||
Scope BotCommandScope `json:"scope"`
|
||||
|
|
@ -12020,10 +12240,39 @@ func (client *Client) ToggleSupergroupIsAllHistoryAvailable(req *ToggleSupergrou
|
|||
return UnmarshalOk(result.Data)
|
||||
}
|
||||
|
||||
type ToggleSupergroupIsAggressiveAntiSpamEnabledRequest struct {
|
||||
// The identifier of the supergroup, which isn't a broadcast group
|
||||
SupergroupId int64 `json:"supergroup_id"`
|
||||
// The new value of is_aggressive_anti_spam_enabled
|
||||
IsAggressiveAntiSpamEnabled bool `json:"is_aggressive_anti_spam_enabled"`
|
||||
}
|
||||
|
||||
// Toggles whether aggressive anti-spam checks are enabled in the supergroup; requires can_delete_messages administrator right. Can be called only if the supergroup has at least getOption("aggressive_anti_spam_supergroup_member_count_min") members
|
||||
func (client *Client) ToggleSupergroupIsAggressiveAntiSpamEnabled(req *ToggleSupergroupIsAggressiveAntiSpamEnabledRequest) (*Ok, error) {
|
||||
result, err := client.Send(Request{
|
||||
meta: meta{
|
||||
Type: "toggleSupergroupIsAggressiveAntiSpamEnabled",
|
||||
},
|
||||
Data: map[string]interface{}{
|
||||
"supergroup_id": req.SupergroupId,
|
||||
"is_aggressive_anti_spam_enabled": req.IsAggressiveAntiSpamEnabled,
|
||||
},
|
||||
})
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
if result.Type == "error" {
|
||||
return nil, buildResponseError(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
|
||||
// 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"`
|
||||
}
|
||||
|
||||
|
|
@ -12104,6 +12353,35 @@ func (client *Client) ReportSupergroupSpam(req *ReportSupergroupSpamRequest) (*O
|
|||
return UnmarshalOk(result.Data)
|
||||
}
|
||||
|
||||
type ReportSupergroupAntiSpamFalsePositiveRequest struct {
|
||||
// Supergroup identifier
|
||||
SupergroupId int64 `json:"supergroup_id"`
|
||||
// Identifier of the erroneously deleted message
|
||||
MessageId int64 `json:"message_id"`
|
||||
}
|
||||
|
||||
// Reports a false deletion of a message by aggressive anti-spam checks; requires administrator rights in the supergroup. Can be called only for messages from chatEventMessageDeleted with can_report_anti_spam_false_positive == true
|
||||
func (client *Client) ReportSupergroupAntiSpamFalsePositive(req *ReportSupergroupAntiSpamFalsePositiveRequest) (*Ok, error) {
|
||||
result, err := client.Send(Request{
|
||||
meta: meta{
|
||||
Type: "reportSupergroupAntiSpamFalsePositive",
|
||||
},
|
||||
Data: map[string]interface{}{
|
||||
"supergroup_id": req.SupergroupId,
|
||||
"message_id": req.MessageId,
|
||||
},
|
||||
})
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
if result.Type == "error" {
|
||||
return nil, buildResponseError(result.Data)
|
||||
}
|
||||
|
||||
return UnmarshalOk(result.Data)
|
||||
}
|
||||
|
||||
type GetSupergroupMembersRequest struct {
|
||||
// Identifier of the supergroup or channel
|
||||
SupergroupId int64 `json:"supergroup_id"`
|
||||
|
|
@ -12309,7 +12587,7 @@ func (client *Client) SendPaymentForm(req *SendPaymentFormRequest) (*PaymentResu
|
|||
}
|
||||
|
||||
type GetPaymentReceiptRequest struct {
|
||||
// Chat identifier of the PaymentSuccessful message
|
||||
// Chat identifier of the messagePaymentSuccessful message
|
||||
ChatId int64 `json:"chat_id"`
|
||||
// Message identifier
|
||||
MessageId int64 `json:"message_id"`
|
||||
|
|
@ -13156,6 +13434,51 @@ func (client *Client) DeleteAccount(req *DeleteAccountRequest) (*Ok, error) {
|
|||
return UnmarshalOk(result.Data)
|
||||
}
|
||||
|
||||
type SetDefaultMessageTtlRequest struct {
|
||||
// New message TTL; must be from 0 up to 365 * 86400 and be divisible by 86400. If 0, then messages aren't deleted automatically
|
||||
Ttl *MessageTtl `json:"ttl"`
|
||||
}
|
||||
|
||||
// Changes the default message Time To Live setting (self-destruct timer) for new chats
|
||||
func (client *Client) SetDefaultMessageTtl(req *SetDefaultMessageTtlRequest) (*Ok, error) {
|
||||
result, err := client.Send(Request{
|
||||
meta: meta{
|
||||
Type: "setDefaultMessageTtl",
|
||||
},
|
||||
Data: map[string]interface{}{
|
||||
"ttl": req.Ttl,
|
||||
},
|
||||
})
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
if result.Type == "error" {
|
||||
return nil, buildResponseError(result.Data)
|
||||
}
|
||||
|
||||
return UnmarshalOk(result.Data)
|
||||
}
|
||||
|
||||
// Returns default message Time To Live setting (self-destruct timer) for new chats
|
||||
func (client *Client) GetDefaultMessageTtl() (*MessageTtl, error) {
|
||||
result, err := client.Send(Request{
|
||||
meta: meta{
|
||||
Type: "getDefaultMessageTtl",
|
||||
},
|
||||
Data: map[string]interface{}{},
|
||||
})
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
if result.Type == "error" {
|
||||
return nil, buildResponseError(result.Data)
|
||||
}
|
||||
|
||||
return UnmarshalMessageTtl(result.Data)
|
||||
}
|
||||
|
||||
type RemoveChatActionBarRequest struct {
|
||||
// Chat identifier
|
||||
ChatId int64 `json:"chat_id"`
|
||||
|
|
|
|||
349
client/type.go
349
client/type.go
|
|
@ -221,6 +221,7 @@ const (
|
|||
ClassForumTopicIcon = "ForumTopicIcon"
|
||||
ClassForumTopicInfo = "ForumTopicInfo"
|
||||
ClassForumTopic = "ForumTopic"
|
||||
ClassForumTopics = "ForumTopics"
|
||||
ClassPageBlockCaption = "PageBlockCaption"
|
||||
ClassPageBlockListItem = "PageBlockListItem"
|
||||
ClassPageBlockTableCell = "PageBlockTableCell"
|
||||
|
|
@ -294,6 +295,7 @@ const (
|
|||
ClassAttachmentMenuBot = "AttachmentMenuBot"
|
||||
ClassSentWebAppMessage = "SentWebAppMessage"
|
||||
ClassHttpUrl = "HttpUrl"
|
||||
ClassUserLink = "UserLink"
|
||||
ClassInlineQueryResults = "InlineQueryResults"
|
||||
ClassCallbackQueryAnswer = "CallbackQueryAnswer"
|
||||
ClassCustomRequestResult = "CustomRequestResult"
|
||||
|
|
@ -323,6 +325,7 @@ const (
|
|||
ClassJsonObjectMember = "JsonObjectMember"
|
||||
ClassUserPrivacySettingRules = "UserPrivacySettingRules"
|
||||
ClassAccountTtl = "AccountTtl"
|
||||
ClassMessageTtl = "MessageTtl"
|
||||
ClassSession = "Session"
|
||||
ClassSessions = "Sessions"
|
||||
ClassConnectedWebsite = "ConnectedWebsite"
|
||||
|
|
@ -377,6 +380,7 @@ const (
|
|||
TypeAuthenticationCodeTypeCall = "authenticationCodeTypeCall"
|
||||
TypeAuthenticationCodeTypeFlashCall = "authenticationCodeTypeFlashCall"
|
||||
TypeAuthenticationCodeTypeMissedCall = "authenticationCodeTypeMissedCall"
|
||||
TypeAuthenticationCodeTypeFragment = "authenticationCodeTypeFragment"
|
||||
TypeAuthenticationCodeInfo = "authenticationCodeInfo"
|
||||
TypeEmailAddressAuthenticationCodeInfo = "emailAddressAuthenticationCodeInfo"
|
||||
TypeEmailAddressAuthenticationCode = "emailAddressAuthenticationCode"
|
||||
|
|
@ -611,6 +615,7 @@ const (
|
|||
TypeForumTopicIcon = "forumTopicIcon"
|
||||
TypeForumTopicInfo = "forumTopicInfo"
|
||||
TypeForumTopic = "forumTopic"
|
||||
TypeForumTopics = "forumTopics"
|
||||
TypeRichTextPlain = "richTextPlain"
|
||||
TypeRichTextBold = "richTextBold"
|
||||
TypeRichTextItalic = "richTextItalic"
|
||||
|
|
@ -814,6 +819,7 @@ const (
|
|||
TypeMessageForumTopicCreated = "messageForumTopicCreated"
|
||||
TypeMessageForumTopicEdited = "messageForumTopicEdited"
|
||||
TypeMessageForumTopicIsClosedToggled = "messageForumTopicIsClosedToggled"
|
||||
TypeMessageForumTopicIsHiddenToggled = "messageForumTopicIsHiddenToggled"
|
||||
TypeMessageCustomServiceAction = "messageCustomServiceAction"
|
||||
TypeMessageGameScore = "messageGameScore"
|
||||
TypeMessagePaymentSuccessful = "messagePaymentSuccessful"
|
||||
|
|
@ -968,6 +974,7 @@ const (
|
|||
TypeAttachmentMenuBot = "attachmentMenuBot"
|
||||
TypeSentWebAppMessage = "sentWebAppMessage"
|
||||
TypeHttpUrl = "httpUrl"
|
||||
TypeUserLink = "userLink"
|
||||
TypeInputInlineQueryResultAnimation = "inputInlineQueryResultAnimation"
|
||||
TypeInputInlineQueryResultArticle = "inputInlineQueryResultArticle"
|
||||
TypeInputInlineQueryResultAudio = "inputInlineQueryResultAudio"
|
||||
|
|
@ -1027,6 +1034,7 @@ const (
|
|||
TypeChatEventHasProtectedContentToggled = "chatEventHasProtectedContentToggled"
|
||||
TypeChatEventInvitesToggled = "chatEventInvitesToggled"
|
||||
TypeChatEventIsAllHistoryAvailableToggled = "chatEventIsAllHistoryAvailableToggled"
|
||||
TypeChatEventIsAggressiveAntiSpamEnabledToggled = "chatEventIsAggressiveAntiSpamEnabledToggled"
|
||||
TypeChatEventSignMessagesToggled = "chatEventSignMessagesToggled"
|
||||
TypeChatEventInviteLinkEdited = "chatEventInviteLinkEdited"
|
||||
TypeChatEventInviteLinkRevoked = "chatEventInviteLinkRevoked"
|
||||
|
|
@ -1040,6 +1048,7 @@ const (
|
|||
TypeChatEventForumTopicCreated = "chatEventForumTopicCreated"
|
||||
TypeChatEventForumTopicEdited = "chatEventForumTopicEdited"
|
||||
TypeChatEventForumTopicToggleIsClosed = "chatEventForumTopicToggleIsClosed"
|
||||
TypeChatEventForumTopicToggleIsHidden = "chatEventForumTopicToggleIsHidden"
|
||||
TypeChatEventForumTopicDeleted = "chatEventForumTopicDeleted"
|
||||
TypeChatEventForumTopicPinned = "chatEventForumTopicPinned"
|
||||
TypeChatEvent = "chatEvent"
|
||||
|
|
@ -1118,7 +1127,8 @@ const (
|
|||
TypeCheckChatUsernameResultOk = "checkChatUsernameResultOk"
|
||||
TypeCheckChatUsernameResultUsernameInvalid = "checkChatUsernameResultUsernameInvalid"
|
||||
TypeCheckChatUsernameResultUsernameOccupied = "checkChatUsernameResultUsernameOccupied"
|
||||
TypeCheckChatUsernameResultPublicChatsTooMuch = "checkChatUsernameResultPublicChatsTooMuch"
|
||||
TypeCheckChatUsernameResultUsernamePurchasable = "checkChatUsernameResultUsernamePurchasable"
|
||||
TypeCheckChatUsernameResultPublicChatsTooMany = "checkChatUsernameResultPublicChatsTooMany"
|
||||
TypeCheckChatUsernameResultPublicGroupsUnavailable = "checkChatUsernameResultPublicGroupsUnavailable"
|
||||
TypeCheckStickerSetNameResultOk = "checkStickerSetNameResultOk"
|
||||
TypeCheckStickerSetNameResultNameInvalid = "checkStickerSetNameResultNameInvalid"
|
||||
|
|
@ -1200,6 +1210,7 @@ const (
|
|||
TypeUserPrivacySettingAllowFindingByPhoneNumber = "userPrivacySettingAllowFindingByPhoneNumber"
|
||||
TypeUserPrivacySettingAllowPrivateVoiceAndVideoNoteMessages = "userPrivacySettingAllowPrivateVoiceAndVideoNoteMessages"
|
||||
TypeAccountTtl = "accountTtl"
|
||||
TypeMessageTtl = "messageTtl"
|
||||
TypeSessionTypeAndroid = "sessionTypeAndroid"
|
||||
TypeSessionTypeApple = "sessionTypeApple"
|
||||
TypeSessionTypeBrave = "sessionTypeBrave"
|
||||
|
|
@ -1266,6 +1277,7 @@ const (
|
|||
TypeInternalLinkTypeUnknownDeepLink = "internalLinkTypeUnknownDeepLink"
|
||||
TypeInternalLinkTypeUnsupportedProxy = "internalLinkTypeUnsupportedProxy"
|
||||
TypeInternalLinkTypeUserPhoneNumber = "internalLinkTypeUserPhoneNumber"
|
||||
TypeInternalLinkTypeUserToken = "internalLinkTypeUserToken"
|
||||
TypeInternalLinkTypeVideoChat = "internalLinkTypeVideoChat"
|
||||
TypeMessageLink = "messageLink"
|
||||
TypeMessageLinkInfo = "messageLinkInfo"
|
||||
|
|
@ -1947,7 +1959,7 @@ type SuggestedAction interface {
|
|||
SuggestedActionType() string
|
||||
}
|
||||
|
||||
// Describes the way the text needs to be parsed for TextEntities
|
||||
// Describes the way the text needs to be parsed for text entities
|
||||
type TextParseMode interface {
|
||||
TextParseModeType() string
|
||||
}
|
||||
|
|
@ -2170,6 +2182,35 @@ func (*AuthenticationCodeTypeMissedCall) AuthenticationCodeTypeType() string {
|
|||
return TypeAuthenticationCodeTypeMissedCall
|
||||
}
|
||||
|
||||
// An authentication code is delivered to https://fragment.com. The user must be logged in there via a wallet owning the phone number's NFT
|
||||
type AuthenticationCodeTypeFragment struct {
|
||||
meta
|
||||
// URL to open to receive the code
|
||||
Url string `json:"url"`
|
||||
// Length of the code
|
||||
Length int32 `json:"length"`
|
||||
}
|
||||
|
||||
func (entity *AuthenticationCodeTypeFragment) MarshalJSON() ([]byte, error) {
|
||||
entity.meta.Type = entity.GetType()
|
||||
|
||||
type stub AuthenticationCodeTypeFragment
|
||||
|
||||
return json.Marshal((*stub)(entity))
|
||||
}
|
||||
|
||||
func (*AuthenticationCodeTypeFragment) GetClass() string {
|
||||
return ClassAuthenticationCodeType
|
||||
}
|
||||
|
||||
func (*AuthenticationCodeTypeFragment) GetType() string {
|
||||
return TypeAuthenticationCodeTypeFragment
|
||||
}
|
||||
|
||||
func (*AuthenticationCodeTypeFragment) AuthenticationCodeTypeType() string {
|
||||
return TypeAuthenticationCodeTypeFragment
|
||||
}
|
||||
|
||||
// Information about the authentication code that was sent
|
||||
type AuthenticationCodeInfo struct {
|
||||
meta
|
||||
|
|
@ -5034,7 +5075,7 @@ func (premiumPaymentOption *PremiumPaymentOption) UnmarshalJSON(data []byte) err
|
|||
// Describes a custom emoji to be shown instead of the Telegram Premium badge
|
||||
type EmojiStatus struct {
|
||||
meta
|
||||
// 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
|
||||
// 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
|
||||
CustomEmojiId JsonInt64 `json:"custom_emoji_id"`
|
||||
}
|
||||
|
||||
|
|
@ -5135,13 +5176,15 @@ type User struct {
|
|||
IsPremium bool `json:"is_premium"`
|
||||
// True, if the user is Telegram support account
|
||||
IsSupport bool `json:"is_support"`
|
||||
// True, if the user's phone number was bought on Fragment and isn't tied to a SIM card
|
||||
HasAnonymousPhoneNumber bool `json:"has_anonymous_phone_number"`
|
||||
// If non-empty, it contains a human-readable description of the reason why access to this user must be restricted
|
||||
RestrictionReason string `json:"restriction_reason"`
|
||||
// True, if many users reported this user as a scam
|
||||
IsScam bool `json:"is_scam"`
|
||||
// True, if many users reported this user as a fake account
|
||||
IsFake bool `json:"is_fake"`
|
||||
// If false, the user is inaccessible, and the only information known about the user is inside this class. Identifier of the user can't be passed to any method except GetUser
|
||||
// If false, the user is inaccessible, and the only information known about the user is inside this class. Identifier of the user can't be passed to any method
|
||||
HaveAccess bool `json:"have_access"`
|
||||
// Type of the user
|
||||
Type UserType `json:"type"`
|
||||
|
|
@ -5183,6 +5226,7 @@ func (user *User) UnmarshalJSON(data []byte) error {
|
|||
IsVerified bool `json:"is_verified"`
|
||||
IsPremium bool `json:"is_premium"`
|
||||
IsSupport bool `json:"is_support"`
|
||||
HasAnonymousPhoneNumber bool `json:"has_anonymous_phone_number"`
|
||||
RestrictionReason string `json:"restriction_reason"`
|
||||
IsScam bool `json:"is_scam"`
|
||||
IsFake bool `json:"is_fake"`
|
||||
|
|
@ -5210,6 +5254,7 @@ func (user *User) UnmarshalJSON(data []byte) error {
|
|||
user.IsVerified = tmp.IsVerified
|
||||
user.IsPremium = tmp.IsPremium
|
||||
user.IsSupport = tmp.IsSupport
|
||||
user.HasAnonymousPhoneNumber = tmp.HasAnonymousPhoneNumber
|
||||
user.RestrictionReason = tmp.RestrictionReason
|
||||
user.IsScam = tmp.IsScam
|
||||
user.IsFake = tmp.IsFake
|
||||
|
|
@ -5560,7 +5605,7 @@ type ChatMember struct {
|
|||
MemberId MessageSender `json:"member_id"`
|
||||
// Identifier of a user that invited/promoted/banned this member in the chat; 0 if unknown
|
||||
InviterUserId int64 `json:"inviter_user_id"`
|
||||
// Point in time (Unix timestamp) when the user joined the chat
|
||||
// Point in time (Unix timestamp) when the user joined/was promoted/was banned in the chat
|
||||
JoinedChatDate int32 `json:"joined_chat_date"`
|
||||
// Status of the member in the chat
|
||||
Status ChatMemberStatus `json:"status"`
|
||||
|
|
@ -6584,6 +6629,8 @@ type SupergroupFullInfo struct {
|
|||
CanGetStatistics bool `json:"can_get_statistics"`
|
||||
// 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
|
||||
IsAllHistoryAvailable bool `json:"is_all_history_available"`
|
||||
// True, if aggressive anti-spam checks are enabled in the supergroup. The value of this field is only available for chat administrators
|
||||
IsAggressiveAntiSpamEnabled bool `json:"is_aggressive_anti_spam_enabled"`
|
||||
// Identifier of the supergroup sticker set; 0 if none
|
||||
StickerSetId JsonInt64 `json:"sticker_set_id"`
|
||||
// Location to which the supergroup is connected; may be null
|
||||
|
|
@ -8015,26 +8062,26 @@ func (*NotificationSettingsScopeChannelChats) NotificationSettingsScopeType() st
|
|||
return TypeNotificationSettingsScopeChannelChats
|
||||
}
|
||||
|
||||
// Contains information about notification settings for a chat
|
||||
// Contains information about notification settings for a chat or a froum topic
|
||||
type ChatNotificationSettings struct {
|
||||
meta
|
||||
// If true, mute_for is ignored and the value for the relevant type of chat is used instead
|
||||
// If true, mute_for is ignored and the value for the relevant type of chat or the forum chat is used instead
|
||||
UseDefaultMuteFor bool `json:"use_default_mute_for"`
|
||||
// Time left before notifications will be unmuted, in seconds
|
||||
MuteFor int32 `json:"mute_for"`
|
||||
// If true, the value for the relevant type of chat is used instead of sound_id
|
||||
// If true, the value for the relevant type of chat or the forum chat is used instead of sound_id
|
||||
UseDefaultSound bool `json:"use_default_sound"`
|
||||
// Identifier of the notification sound to be played; 0 if sound is disabled
|
||||
SoundId JsonInt64 `json:"sound_id"`
|
||||
// If true, show_preview is ignored and the value for the relevant type of chat is used instead
|
||||
// If true, show_preview is ignored and the value for the relevant type of chat or the forum chat is used instead
|
||||
UseDefaultShowPreview bool `json:"use_default_show_preview"`
|
||||
// True, if message content must be displayed in notifications
|
||||
ShowPreview bool `json:"show_preview"`
|
||||
// If true, disable_pinned_message_notifications is ignored and the value for the relevant type of chat is used instead
|
||||
// If true, disable_pinned_message_notifications is ignored and the value for the relevant type of chat or the forum chat is used instead
|
||||
UseDefaultDisablePinnedMessageNotifications bool `json:"use_default_disable_pinned_message_notifications"`
|
||||
// If true, notifications for incoming pinned messages will be created as for an ordinary unread message
|
||||
DisablePinnedMessageNotifications bool `json:"disable_pinned_message_notifications"`
|
||||
// If true, disable_mention_notifications is ignored and the value for the relevant type of chat is used instead
|
||||
// If true, disable_mention_notifications is ignored and the value for the relevant type of chat or the forum chat is used instead
|
||||
UseDefaultDisableMentionNotifications bool `json:"use_default_disable_mention_notifications"`
|
||||
// If true, notifications for messages with mentions will be created as for an ordinary unread message
|
||||
DisableMentionNotifications bool `json:"disable_mention_notifications"`
|
||||
|
|
@ -8254,11 +8301,11 @@ type ChatFilter struct {
|
|||
Title string `json:"title"`
|
||||
// The chosen icon name for short filter representation. If non-empty, must be one of "All", "Unread", "Unmuted", "Bots", "Channels", "Groups", "Private", "Custom", "Setup", "Cat", "Crown", "Favorite", "Flower", "Game", "Home", "Love", "Mask", "Party", "Sport", "Study", "Trade", "Travel", "Work", "Airplane", "Book", "Light", "Like", "Money", "Note", "Palette". If empty, use getChatFilterDefaultIconName to get default icon name for the filter
|
||||
IconName string `json:"icon_name"`
|
||||
// The chat identifiers of pinned chats in the filtered chat list. There can be up to GetOption("chat_filter_chosen_chat_count_max") pinned and always included non-secret chats and the same number of secret chats, but the limit can be increased with Telegram Premium
|
||||
// The chat identifiers of pinned chats in the filtered chat list. There can be up to getOption("chat_filter_chosen_chat_count_max") pinned and always included non-secret chats and the same number of secret chats, but the limit can be increased with Telegram Premium
|
||||
PinnedChatIds []int64 `json:"pinned_chat_ids"`
|
||||
// The chat identifiers of always included chats in the filtered chat list. There can be up to GetOption("chat_filter_chosen_chat_count_max") pinned and always included non-secret chats and the same number of secret chats, but the limit can be increased with Telegram Premium
|
||||
// The chat identifiers of always included chats in the filtered chat list. There can be up to getOption("chat_filter_chosen_chat_count_max") pinned and always included non-secret chats and the same number of secret chats, but the limit can be increased with Telegram Premium
|
||||
IncludedChatIds []int64 `json:"included_chat_ids"`
|
||||
// The chat identifiers of always excluded chats in the filtered chat list. There can be up to GetOption("chat_filter_chosen_chat_count_max") always excluded non-secret chats and the same number of secret chats, but the limit can be increased with Telegram Premium
|
||||
// The chat identifiers of always excluded chats in the filtered chat list. There can be up to getOption("chat_filter_chosen_chat_count_max") always excluded non-secret chats and the same number of secret chats, but the limit can be increased with Telegram Premium
|
||||
ExcludedChatIds []int64 `json:"excluded_chat_ids"`
|
||||
// True, if muted chats need to be excluded
|
||||
ExcludeMuted bool `json:"exclude_muted"`
|
||||
|
|
@ -9651,7 +9698,7 @@ func (inlineKeyboardButton *InlineKeyboardButton) UnmarshalJSON(data []byte) err
|
|||
return nil
|
||||
}
|
||||
|
||||
// Instructs application to remove the keyboard once this message has been received. This kind of keyboard can't be received in an incoming message; instead, UpdateChatReplyMarkup with message_id == 0 will be sent
|
||||
// Instructs application to remove the keyboard once this message has been received. This kind of keyboard can't be received in an incoming message; instead, updateChatReplyMarkup with message_id == 0 will be sent
|
||||
type ReplyMarkupRemoveKeyboard struct {
|
||||
meta
|
||||
// True, if the keyboard is removed only for the mentioned users or the target user of a reply
|
||||
|
|
@ -9927,10 +9974,14 @@ type ForumTopicInfo struct {
|
|||
CreationDate int32 `json:"creation_date"`
|
||||
// Identifier of the creator of the topic
|
||||
CreatorId MessageSender `json:"creator_id"`
|
||||
// True, if the topic is the General topic list
|
||||
IsGeneral bool `json:"is_general"`
|
||||
// True, if the topic was created by the current user
|
||||
IsOutgoing bool `json:"is_outgoing"`
|
||||
// True, if the topic is closed
|
||||
IsClosed bool `json:"is_closed"`
|
||||
// True, if the topic is hidden above the topic list and closed; for General topic only
|
||||
IsHidden bool `json:"is_hidden"`
|
||||
}
|
||||
|
||||
func (entity *ForumTopicInfo) MarshalJSON() ([]byte, error) {
|
||||
|
|
@ -9956,8 +10007,10 @@ func (forumTopicInfo *ForumTopicInfo) UnmarshalJSON(data []byte) error {
|
|||
Icon *ForumTopicIcon `json:"icon"`
|
||||
CreationDate int32 `json:"creation_date"`
|
||||
CreatorId json.RawMessage `json:"creator_id"`
|
||||
IsGeneral bool `json:"is_general"`
|
||||
IsOutgoing bool `json:"is_outgoing"`
|
||||
IsClosed bool `json:"is_closed"`
|
||||
IsHidden bool `json:"is_hidden"`
|
||||
}
|
||||
|
||||
err := json.Unmarshal(data, &tmp)
|
||||
|
|
@ -9969,8 +10022,10 @@ func (forumTopicInfo *ForumTopicInfo) UnmarshalJSON(data []byte) error {
|
|||
forumTopicInfo.Name = tmp.Name
|
||||
forumTopicInfo.Icon = tmp.Icon
|
||||
forumTopicInfo.CreationDate = tmp.CreationDate
|
||||
forumTopicInfo.IsGeneral = tmp.IsGeneral
|
||||
forumTopicInfo.IsOutgoing = tmp.IsOutgoing
|
||||
forumTopicInfo.IsClosed = tmp.IsClosed
|
||||
forumTopicInfo.IsHidden = tmp.IsHidden
|
||||
|
||||
fieldCreatorId, _ := UnmarshalMessageSender(tmp.CreatorId)
|
||||
forumTopicInfo.CreatorId = fieldCreatorId
|
||||
|
|
@ -9983,7 +10038,7 @@ type ForumTopic struct {
|
|||
meta
|
||||
// Basic information about the topic
|
||||
Info *ForumTopicInfo `json:"info"`
|
||||
// Last message in the topic; may be null
|
||||
// Last message in the topic; may be null if unknown
|
||||
LastMessage *Message `json:"last_message"`
|
||||
// True, if the topic is pinned in the topic list
|
||||
IsPinned bool `json:"is_pinned"`
|
||||
|
|
@ -10019,6 +10074,37 @@ func (*ForumTopic) GetType() string {
|
|||
return TypeForumTopic
|
||||
}
|
||||
|
||||
// Describes a list of forum topics
|
||||
type ForumTopics struct {
|
||||
meta
|
||||
// Approximate total number of forum topics found
|
||||
TotalCount int32 `json:"total_count"`
|
||||
// List of forum topics
|
||||
Topics []*ForumTopic `json:"topics"`
|
||||
// Offset date for the next getForumTopics request
|
||||
NextOffsetDate int32 `json:"next_offset_date"`
|
||||
// Offset message identifier for the next getForumTopics request
|
||||
NextOffsetMessageId int64 `json:"next_offset_message_id"`
|
||||
// Offset message thread identifier for the next getForumTopics request
|
||||
NextOffsetMessageThreadId int64 `json:"next_offset_message_thread_id"`
|
||||
}
|
||||
|
||||
func (entity *ForumTopics) MarshalJSON() ([]byte, error) {
|
||||
entity.meta.Type = entity.GetType()
|
||||
|
||||
type stub ForumTopics
|
||||
|
||||
return json.Marshal((*stub)(entity))
|
||||
}
|
||||
|
||||
func (*ForumTopics) GetClass() string {
|
||||
return ClassForumTopics
|
||||
}
|
||||
|
||||
func (*ForumTopics) GetType() string {
|
||||
return TypeForumTopics
|
||||
}
|
||||
|
||||
// A plain text
|
||||
type RichTextPlain struct {
|
||||
meta
|
||||
|
|
@ -16657,6 +16743,8 @@ type MessageChatSetTtl struct {
|
|||
meta
|
||||
// New message TTL
|
||||
Ttl int32 `json:"ttl"`
|
||||
// If not 0, a user identifier, which default setting was automatically applied
|
||||
FromUserId int64 `json:"from_user_id"`
|
||||
}
|
||||
|
||||
func (entity *MessageChatSetTtl) MarshalJSON() ([]byte, error) {
|
||||
|
|
@ -16742,7 +16830,7 @@ func (*MessageForumTopicEdited) MessageContentType() string {
|
|||
// A forum topic has been closed or opened
|
||||
type MessageForumTopicIsClosedToggled struct {
|
||||
meta
|
||||
// True if the topic was closed or reopened
|
||||
// True, if the topic was closed, otherwise the topic was reopened
|
||||
IsClosed bool `json:"is_closed"`
|
||||
}
|
||||
|
||||
|
|
@ -16766,6 +16854,33 @@ func (*MessageForumTopicIsClosedToggled) MessageContentType() string {
|
|||
return TypeMessageForumTopicIsClosedToggled
|
||||
}
|
||||
|
||||
// A General forum topic has been hidden or unhidden
|
||||
type MessageForumTopicIsHiddenToggled struct {
|
||||
meta
|
||||
// True, if the topic was hidden, otherwise the topic was unhidden
|
||||
IsHidden bool `json:"is_hidden"`
|
||||
}
|
||||
|
||||
func (entity *MessageForumTopicIsHiddenToggled) MarshalJSON() ([]byte, error) {
|
||||
entity.meta.Type = entity.GetType()
|
||||
|
||||
type stub MessageForumTopicIsHiddenToggled
|
||||
|
||||
return json.Marshal((*stub)(entity))
|
||||
}
|
||||
|
||||
func (*MessageForumTopicIsHiddenToggled) GetClass() string {
|
||||
return ClassMessageContent
|
||||
}
|
||||
|
||||
func (*MessageForumTopicIsHiddenToggled) GetType() string {
|
||||
return TypeMessageForumTopicIsHiddenToggled
|
||||
}
|
||||
|
||||
func (*MessageForumTopicIsHiddenToggled) MessageContentType() string {
|
||||
return TypeMessageForumTopicIsHiddenToggled
|
||||
}
|
||||
|
||||
// A non-standard action has happened in the chat
|
||||
type MessageCustomServiceAction struct {
|
||||
meta
|
||||
|
|
@ -17894,7 +18009,7 @@ func (*MessageCopyOptions) GetType() string {
|
|||
// A text message
|
||||
type InputMessageText struct {
|
||||
meta
|
||||
// Formatted text to be sent; 1-GetOption("message_text_length_max") characters. Only Bold, Italic, Underline, Strikethrough, Spoiler, CustomEmoji, Code, Pre, PreCode, TextUrl and MentionName entities are allowed to be specified manually
|
||||
// Formatted text to be sent; 1-getOption("message_text_length_max") characters. Only Bold, Italic, Underline, Strikethrough, Spoiler, CustomEmoji, Code, Pre, PreCode, TextUrl and MentionName entities are allowed to be specified manually
|
||||
Text *FormattedText `json:"text"`
|
||||
// True, if rich web page previews for URLs in the message text must be disabled
|
||||
DisableWebPagePreview bool `json:"disable_web_page_preview"`
|
||||
|
|
@ -17937,7 +18052,7 @@ type InputMessageAnimation struct {
|
|||
Width int32 `json:"width"`
|
||||
// Height of the animation; may be replaced by the server
|
||||
Height int32 `json:"height"`
|
||||
// Animation caption; pass null to use an empty caption; 0-GetOption("message_caption_length_max") characters
|
||||
// Animation caption; pass null to use an empty caption; 0-getOption("message_caption_length_max") characters
|
||||
Caption *FormattedText `json:"caption"`
|
||||
}
|
||||
|
||||
|
|
@ -18003,7 +18118,7 @@ type InputMessageAudio struct {
|
|||
Title string `json:"title"`
|
||||
// Performer of the audio; 0-64 characters, may be replaced by the server
|
||||
Performer string `json:"performer"`
|
||||
// Audio caption; pass null to use an empty caption; 0-GetOption("message_caption_length_max") characters
|
||||
// Audio caption; pass null to use an empty caption; 0-getOption("message_caption_length_max") characters
|
||||
Caption *FormattedText `json:"caption"`
|
||||
}
|
||||
|
||||
|
|
@ -18063,7 +18178,7 @@ type InputMessageDocument struct {
|
|||
Thumbnail *InputThumbnail `json:"thumbnail"`
|
||||
// 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
|
||||
DisableContentTypeDetection bool `json:"disable_content_type_detection"`
|
||||
// Document caption; pass null to use an empty caption; 0-GetOption("message_caption_length_max") characters
|
||||
// Document caption; pass null to use an empty caption; 0-getOption("message_caption_length_max") characters
|
||||
Caption *FormattedText `json:"caption"`
|
||||
}
|
||||
|
||||
|
|
@ -18123,7 +18238,7 @@ type InputMessagePhoto struct {
|
|||
Width int32 `json:"width"`
|
||||
// Photo height
|
||||
Height int32 `json:"height"`
|
||||
// Photo caption; pass null to use an empty caption; 0-GetOption("message_caption_length_max") characters
|
||||
// Photo caption; pass null to use an empty caption; 0-getOption("message_caption_length_max") characters
|
||||
Caption *FormattedText `json:"caption"`
|
||||
// Photo TTL (Time To Live), in seconds (0-60). A non-zero TTL can be specified only in private chats
|
||||
Ttl int32 `json:"ttl"`
|
||||
|
|
@ -18255,7 +18370,7 @@ type InputMessageVideo struct {
|
|||
Height int32 `json:"height"`
|
||||
// True, if the video is supposed to be streamed
|
||||
SupportsStreaming bool `json:"supports_streaming"`
|
||||
// Video caption; pass null to use an empty caption; 0-GetOption("message_caption_length_max") characters
|
||||
// Video caption; pass null to use an empty caption; 0-getOption("message_caption_length_max") characters
|
||||
Caption *FormattedText `json:"caption"`
|
||||
// Video TTL (Time To Live), in seconds (0-60). A non-zero TTL can be specified only in private chats
|
||||
Ttl int32 `json:"ttl"`
|
||||
|
|
@ -18379,7 +18494,7 @@ type InputMessageVoiceNote struct {
|
|||
Duration int32 `json:"duration"`
|
||||
// Waveform representation of the voice note in 5-bit format
|
||||
Waveform []byte `json:"waveform"`
|
||||
// Voice note caption; pass null to use an empty caption; 0-GetOption("message_caption_length_max") characters
|
||||
// Voice note caption; pass null to use an empty caption; 0-getOption("message_caption_length_max") characters
|
||||
Caption *FormattedText `json:"caption"`
|
||||
}
|
||||
|
||||
|
|
@ -20812,7 +20927,7 @@ type GroupCallParticipantVideoInfo struct {
|
|||
SourceGroups []*GroupCallVideoSourceGroup `json:"source_groups"`
|
||||
// Video channel endpoint identifier
|
||||
EndpointId string `json:"endpoint_id"`
|
||||
// True if the video is paused. This flag needs to be ignored, if new video frames are received
|
||||
// True, if the video is paused. This flag needs to be ignored, if new video frames are received
|
||||
IsPaused bool `json:"is_paused"`
|
||||
}
|
||||
|
||||
|
|
@ -21523,7 +21638,7 @@ func (*DiceStickersSlotMachine) DiceStickersType() string {
|
|||
return TypeDiceStickersSlotMachine
|
||||
}
|
||||
|
||||
// Represents the result of an ImportContacts request
|
||||
// Represents the result of an importContacts request
|
||||
type ImportedContacts struct {
|
||||
meta
|
||||
// User identifiers of the imported contacts in the same order as they were specified in the request; 0 if the contact is not yet a registered user
|
||||
|
|
@ -21753,6 +21868,31 @@ func (*HttpUrl) GetType() string {
|
|||
return TypeHttpUrl
|
||||
}
|
||||
|
||||
// Contains an HTTPS URL, which can be used to get information about a user
|
||||
type UserLink struct {
|
||||
meta
|
||||
// The URL
|
||||
Url string `json:"url"`
|
||||
// Left time for which the link is valid, in seconds; 0 if the link is a public username link
|
||||
ExpiresIn int32 `json:"expires_in"`
|
||||
}
|
||||
|
||||
func (entity *UserLink) MarshalJSON() ([]byte, error) {
|
||||
entity.meta.Type = entity.GetType()
|
||||
|
||||
type stub UserLink
|
||||
|
||||
return json.Marshal((*stub)(entity))
|
||||
}
|
||||
|
||||
func (*UserLink) GetClass() string {
|
||||
return ClassUserLink
|
||||
}
|
||||
|
||||
func (*UserLink) GetType() string {
|
||||
return TypeUserLink
|
||||
}
|
||||
|
||||
// Represents a link to an animated GIF or an animated (i.e., without sound) H.264/MPEG-4 AVC video
|
||||
type InputInlineQueryResultAnimation struct {
|
||||
meta
|
||||
|
|
@ -23296,6 +23436,8 @@ type ChatEventMessageDeleted struct {
|
|||
meta
|
||||
// Deleted message
|
||||
Message *Message `json:"message"`
|
||||
// True, if the message deletion can be reported via reportSupergroupAntiSpamFalsePositive
|
||||
CanReportAntiSpamFalsePositive bool `json:"can_report_anti_spam_false_positive"`
|
||||
}
|
||||
|
||||
func (entity *ChatEventMessageDeleted) MarshalJSON() ([]byte, error) {
|
||||
|
|
@ -24111,6 +24253,33 @@ func (*ChatEventIsAllHistoryAvailableToggled) ChatEventActionType() string {
|
|||
return TypeChatEventIsAllHistoryAvailableToggled
|
||||
}
|
||||
|
||||
// The is_aggressive_anti_spam_enabled setting of a supergroup was toggled
|
||||
type ChatEventIsAggressiveAntiSpamEnabledToggled struct {
|
||||
meta
|
||||
// New value of is_aggressive_anti_spam_enabled
|
||||
IsAggressiveAntiSpamEnabled bool `json:"is_aggressive_anti_spam_enabled"`
|
||||
}
|
||||
|
||||
func (entity *ChatEventIsAggressiveAntiSpamEnabledToggled) MarshalJSON() ([]byte, error) {
|
||||
entity.meta.Type = entity.GetType()
|
||||
|
||||
type stub ChatEventIsAggressiveAntiSpamEnabledToggled
|
||||
|
||||
return json.Marshal((*stub)(entity))
|
||||
}
|
||||
|
||||
func (*ChatEventIsAggressiveAntiSpamEnabledToggled) GetClass() string {
|
||||
return ClassChatEventAction
|
||||
}
|
||||
|
||||
func (*ChatEventIsAggressiveAntiSpamEnabledToggled) GetType() string {
|
||||
return TypeChatEventIsAggressiveAntiSpamEnabledToggled
|
||||
}
|
||||
|
||||
func (*ChatEventIsAggressiveAntiSpamEnabledToggled) ChatEventActionType() string {
|
||||
return TypeChatEventIsAggressiveAntiSpamEnabledToggled
|
||||
}
|
||||
|
||||
// The sign_messages setting of a channel was toggled
|
||||
type ChatEventSignMessagesToggled struct {
|
||||
meta
|
||||
|
|
@ -24508,6 +24677,33 @@ func (*ChatEventForumTopicToggleIsClosed) ChatEventActionType() string {
|
|||
return TypeChatEventForumTopicToggleIsClosed
|
||||
}
|
||||
|
||||
// The General forum topic was hidden or unhidden
|
||||
type ChatEventForumTopicToggleIsHidden struct {
|
||||
meta
|
||||
// New information about the topic
|
||||
TopicInfo *ForumTopicInfo `json:"topic_info"`
|
||||
}
|
||||
|
||||
func (entity *ChatEventForumTopicToggleIsHidden) MarshalJSON() ([]byte, error) {
|
||||
entity.meta.Type = entity.GetType()
|
||||
|
||||
type stub ChatEventForumTopicToggleIsHidden
|
||||
|
||||
return json.Marshal((*stub)(entity))
|
||||
}
|
||||
|
||||
func (*ChatEventForumTopicToggleIsHidden) GetClass() string {
|
||||
return ClassChatEventAction
|
||||
}
|
||||
|
||||
func (*ChatEventForumTopicToggleIsHidden) GetType() string {
|
||||
return TypeChatEventForumTopicToggleIsHidden
|
||||
}
|
||||
|
||||
func (*ChatEventForumTopicToggleIsHidden) ChatEventActionType() string {
|
||||
return TypeChatEventForumTopicToggleIsHidden
|
||||
}
|
||||
|
||||
// A forum topic was deleted
|
||||
type ChatEventForumTopicDeleted struct {
|
||||
meta
|
||||
|
|
@ -26862,29 +27058,54 @@ func (*CheckChatUsernameResultUsernameOccupied) CheckChatUsernameResultType() st
|
|||
return TypeCheckChatUsernameResultUsernameOccupied
|
||||
}
|
||||
|
||||
// The user has too many chats with username, one of them must be made private first
|
||||
type CheckChatUsernameResultPublicChatsTooMuch struct{
|
||||
// The username can be purchased at fragment.com
|
||||
type CheckChatUsernameResultUsernamePurchasable struct{
|
||||
meta
|
||||
}
|
||||
|
||||
func (entity *CheckChatUsernameResultPublicChatsTooMuch) MarshalJSON() ([]byte, error) {
|
||||
func (entity *CheckChatUsernameResultUsernamePurchasable) MarshalJSON() ([]byte, error) {
|
||||
entity.meta.Type = entity.GetType()
|
||||
|
||||
type stub CheckChatUsernameResultPublicChatsTooMuch
|
||||
type stub CheckChatUsernameResultUsernamePurchasable
|
||||
|
||||
return json.Marshal((*stub)(entity))
|
||||
}
|
||||
|
||||
func (*CheckChatUsernameResultPublicChatsTooMuch) GetClass() string {
|
||||
func (*CheckChatUsernameResultUsernamePurchasable) GetClass() string {
|
||||
return ClassCheckChatUsernameResult
|
||||
}
|
||||
|
||||
func (*CheckChatUsernameResultPublicChatsTooMuch) GetType() string {
|
||||
return TypeCheckChatUsernameResultPublicChatsTooMuch
|
||||
func (*CheckChatUsernameResultUsernamePurchasable) GetType() string {
|
||||
return TypeCheckChatUsernameResultUsernamePurchasable
|
||||
}
|
||||
|
||||
func (*CheckChatUsernameResultPublicChatsTooMuch) CheckChatUsernameResultType() string {
|
||||
return TypeCheckChatUsernameResultPublicChatsTooMuch
|
||||
func (*CheckChatUsernameResultUsernamePurchasable) CheckChatUsernameResultType() string {
|
||||
return TypeCheckChatUsernameResultUsernamePurchasable
|
||||
}
|
||||
|
||||
// The user has too many chats with username, one of them must be made private first
|
||||
type CheckChatUsernameResultPublicChatsTooMany struct{
|
||||
meta
|
||||
}
|
||||
|
||||
func (entity *CheckChatUsernameResultPublicChatsTooMany) MarshalJSON() ([]byte, error) {
|
||||
entity.meta.Type = entity.GetType()
|
||||
|
||||
type stub CheckChatUsernameResultPublicChatsTooMany
|
||||
|
||||
return json.Marshal((*stub)(entity))
|
||||
}
|
||||
|
||||
func (*CheckChatUsernameResultPublicChatsTooMany) GetClass() string {
|
||||
return ClassCheckChatUsernameResult
|
||||
}
|
||||
|
||||
func (*CheckChatUsernameResultPublicChatsTooMany) GetType() string {
|
||||
return TypeCheckChatUsernameResultPublicChatsTooMany
|
||||
}
|
||||
|
||||
func (*CheckChatUsernameResultPublicChatsTooMany) CheckChatUsernameResultType() string {
|
||||
return TypeCheckChatUsernameResultPublicChatsTooMany
|
||||
}
|
||||
|
||||
// The user can't be a member of a public supergroup
|
||||
|
|
@ -29206,6 +29427,29 @@ func (*AccountTtl) GetType() string {
|
|||
return TypeAccountTtl
|
||||
}
|
||||
|
||||
// Contains default message Time To Live setting (self-destruct timer) for new chats
|
||||
type MessageTtl struct {
|
||||
meta
|
||||
// Message TTL setting, in seconds. If 0, then messages aren't deleted automatically
|
||||
Ttl int32 `json:"ttl"`
|
||||
}
|
||||
|
||||
func (entity *MessageTtl) MarshalJSON() ([]byte, error) {
|
||||
entity.meta.Type = entity.GetType()
|
||||
|
||||
type stub MessageTtl
|
||||
|
||||
return json.Marshal((*stub)(entity))
|
||||
}
|
||||
|
||||
func (*MessageTtl) GetClass() string {
|
||||
return ClassMessageTtl
|
||||
}
|
||||
|
||||
func (*MessageTtl) GetType() string {
|
||||
return TypeMessageTtl
|
||||
}
|
||||
|
||||
// The session is running on an Android device
|
||||
type SessionTypeAndroid struct{
|
||||
meta
|
||||
|
|
@ -30613,7 +30857,7 @@ func (*InternalLinkTypeLanguageSettings) InternalLinkTypeType() string {
|
|||
return TypeInternalLinkTypeLanguageSettings
|
||||
}
|
||||
|
||||
// The link is a link to a Telegram message. Call getMessageLinkInfo with the given URL to process the link
|
||||
// The link is a link to a Telegram message or a forum topic. Call getMessageLinkInfo with the given URL to process the link
|
||||
type InternalLinkTypeMessage struct {
|
||||
meta
|
||||
// URL to be passed to getMessageLinkInfo
|
||||
|
|
@ -31097,6 +31341,33 @@ func (*InternalLinkTypeUserPhoneNumber) InternalLinkTypeType() string {
|
|||
return TypeInternalLinkTypeUserPhoneNumber
|
||||
}
|
||||
|
||||
// The link is a link to a user by a temporary token. Call searchUserByToken with the given token to process the link
|
||||
type InternalLinkTypeUserToken struct {
|
||||
meta
|
||||
// The token
|
||||
Token string `json:"token"`
|
||||
}
|
||||
|
||||
func (entity *InternalLinkTypeUserToken) MarshalJSON() ([]byte, error) {
|
||||
entity.meta.Type = entity.GetType()
|
||||
|
||||
type stub InternalLinkTypeUserToken
|
||||
|
||||
return json.Marshal((*stub)(entity))
|
||||
}
|
||||
|
||||
func (*InternalLinkTypeUserToken) GetClass() string {
|
||||
return ClassInternalLinkType
|
||||
}
|
||||
|
||||
func (*InternalLinkTypeUserToken) GetType() string {
|
||||
return TypeInternalLinkTypeUserToken
|
||||
}
|
||||
|
||||
func (*InternalLinkTypeUserToken) InternalLinkTypeType() string {
|
||||
return TypeInternalLinkTypeUserToken
|
||||
}
|
||||
|
||||
// The link is a link to a video chat. Call searchPublicChat with the given chat username, and then joinGroupCall with the given invite hash to process the link
|
||||
type InternalLinkTypeVideoChat struct {
|
||||
meta
|
||||
|
|
@ -31153,14 +31424,14 @@ func (*MessageLink) GetType() string {
|
|||
return TypeMessageLink
|
||||
}
|
||||
|
||||
// Contains information about a link to a message in a chat
|
||||
// Contains information about a link to a message or a forum topic in a chat
|
||||
type MessageLinkInfo struct {
|
||||
meta
|
||||
// True, if the link is a public link for a message in a chat
|
||||
IsPublic bool `json:"is_public"`
|
||||
// If found, identifier of the chat to which the message belongs, 0 otherwise
|
||||
ChatId int64 `json:"chat_id"`
|
||||
// If found, identifier of the message thread in which to open the message, or which to open in case of a missing message
|
||||
// If found, identifier of the message thread in which to open the message, or a forum topic to open if the message is missing
|
||||
MessageThreadId int64 `json:"message_thread_id"`
|
||||
// If found, the linked message; may be null
|
||||
Message *Message `json:"message"`
|
||||
|
|
@ -36990,7 +37261,7 @@ func (*UpdateAnimatedEmojiMessageClicked) UpdateType() string {
|
|||
return TypeUpdateAnimatedEmojiMessageClicked
|
||||
}
|
||||
|
||||
// The parameters of animation search through GetOption("animation_search_bot_username") bot has changed
|
||||
// The parameters of animation search through getOption("animation_search_bot_username") bot has changed
|
||||
type UpdateAnimationSearchParameters struct {
|
||||
meta
|
||||
// Name of the animation search provider
|
||||
|
|
|
|||
|
|
@ -31,6 +31,9 @@ func UnmarshalAuthenticationCodeType(data json.RawMessage) (AuthenticationCodeTy
|
|||
case TypeAuthenticationCodeTypeMissedCall:
|
||||
return UnmarshalAuthenticationCodeTypeMissedCall(data)
|
||||
|
||||
case TypeAuthenticationCodeTypeFragment:
|
||||
return UnmarshalAuthenticationCodeTypeFragment(data)
|
||||
|
||||
default:
|
||||
return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type)
|
||||
}
|
||||
|
|
@ -2096,6 +2099,9 @@ func UnmarshalMessageContent(data json.RawMessage) (MessageContent, error) {
|
|||
case TypeMessageForumTopicIsClosedToggled:
|
||||
return UnmarshalMessageForumTopicIsClosedToggled(data)
|
||||
|
||||
case TypeMessageForumTopicIsHiddenToggled:
|
||||
return UnmarshalMessageForumTopicIsHiddenToggled(data)
|
||||
|
||||
case TypeMessageCustomServiceAction:
|
||||
return UnmarshalMessageCustomServiceAction(data)
|
||||
|
||||
|
|
@ -3094,6 +3100,9 @@ func UnmarshalChatEventAction(data json.RawMessage) (ChatEventAction, error) {
|
|||
case TypeChatEventIsAllHistoryAvailableToggled:
|
||||
return UnmarshalChatEventIsAllHistoryAvailableToggled(data)
|
||||
|
||||
case TypeChatEventIsAggressiveAntiSpamEnabledToggled:
|
||||
return UnmarshalChatEventIsAggressiveAntiSpamEnabledToggled(data)
|
||||
|
||||
case TypeChatEventSignMessagesToggled:
|
||||
return UnmarshalChatEventSignMessagesToggled(data)
|
||||
|
||||
|
|
@ -3133,6 +3142,9 @@ func UnmarshalChatEventAction(data json.RawMessage) (ChatEventAction, error) {
|
|||
case TypeChatEventForumTopicToggleIsClosed:
|
||||
return UnmarshalChatEventForumTopicToggleIsClosed(data)
|
||||
|
||||
case TypeChatEventForumTopicToggleIsHidden:
|
||||
return UnmarshalChatEventForumTopicToggleIsHidden(data)
|
||||
|
||||
case TypeChatEventForumTopicDeleted:
|
||||
return UnmarshalChatEventForumTopicDeleted(data)
|
||||
|
||||
|
|
@ -3624,8 +3636,11 @@ func UnmarshalCheckChatUsernameResult(data json.RawMessage) (CheckChatUsernameRe
|
|||
case TypeCheckChatUsernameResultUsernameOccupied:
|
||||
return UnmarshalCheckChatUsernameResultUsernameOccupied(data)
|
||||
|
||||
case TypeCheckChatUsernameResultPublicChatsTooMuch:
|
||||
return UnmarshalCheckChatUsernameResultPublicChatsTooMuch(data)
|
||||
case TypeCheckChatUsernameResultUsernamePurchasable:
|
||||
return UnmarshalCheckChatUsernameResultUsernamePurchasable(data)
|
||||
|
||||
case TypeCheckChatUsernameResultPublicChatsTooMany:
|
||||
return UnmarshalCheckChatUsernameResultPublicChatsTooMany(data)
|
||||
|
||||
case TypeCheckChatUsernameResultPublicGroupsUnavailable:
|
||||
return UnmarshalCheckChatUsernameResultPublicGroupsUnavailable(data)
|
||||
|
|
@ -4427,6 +4442,9 @@ func UnmarshalInternalLinkType(data json.RawMessage) (InternalLinkType, error) {
|
|||
case TypeInternalLinkTypeUserPhoneNumber:
|
||||
return UnmarshalInternalLinkTypeUserPhoneNumber(data)
|
||||
|
||||
case TypeInternalLinkTypeUserToken:
|
||||
return UnmarshalInternalLinkTypeUserToken(data)
|
||||
|
||||
case TypeInternalLinkTypeVideoChat:
|
||||
return UnmarshalInternalLinkTypeVideoChat(data)
|
||||
|
||||
|
|
@ -5444,6 +5462,14 @@ func UnmarshalAuthenticationCodeTypeMissedCall(data json.RawMessage) (*Authentic
|
|||
return &resp, err
|
||||
}
|
||||
|
||||
func UnmarshalAuthenticationCodeTypeFragment(data json.RawMessage) (*AuthenticationCodeTypeFragment, error) {
|
||||
var resp AuthenticationCodeTypeFragment
|
||||
|
||||
err := json.Unmarshal(data, &resp)
|
||||
|
||||
return &resp, err
|
||||
}
|
||||
|
||||
func UnmarshalAuthenticationCodeInfo(data json.RawMessage) (*AuthenticationCodeInfo, error) {
|
||||
var resp AuthenticationCodeInfo
|
||||
|
||||
|
|
@ -7316,6 +7342,14 @@ func UnmarshalForumTopic(data json.RawMessage) (*ForumTopic, error) {
|
|||
return &resp, err
|
||||
}
|
||||
|
||||
func UnmarshalForumTopics(data json.RawMessage) (*ForumTopics, error) {
|
||||
var resp ForumTopics
|
||||
|
||||
err := json.Unmarshal(data, &resp)
|
||||
|
||||
return &resp, err
|
||||
}
|
||||
|
||||
func UnmarshalRichTextPlain(data json.RawMessage) (*RichTextPlain, error) {
|
||||
var resp RichTextPlain
|
||||
|
||||
|
|
@ -8940,6 +8974,14 @@ func UnmarshalMessageForumTopicIsClosedToggled(data json.RawMessage) (*MessageFo
|
|||
return &resp, err
|
||||
}
|
||||
|
||||
func UnmarshalMessageForumTopicIsHiddenToggled(data json.RawMessage) (*MessageForumTopicIsHiddenToggled, error) {
|
||||
var resp MessageForumTopicIsHiddenToggled
|
||||
|
||||
err := json.Unmarshal(data, &resp)
|
||||
|
||||
return &resp, err
|
||||
}
|
||||
|
||||
func UnmarshalMessageCustomServiceAction(data json.RawMessage) (*MessageCustomServiceAction, error) {
|
||||
var resp MessageCustomServiceAction
|
||||
|
||||
|
|
@ -10172,6 +10214,14 @@ func UnmarshalHttpUrl(data json.RawMessage) (*HttpUrl, error) {
|
|||
return &resp, err
|
||||
}
|
||||
|
||||
func UnmarshalUserLink(data json.RawMessage) (*UserLink, error) {
|
||||
var resp UserLink
|
||||
|
||||
err := json.Unmarshal(data, &resp)
|
||||
|
||||
return &resp, err
|
||||
}
|
||||
|
||||
func UnmarshalInputInlineQueryResultAnimation(data json.RawMessage) (*InputInlineQueryResultAnimation, error) {
|
||||
var resp InputInlineQueryResultAnimation
|
||||
|
||||
|
|
@ -10644,6 +10694,14 @@ func UnmarshalChatEventIsAllHistoryAvailableToggled(data json.RawMessage) (*Chat
|
|||
return &resp, err
|
||||
}
|
||||
|
||||
func UnmarshalChatEventIsAggressiveAntiSpamEnabledToggled(data json.RawMessage) (*ChatEventIsAggressiveAntiSpamEnabledToggled, error) {
|
||||
var resp ChatEventIsAggressiveAntiSpamEnabledToggled
|
||||
|
||||
err := json.Unmarshal(data, &resp)
|
||||
|
||||
return &resp, err
|
||||
}
|
||||
|
||||
func UnmarshalChatEventSignMessagesToggled(data json.RawMessage) (*ChatEventSignMessagesToggled, error) {
|
||||
var resp ChatEventSignMessagesToggled
|
||||
|
||||
|
|
@ -10748,6 +10806,14 @@ func UnmarshalChatEventForumTopicToggleIsClosed(data json.RawMessage) (*ChatEven
|
|||
return &resp, err
|
||||
}
|
||||
|
||||
func UnmarshalChatEventForumTopicToggleIsHidden(data json.RawMessage) (*ChatEventForumTopicToggleIsHidden, error) {
|
||||
var resp ChatEventForumTopicToggleIsHidden
|
||||
|
||||
err := json.Unmarshal(data, &resp)
|
||||
|
||||
return &resp, err
|
||||
}
|
||||
|
||||
func UnmarshalChatEventForumTopicDeleted(data json.RawMessage) (*ChatEventForumTopicDeleted, error) {
|
||||
var resp ChatEventForumTopicDeleted
|
||||
|
||||
|
|
@ -11372,8 +11438,16 @@ func UnmarshalCheckChatUsernameResultUsernameOccupied(data json.RawMessage) (*Ch
|
|||
return &resp, err
|
||||
}
|
||||
|
||||
func UnmarshalCheckChatUsernameResultPublicChatsTooMuch(data json.RawMessage) (*CheckChatUsernameResultPublicChatsTooMuch, error) {
|
||||
var resp CheckChatUsernameResultPublicChatsTooMuch
|
||||
func UnmarshalCheckChatUsernameResultUsernamePurchasable(data json.RawMessage) (*CheckChatUsernameResultUsernamePurchasable, error) {
|
||||
var resp CheckChatUsernameResultUsernamePurchasable
|
||||
|
||||
err := json.Unmarshal(data, &resp)
|
||||
|
||||
return &resp, err
|
||||
}
|
||||
|
||||
func UnmarshalCheckChatUsernameResultPublicChatsTooMany(data json.RawMessage) (*CheckChatUsernameResultPublicChatsTooMany, error) {
|
||||
var resp CheckChatUsernameResultPublicChatsTooMany
|
||||
|
||||
err := json.Unmarshal(data, &resp)
|
||||
|
||||
|
|
@ -12028,6 +12102,14 @@ func UnmarshalAccountTtl(data json.RawMessage) (*AccountTtl, error) {
|
|||
return &resp, err
|
||||
}
|
||||
|
||||
func UnmarshalMessageTtl(data json.RawMessage) (*MessageTtl, error) {
|
||||
var resp MessageTtl
|
||||
|
||||
err := json.Unmarshal(data, &resp)
|
||||
|
||||
return &resp, err
|
||||
}
|
||||
|
||||
func UnmarshalSessionTypeAndroid(data json.RawMessage) (*SessionTypeAndroid, error) {
|
||||
var resp SessionTypeAndroid
|
||||
|
||||
|
|
@ -12556,6 +12638,14 @@ func UnmarshalInternalLinkTypeUserPhoneNumber(data json.RawMessage) (*InternalLi
|
|||
return &resp, err
|
||||
}
|
||||
|
||||
func UnmarshalInternalLinkTypeUserToken(data json.RawMessage) (*InternalLinkTypeUserToken, error) {
|
||||
var resp InternalLinkTypeUserToken
|
||||
|
||||
err := json.Unmarshal(data, &resp)
|
||||
|
||||
return &resp, err
|
||||
}
|
||||
|
||||
func UnmarshalInternalLinkTypeVideoChat(data json.RawMessage) (*InternalLinkTypeVideoChat, error) {
|
||||
var resp InternalLinkTypeVideoChat
|
||||
|
||||
|
|
@ -14298,6 +14388,9 @@ func UnmarshalType(data json.RawMessage) (Type, error) {
|
|||
case TypeAuthenticationCodeTypeMissedCall:
|
||||
return UnmarshalAuthenticationCodeTypeMissedCall(data)
|
||||
|
||||
case TypeAuthenticationCodeTypeFragment:
|
||||
return UnmarshalAuthenticationCodeTypeFragment(data)
|
||||
|
||||
case TypeAuthenticationCodeInfo:
|
||||
return UnmarshalAuthenticationCodeInfo(data)
|
||||
|
||||
|
|
@ -15000,6 +15093,9 @@ func UnmarshalType(data json.RawMessage) (Type, error) {
|
|||
case TypeForumTopic:
|
||||
return UnmarshalForumTopic(data)
|
||||
|
||||
case TypeForumTopics:
|
||||
return UnmarshalForumTopics(data)
|
||||
|
||||
case TypeRichTextPlain:
|
||||
return UnmarshalRichTextPlain(data)
|
||||
|
||||
|
|
@ -15609,6 +15705,9 @@ func UnmarshalType(data json.RawMessage) (Type, error) {
|
|||
case TypeMessageForumTopicIsClosedToggled:
|
||||
return UnmarshalMessageForumTopicIsClosedToggled(data)
|
||||
|
||||
case TypeMessageForumTopicIsHiddenToggled:
|
||||
return UnmarshalMessageForumTopicIsHiddenToggled(data)
|
||||
|
||||
case TypeMessageCustomServiceAction:
|
||||
return UnmarshalMessageCustomServiceAction(data)
|
||||
|
||||
|
|
@ -16071,6 +16170,9 @@ func UnmarshalType(data json.RawMessage) (Type, error) {
|
|||
case TypeHttpUrl:
|
||||
return UnmarshalHttpUrl(data)
|
||||
|
||||
case TypeUserLink:
|
||||
return UnmarshalUserLink(data)
|
||||
|
||||
case TypeInputInlineQueryResultAnimation:
|
||||
return UnmarshalInputInlineQueryResultAnimation(data)
|
||||
|
||||
|
|
@ -16248,6 +16350,9 @@ func UnmarshalType(data json.RawMessage) (Type, error) {
|
|||
case TypeChatEventIsAllHistoryAvailableToggled:
|
||||
return UnmarshalChatEventIsAllHistoryAvailableToggled(data)
|
||||
|
||||
case TypeChatEventIsAggressiveAntiSpamEnabledToggled:
|
||||
return UnmarshalChatEventIsAggressiveAntiSpamEnabledToggled(data)
|
||||
|
||||
case TypeChatEventSignMessagesToggled:
|
||||
return UnmarshalChatEventSignMessagesToggled(data)
|
||||
|
||||
|
|
@ -16287,6 +16392,9 @@ func UnmarshalType(data json.RawMessage) (Type, error) {
|
|||
case TypeChatEventForumTopicToggleIsClosed:
|
||||
return UnmarshalChatEventForumTopicToggleIsClosed(data)
|
||||
|
||||
case TypeChatEventForumTopicToggleIsHidden:
|
||||
return UnmarshalChatEventForumTopicToggleIsHidden(data)
|
||||
|
||||
case TypeChatEventForumTopicDeleted:
|
||||
return UnmarshalChatEventForumTopicDeleted(data)
|
||||
|
||||
|
|
@ -16521,8 +16629,11 @@ func UnmarshalType(data json.RawMessage) (Type, error) {
|
|||
case TypeCheckChatUsernameResultUsernameOccupied:
|
||||
return UnmarshalCheckChatUsernameResultUsernameOccupied(data)
|
||||
|
||||
case TypeCheckChatUsernameResultPublicChatsTooMuch:
|
||||
return UnmarshalCheckChatUsernameResultPublicChatsTooMuch(data)
|
||||
case TypeCheckChatUsernameResultUsernamePurchasable:
|
||||
return UnmarshalCheckChatUsernameResultUsernamePurchasable(data)
|
||||
|
||||
case TypeCheckChatUsernameResultPublicChatsTooMany:
|
||||
return UnmarshalCheckChatUsernameResultPublicChatsTooMany(data)
|
||||
|
||||
case TypeCheckChatUsernameResultPublicGroupsUnavailable:
|
||||
return UnmarshalCheckChatUsernameResultPublicGroupsUnavailable(data)
|
||||
|
|
@ -16767,6 +16878,9 @@ func UnmarshalType(data json.RawMessage) (Type, error) {
|
|||
case TypeAccountTtl:
|
||||
return UnmarshalAccountTtl(data)
|
||||
|
||||
case TypeMessageTtl:
|
||||
return UnmarshalMessageTtl(data)
|
||||
|
||||
case TypeSessionTypeAndroid:
|
||||
return UnmarshalSessionTypeAndroid(data)
|
||||
|
||||
|
|
@ -16965,6 +17079,9 @@ func UnmarshalType(data json.RawMessage) (Type, error) {
|
|||
case TypeInternalLinkTypeUserPhoneNumber:
|
||||
return UnmarshalInternalLinkTypeUserPhoneNumber(data)
|
||||
|
||||
case TypeInternalLinkTypeUserToken:
|
||||
return UnmarshalInternalLinkTypeUserToken(data)
|
||||
|
||||
case TypeInternalLinkTypeVideoChat:
|
||||
return UnmarshalInternalLinkTypeVideoChat(data)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue