From 274f966c6d00a07199eb00dacc460a57abdbfdcd Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 23 Jan 2026 17:02:29 +0000 Subject: [PATCH] chore(deps): bump github.com/go-telegram/bot from 1.17.0 to 1.18.0 Bumps [github.com/go-telegram/bot](https://github.com/go-telegram/bot) from 1.17.0 to 1.18.0. - [Release notes](https://github.com/go-telegram/bot/releases) - [Changelog](https://github.com/go-telegram/bot/blob/main/CHANGELOG.md) - [Commits](https://github.com/go-telegram/bot/compare/v1.17.0...v1.18.0) --- updated-dependencies: - dependency-name: github.com/go-telegram/bot dependency-version: 1.18.0 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- go.mod | 2 +- go.sum | 4 +- .../github.com/go-telegram/bot/CHANGELOG.md | 19 ++++ vendor/github.com/go-telegram/bot/README.md | 4 +- vendor/github.com/go-telegram/bot/methods.go | 21 ++++ .../go-telegram/bot/methods_params.go | 45 ++++++-- .../github.com/go-telegram/bot/models/chat.go | 2 + .../github.com/go-telegram/bot/models/gift.go | 101 ++++++++++++------ .../go-telegram/bot/models/message.go | 1 + .../github.com/go-telegram/bot/models/user.go | 1 + .../github.com/go-telegram/bot/raw_request.go | 21 ++-- vendor/modules.txt | 2 +- 12 files changed, 170 insertions(+), 53 deletions(-) diff --git a/go.mod b/go.mod index 6a1c2b8..c448568 100644 --- a/go.mod +++ b/go.mod @@ -3,7 +3,7 @@ module github.com/YukariExpress/pgb go 1.25 require ( - github.com/go-telegram/bot v1.17.0 + github.com/go-telegram/bot v1.18.0 github.com/sethvargo/go-envconfig v1.3.0 github.com/stretchr/testify v1.11.1 ) diff --git a/go.sum b/go.sum index ae7a1c2..f3a8b72 100644 --- a/go.sum +++ b/go.sum @@ -1,7 +1,7 @@ github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/go-telegram/bot v1.17.0 h1:Hs0kGxSj97QFqOQP0zxduY/4tSx8QDzvNI9uVRS+zmY= -github.com/go-telegram/bot v1.17.0/go.mod h1:i2TRs7fXWIeaceF3z7KzsMt/he0TwkVC680mvdTFYeM= +github.com/go-telegram/bot v1.18.0 h1:yQzv437DY42SYTPBY48RinAvwbmf1ox5QICskIYWCD8= +github.com/go-telegram/bot v1.18.0/go.mod h1:i2TRs7fXWIeaceF3z7KzsMt/he0TwkVC680mvdTFYeM= github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= diff --git a/vendor/github.com/go-telegram/bot/CHANGELOG.md b/vendor/github.com/go-telegram/bot/CHANGELOG.md index ee5278e..9f77576 100644 --- a/vendor/github.com/go-telegram/bot/CHANGELOG.md +++ b/vendor/github.com/go-telegram/bot/CHANGELOG.md @@ -1,5 +1,24 @@ # Changelog +## v1.18.0 (2026-01-23) + +- support API 9.3 (December 31, 2025 update) + - Topics in private chats: + - Added `has_topics_enabled` field to User + - Gifts: + - Added `getUserGifts` and `getChatGifts` methods + - Replaced `last_resale_star_count` with `last_resale_currency` and `last_resale_amount` in UniqueGiftInfo + - Replaced `exclude_limited` with `exclude_limited_upgradable` and `exclude_limited_non_upgradable` in getBusinessAccountGifts + - Added `gift_upgrade_sent` field to Message + - Added `gift_id`, `is_from_blockchain`, `is_premium`, `colors` fields to UniqueGift + - Added `personal_total_count`, `personal_remaining_count`, `is_premium`, `has_colors`, `background`, `unique_gift_variant_count` fields to Gift + - Added `is_upgrade_separate`, `unique_gift_number` fields to GiftInfo and OwnedGiftRegular + - Added `gifts_from_channels` field to AcceptedGiftTypes + - Added GiftBackground and UniqueGiftColors types + - Added `unique_gift_colors`, `paid_message_star_count` fields to ChatFullInfo + - Streaming: + - Added `sendMessageDraft` method for streaming partial messages + ## v1.17.0 (2025-08-18) - api 9.2 (#207) diff --git a/vendor/github.com/go-telegram/bot/README.md b/vendor/github.com/go-telegram/bot/README.md index c957247..3208034 100644 --- a/vendor/github.com/go-telegram/bot/README.md +++ b/vendor/github.com/go-telegram/bot/README.md @@ -6,7 +6,7 @@ > [Telegram Group](https://t.me/gotelegrambotui) -> Supports Bot API version: [9.2](https://core.telegram.org/bots/api#august-15-2025) from August 15, 2025 +> Supports Bot API version: [9.3](https://core.telegram.org/bots/api#december-31-2025) from December 31, 2025 It's a Go zero-dependencies telegram bot framework @@ -146,7 +146,7 @@ You can use all these methods as bot funcs. All methods have name like in offici `bot.SendMessage`, `bot.GetMe`, `bot.SendPhoto`, etc All methods have signature `(ctx context.Context, params ) (, error)`. -Except `GetMe`, `Close` and `Logout` which are have not params +Except `GetMe`, `Close` and `Logout` which have no params `` is a struct with fields that corresponds to Telegram Bot API parameters. All Params structs have name like for corresponded methods, but with `Params` suffix. diff --git a/vendor/github.com/go-telegram/bot/methods.go b/vendor/github.com/go-telegram/bot/methods.go index 34f8274..68e0a39 100644 --- a/vendor/github.com/go-telegram/bot/methods.go +++ b/vendor/github.com/go-telegram/bot/methods.go @@ -1104,3 +1104,24 @@ func (b *Bot) GiftPremiumSubscription(ctx context.Context, params *GiftPremiumSu err := b.rawRequest(ctx, "giftPremiumSubscription", params, &result) return result, err } + +// GetUserGifts https://core.telegram.org/bots/api#getusergifts +func (b *Bot) GetUserGifts(ctx context.Context, params *GetUserGiftsParams) (*models.OwnedGifts, error) { + result := &models.OwnedGifts{} + err := b.rawRequest(ctx, "getUserGifts", params, &result) + return result, err +} + +// GetChatGifts https://core.telegram.org/bots/api#getchatgifts +func (b *Bot) GetChatGifts(ctx context.Context, params *GetChatGiftsParams) (*models.OwnedGifts, error) { + result := &models.OwnedGifts{} + err := b.rawRequest(ctx, "getChatGifts", params, &result) + return result, err +} + +// SendMessageDraft https://core.telegram.org/bots/api#sendmessagedraft +func (b *Bot) SendMessageDraft(ctx context.Context, params *SendMessageDraftParams) (bool, error) { + var result bool + err := b.rawRequest(ctx, "sendMessageDraft", params, &result) + return result, err +} diff --git a/vendor/github.com/go-telegram/bot/methods_params.go b/vendor/github.com/go-telegram/bot/methods_params.go index c87e091..ccbe7e8 100644 --- a/vendor/github.com/go-telegram/bot/methods_params.go +++ b/vendor/github.com/go-telegram/bot/methods_params.go @@ -1205,15 +1205,17 @@ type TransferBusinessAccountStarsParams struct { // GetBusinessAccountGiftsParams https://core.telegram.org/bots/api#getbusinessaccountgifts type GetBusinessAccountGiftsParams struct { - BusinessConnectionID string `json:"business_connection_id"` - ExcludeUnsaved bool `json:"exclude_unsaved,omitempty"` - ExcludeSaved bool `json:"exclude_saved,omitempty"` - ExcludeUnlimited bool `json:"exclude_unlimited,omitempty"` - ExcludeLimited bool `json:"exclude_limited,omitempty"` - ExcludeUnique bool `json:"exclude_unique,omitempty"` - SortByPrice bool `json:"sort_by_price,omitempty"` - Offset string `json:"offset,omitempty"` - Limit int `json:"limit,omitempty"` + BusinessConnectionID string `json:"business_connection_id"` + ExcludeUnsaved bool `json:"exclude_unsaved,omitempty"` + ExcludeSaved bool `json:"exclude_saved,omitempty"` + ExcludeUnlimited bool `json:"exclude_unlimited,omitempty"` + ExcludeLimitedUpgradable bool `json:"exclude_limited_upgradable,omitempty"` + ExcludeLimitedNonUpgradable bool `json:"exclude_limited_non_upgradable,omitempty"` + ExcludeUnique bool `json:"exclude_unique,omitempty"` + ExcludeFromBlockchain bool `json:"exclude_from_blockchain,omitempty"` + SortByPrice bool `json:"sort_by_price,omitempty"` + Offset string `json:"offset,omitempty"` + Limit int `json:"limit,omitempty"` } // ConvertGiftToStarsParams https://core.telegram.org/bots/api#convertgifttostars @@ -1277,3 +1279,28 @@ type GiftPremiumSubscriptionParams struct { TextParseMode string `json:"text_parse_mode,omitempty"` TextEntities []models.MessageEntity `json:"text_entities,omitempty"` } + +// GetUserGiftsParams https://core.telegram.org/bots/api#getusergifts +type GetUserGiftsParams struct { + UserID int64 `json:"user_id"` + Offset string `json:"offset,omitempty"` + Limit int `json:"limit,omitempty"` +} + +// GetChatGiftsParams https://core.telegram.org/bots/api#getchatgifts +type GetChatGiftsParams struct { + ChatID any `json:"chat_id"` + Offset string `json:"offset,omitempty"` + Limit int `json:"limit,omitempty"` +} + +// SendMessageDraftParams https://core.telegram.org/bots/api#sendmessagedraft +type SendMessageDraftParams struct { + BusinessConnectionID string `json:"business_connection_id,omitempty"` + ChatID any `json:"chat_id"` + MessageThreadID int `json:"message_thread_id,omitempty"` + DraftID string `json:"draft_id"` + Text string `json:"text"` + ParseMode models.ParseMode `json:"parse_mode,omitempty"` + Entities []models.MessageEntity `json:"entities,omitempty"` +} diff --git a/vendor/github.com/go-telegram/bot/models/chat.go b/vendor/github.com/go-telegram/bot/models/chat.go index 755241e..ef94517 100644 --- a/vendor/github.com/go-telegram/bot/models/chat.go +++ b/vendor/github.com/go-telegram/bot/models/chat.go @@ -128,6 +128,7 @@ type ChatFullInfo struct { ProfileBackgroundCustomEmojiID string `json:"profile_background_custom_emoji_id,omitempty"` EmojiStatusCustomEmojiID string `json:"emoji_status_custom_emoji_id,omitempty"` EmojiStatusExpirationDate int `json:"emoji_status_expiration_date,omitempty"` + UniqueGiftColors *UniqueGiftColors `json:"unique_gift_colors,omitempty"` Bio string `json:"bio"` HasPrivateForwards bool `json:"has_private_forwards,omitempty"` HasRestrictedVoiceAndVideoMessages bool `json:"has_restricted_voice_and_video_messages,omitempty"` @@ -151,4 +152,5 @@ type ChatFullInfo struct { CustomEmojiStickerSetName string `json:"custom_emoji_sticker_set_name,omitempty"` LinkedChatID int64 `json:"linked_chat_id,omitempty"` Location *ChatLocation `json:"location,omitempty"` + PaidMessageStarCount int `json:"paid_message_star_count,omitempty"` } diff --git a/vendor/github.com/go-telegram/bot/models/gift.go b/vendor/github.com/go-telegram/bot/models/gift.go index 55f79eb..09eb57a 100644 --- a/vendor/github.com/go-telegram/bot/models/gift.go +++ b/vendor/github.com/go-telegram/bot/models/gift.go @@ -10,22 +10,36 @@ type Gifts struct { Gifts []Gift `json:"gifts"` } +// GiftBackground https://core.telegram.org/bots/api#giftbackground +type GiftBackground struct { + CenterColor int `json:"center_color"` + EdgeColor int `json:"edge_color"` + TextColor int `json:"text_color"` +} + // Gift https://core.telegram.org/bots/api#gift type Gift struct { - ID string `json:"id"` - Sticker Sticker `json:"sticker"` - StarCount int `json:"star_count"` - UpgradeStarCount int `json:"upgrade_star_count,omitempty"` - TotalCount int `json:"total_count,omitempty"` - RemainingCount int `json:"remaining_count,omitempty"` - PublisherChat *Chat `json:"publisher_chat,omitempty"` + ID string `json:"id"` + Sticker Sticker `json:"sticker"` + StarCount int `json:"star_count"` + UpgradeStarCount int `json:"upgrade_star_count,omitempty"` + IsPremium bool `json:"is_premium,omitempty"` + HasColors bool `json:"has_colors,omitempty"` + TotalCount int `json:"total_count,omitempty"` + RemainingCount int `json:"remaining_count,omitempty"` + PersonalTotalCount int `json:"personal_total_count,omitempty"` + PersonalRemainingCount int `json:"personal_remaining_count,omitempty"` + Background *GiftBackground `json:"background,omitempty"` + UniqueGiftVariantCount int `json:"unique_gift_variant_count,omitempty"` + PublisherChat *Chat `json:"publisher_chat,omitempty"` } // AcceptedGiftTypes https://core.telegram.org/bots/api#acceptedgifttypes type AcceptedGiftTypes struct { - UnlimitedGifts bool `json:"unlimited_gifts"` - LimitedGifts bool `json:"limited_gifts"` - UniqueGifts bool `json:"unique_gifts"` + UnlimitedGifts bool `json:"unlimited_gifts"` + LimitedGifts bool `json:"limited_gifts"` + UniqueGifts bool `json:"unique_gifts"` + GiftsFromChannels bool `json:"gifts_from_channels,omitempty"` } // OwnedGift https://core.telegram.org/bots/api#ownedgift @@ -72,14 +86,23 @@ const ( // OwnedGiftRegular https://core.telegram.org/bots/api#ownedgiftregular type OwnedGiftRegular struct { - Type OwnedGiftType `json:"type"` - Gift Gift `json:"gift"` - OwnedGiftID string `json:"owned_gift_id,omitempty"` - SenderUser *User `json:"sender_user,omitempty"` - SendDate int `json:"send_date"` - IsSaved bool `json:"is_saved,omitempty"` - CanBeTransferred bool `json:"can_be_transferred,omitempty"` - TransferStarCount int `json:"transfer_star_count,omitempty"` + Type OwnedGiftType `json:"type"` + Gift Gift `json:"gift"` + OwnedGiftID string `json:"owned_gift_id,omitempty"` + SenderUser *User `json:"sender_user,omitempty"` + SendDate int `json:"send_date"` + Text string `json:"text,omitempty"` + Entities []MessageEntity `json:"entities,omitempty"` + IsPrivate bool `json:"is_private,omitempty"` + IsSaved bool `json:"is_saved,omitempty"` + CanBeUpgraded bool `json:"can_be_upgraded,omitempty"` + WasRefunded bool `json:"was_refunded,omitempty"` + ConvertStarCount int `json:"convert_star_count,omitempty"` + PrepaidUpgradeStarCount int `json:"prepaid_upgrade_star_count,omitempty"` + IsUpgradeSeparate bool `json:"is_upgrade_separate,omitempty"` + UniqueGiftNumber int `json:"unique_gift_number,omitempty"` + CanBeTransferred bool `json:"can_be_transferred,omitempty"` + TransferStarCount int `json:"transfer_star_count,omitempty"` } // OwnedGiftUnique https://core.telegram.org/bots/api#ownedgiftunique @@ -102,15 +125,29 @@ type OwnedGifts struct { NextOffset string `json:"next_offset,omitempty"` } +// UniqueGiftColors https://core.telegram.org/bots/api#uniquegiftcolors +type UniqueGiftColors struct { + ModelCustomEmojiID string `json:"model_custom_emoji_id"` + SymbolCustomEmojiID string `json:"symbol_custom_emoji_id"` + LightThemeMainColor int `json:"light_theme_main_color"` + LightThemeOtherColors []int `json:"light_theme_other_colors"` + DarkThemeMainColor int `json:"dark_theme_main_color"` + DarkThemeOtherColors []int `json:"dark_theme_other_colors"` +} + // UniqueGift https://core.telegram.org/bots/api#uniquegift type UniqueGift struct { - BaseName string `json:"base_name"` - Name string `json:"name"` - Number int `json:"number"` - Model UniqueGiftModel `json:"model"` - Symbol UniqueGiftSymbol `json:"symbol"` - Backdrop UniqueGiftBackdrop `json:"backdrop"` - PublisherChat *Chat `json:"publisher_chat,omitempty"` + GiftID string `json:"gift_id"` + BaseName string `json:"base_name"` + Name string `json:"name"` + Number int `json:"number"` + Model UniqueGiftModel `json:"model"` + Symbol UniqueGiftSymbol `json:"symbol"` + Backdrop UniqueGiftBackdrop `json:"backdrop"` + IsPremium bool `json:"is_premium,omitempty"` + IsFromBlockchain bool `json:"is_from_blockchain,omitempty"` + Colors *UniqueGiftColors `json:"colors,omitempty"` + PublisherChat *Chat `json:"publisher_chat,omitempty"` } // UniqueGiftModel https://core.telegram.org/bots/api#uniquegiftmodel @@ -148,17 +185,21 @@ type GiftInfo struct { OwnedGiftID string `json:"owned_gift_id,omitempty"` ConvertStarCount int `json:"convert_star_count,omitempty"` PrepaidUpgradeStarCount int `json:"prepaid_upgrade_star_count,omitempty"` + IsUpgradeSeparate bool `json:"is_upgrade_separate,omitempty"` CanBeUpgraded bool `json:"can_be_upgraded,omitempty"` Text string `json:"text,omitempty"` Entities []MessageEntity `json:"entities,omitempty"` IsPrivate bool `json:"is_private,omitempty"` + UniqueGiftNumber int `json:"unique_gift_number,omitempty"` } // UniqueGiftInfo https://core.telegram.org/bots/api#uniquegiftinfo type UniqueGiftInfo struct { - Gift UniqueGift `json:"gift"` - Origin string `json:"origin"` - LastResaleStarCount int `json:"last_resale_star_count,omitempty"` - OwnedGiftID string `json:"owned_gift_id,omitempty"` - TransferStarCount int `json:"transfer_star_count,omitempty"` + Gift UniqueGift `json:"gift"` + Origin string `json:"origin"` + LastResaleCurrency string `json:"last_resale_currency,omitempty"` + LastResaleAmount int `json:"last_resale_amount,omitempty"` + OwnedGiftID string `json:"owned_gift_id,omitempty"` + TransferStarCount int `json:"transfer_star_count,omitempty"` + NextTransferDate int `json:"next_transfer_date,omitempty"` } diff --git a/vendor/github.com/go-telegram/bot/models/message.go b/vendor/github.com/go-telegram/bot/models/message.go index 3dd138c..d312b52 100644 --- a/vendor/github.com/go-telegram/bot/models/message.go +++ b/vendor/github.com/go-telegram/bot/models/message.go @@ -141,6 +141,7 @@ type Message struct { ChatShared *ChatShared `json:"chat_shared,omitempty"` Gift *GiftInfo `json:"gift,omitempty"` UniqueGift *UniqueGiftInfo `json:"unique_gift,omitempty"` + GiftUpgradeSent *GiftInfo `json:"gift_upgrade_sent,omitempty"` ConnectedWebsite string `json:"connected_website,omitempty"` WriteAccessAllowed *WriteAccessAllowed `json:"write_access_allowed,omitempty"` PassportData *PassportData `json:"passport_data,omitempty"` diff --git a/vendor/github.com/go-telegram/bot/models/user.go b/vendor/github.com/go-telegram/bot/models/user.go index d7b4454..712f888 100644 --- a/vendor/github.com/go-telegram/bot/models/user.go +++ b/vendor/github.com/go-telegram/bot/models/user.go @@ -20,4 +20,5 @@ type User struct { CanReadAllGroupMessages bool `json:"can_read_all_group_messages,omitempty"` SupportInlineQueries bool `json:"support_inline_queries,omitempty"` CanConnectToBusiness bool `json:"can_connect_to_business,omitempty"` + HasTopicsEnabled bool `json:"has_topics_enabled,omitempty"` } diff --git a/vendor/github.com/go-telegram/bot/raw_request.go b/vendor/github.com/go-telegram/bot/raw_request.go index 4c87c90..755e55e 100644 --- a/vendor/github.com/go-telegram/bot/raw_request.go +++ b/vendor/github.com/go-telegram/bot/raw_request.go @@ -9,6 +9,7 @@ import ( "io" "mime/multipart" "net/http" + "net/url" "reflect" "strings" ) @@ -74,8 +75,12 @@ func (b *Bot) rawRequest(ctx context.Context, method string, params any, dest an if errClose := pr.CloseWithError(errDo); errClose != nil { b.errorsHandler(fmt.Errorf("error close pipe reader for method %s, %w", method, errClose)) } - errDoC := errors.New(strings.Replace(errDo.Error(), b.token, "***", -1)) - return fmt.Errorf("error do request for method %s, %w", method, errDoC) + var netErr *url.Error + if errors.As(errDo, &netErr) { + netErr.URL = strings.Replace(netErr.URL, b.token, "***", -1) + } + + return fmt.Errorf("error do request for method %s, %w", method, errDo) } defer func() { if err := resp.Body.Close(); err != nil { @@ -97,9 +102,9 @@ func (b *Bot) rawRequest(ctx context.Context, method string, params any, dest an if !r.OK { switch r.ErrorCode { - case 403: + case http.StatusForbidden: return fmt.Errorf("%w, %s", ErrorForbidden, r.Description) - case 400: + case http.StatusBadRequest: if r.Parameters.MigrateToChatID != 0 { err := &MigrateError{ Message: fmt.Sprintf("%s: %s", ErrorBadRequest, r.Description), @@ -109,13 +114,13 @@ func (b *Bot) rawRequest(ctx context.Context, method string, params any, dest an return err } return fmt.Errorf("%w, %s", ErrorBadRequest, r.Description) - case 401: + case http.StatusUnauthorized: return fmt.Errorf("%w, %s", ErrorUnauthorized, r.Description) - case 404: + case http.StatusNotFound: return fmt.Errorf("%w, %s", ErrorNotFound, r.Description) - case 409: + case http.StatusConflict: return fmt.Errorf("%w, %s", ErrorConflict, r.Description) - case 429: + case http.StatusTooManyRequests: err := &TooManyRequestsError{ Message: fmt.Sprintf("%s, %s", ErrorTooManyRequests, r.Description), RetryAfter: r.Parameters.RetryAfter, diff --git a/vendor/modules.txt b/vendor/modules.txt index 6deba18..779a6e8 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -1,7 +1,7 @@ # github.com/davecgh/go-spew v1.1.1 ## explicit github.com/davecgh/go-spew/spew -# github.com/go-telegram/bot v1.17.0 +# github.com/go-telegram/bot v1.18.0 ## explicit; go 1.18 github.com/go-telegram/bot github.com/go-telegram/bot/models