From f7fb32d1782860973d031333c6a9f04bfa04305b Mon Sep 17 00:00:00 2001 From: Paul Larsen Date: Wed, 31 Jul 2024 18:35:40 +0100 Subject: [PATCH] Update to Bot API 7.8 --- gen_methods.go | 10 ++++++++-- gen_types.go | 2 ++ spec_commit | 2 +- 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/gen_methods.go b/gen_methods.go index e6f1513..065b8fa 100755 --- a/gen_methods.go +++ b/gen_methods.go @@ -2609,6 +2609,8 @@ func (bot *Bot) LogOut(opts *LogOutOpts) (bool, error) { // PinChatMessageOpts is the set of optional fields for Bot.PinChatMessage. type PinChatMessageOpts struct { + // Unique identifier of the business connection on behalf of which the message will be pinned + BusinessConnectionId string // Pass True if it is not necessary to send a notification to all chat members about the new pinned message. Notifications are always disabled in channels and private chats. DisableNotification bool // RequestOpts are an additional optional field to configure timeouts for individual requests @@ -2626,6 +2628,7 @@ func (bot *Bot) PinChatMessage(chatId int64, messageId int64, opts *PinChatMessa v["chat_id"] = strconv.FormatInt(chatId, 10) v["message_id"] = strconv.FormatInt(messageId, 10) if opts != nil { + v["business_connection_id"] = opts.BusinessConnectionId v["disable_notification"] = strconv.FormatBool(opts.DisableNotification) } @@ -5471,7 +5474,7 @@ func (bot *Bot) SetStickerPositionInSet(sticker string, position int64, opts *Se // SetStickerSetThumbnailOpts is the set of optional fields for Bot.SetStickerSetThumbnail. type SetStickerSetThumbnailOpts struct { - // A .WEBP or .PNG image with the thumbnail, must be up to 128 kilobytes in size and have a width and height of exactly 100px, or a .TGS animation with a thumbnail up to 32 kilobytes in size (see https://core.telegram.org/stickers#animated-sticker-requirements for animated sticker technical requirements), or a WEBM video with the thumbnail up to 32 kilobytes in size; see https://core.telegram.org/stickers#video-sticker-requirements for video sticker technical requirements. Pass a file_id as a String to send a file that already exists on the Telegram servers, pass an HTTP URL as a String for Telegram to get a file from the Internet, or upload a new one using multipart/form-data. More information on Sending Files: https://core.telegram.org/bots/api#sending-files. Animated and video sticker set thumbnails can't be uploaded via HTTP URL. If omitted, then the thumbnail is dropped and the first sticker is used as the thumbnail. + // A .WEBP or .PNG image with the thumbnail, must be up to 128 kilobytes in size and have a width and height of exactly 100px, or a .TGS animation with a thumbnail up to 32 kilobytes in size (see https://core.telegram.org/stickers#animation-requirements for animated sticker technical requirements), or a WEBM video with the thumbnail up to 32 kilobytes in size; see https://core.telegram.org/stickers#video-requirements for video sticker technical requirements. Pass a file_id as a String to send a file that already exists on the Telegram servers, pass an HTTP URL as a String for Telegram to get a file from the Internet, or upload a new one using multipart/form-data. More information on Sending Files: https://core.telegram.org/bots/api#sending-files. Animated and video sticker set thumbnails can't be uploaded via HTTP URL. If omitted, then the thumbnail is dropped and the first sticker is used as the thumbnail. Thumbnail InputFile // RequestOpts are an additional optional field to configure timeouts for individual requests RequestOpts *RequestOpts @@ -5900,7 +5903,9 @@ func (bot *Bot) UnpinAllGeneralForumTopicMessages(chatId int64, opts *UnpinAllGe // UnpinChatMessageOpts is the set of optional fields for Bot.UnpinChatMessage. type UnpinChatMessageOpts struct { - // Identifier of a message to unpin. If not specified, the most recent pinned message (by sending date) will be unpinned. + // Unique identifier of the business connection on behalf of which the message will be unpinned + BusinessConnectionId string + // Identifier of the message to unpin. Required if business_connection_id is specified. If not specified, the most recent pinned message (by sending date) will be unpinned. MessageId *int64 // RequestOpts are an additional optional field to configure timeouts for individual requests RequestOpts *RequestOpts @@ -5915,6 +5920,7 @@ func (bot *Bot) UnpinChatMessage(chatId int64, opts *UnpinChatMessageOpts) (bool v := map[string]string{} v["chat_id"] = strconv.FormatInt(chatId, 10) if opts != nil { + v["business_connection_id"] = opts.BusinessConnectionId if opts.MessageId != nil { v["message_id"] = strconv.FormatInt(*opts.MessageId, 10) } diff --git a/gen_types.go b/gen_types.go index 7486492..2260e81 100755 --- a/gen_types.go +++ b/gen_types.go @@ -8777,6 +8777,8 @@ type User struct { SupportsInlineQueries bool `json:"supports_inline_queries,omitempty"` // Optional. True, if the bot can be connected to a Telegram Business account to receive its messages. Returned only in getMe. CanConnectToBusiness bool `json:"can_connect_to_business,omitempty"` + // Optional. True, if the bot has a main Web App. Returned only in getMe. + HasMainWebApp bool `json:"has_main_web_app,omitempty"` } // UserChatBoosts (https://core.telegram.org/bots/api#userchatboosts) diff --git a/spec_commit b/spec_commit index 7b65f73..b407755 100644 --- a/spec_commit +++ b/spec_commit @@ -1 +1 @@ -9bcc9ae799d55ec5d08556cfbdfaab49ce0c357d \ No newline at end of file +6c694460e75c07bd789ffd358eff58572caebd35 \ No newline at end of file