diff --git a/CHANGELOG.md b/CHANGELOG.md index 9f77576a..4a7f3d77 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,32 @@ # Changelog +## v1.19.0 (2026-02-12) + +- support API 9.4 (February 9, 2026 update) + - Bot Profile Management: + - Added `setMyProfilePhoto` and `removeMyProfilePhoto` methods + - Forum Topics in Private Chats: + - Added `allows_users_to_create_topics` field to User + - Added `is_name_implicit` field to ForumTopic and ForumTopicCreated + - Colored Buttons: + - Added `style` and `icon_custom_emoji_id` fields to KeyboardButton and InlineKeyboardButton + - Video Quality: + - Added VideoQuality type and `qualities` field to Video + - Chat Owner Events: + - Added ChatOwnerLeft and ChatOwnerChanged types + - Added `chat_owner_left` and `chat_owner_changed` fields to Message + - User Profile Audios: + - Added UserProfileAudios type and `getUserProfileAudios` method + - Added `first_profile_audio` field to ChatFullInfo + - Gifts: + - Added `rarity` field to UniqueGiftModel + - Added `is_burned` field to UniqueGift + - Miscellaneous: + - Added `repostStory` method + - Added UserRating type and `rating` field to ChatFullInfo + - Added `completed_by_chat` field to ChecklistTask + - Added `message_effect_id` to ForwardMessageParams and CopyMessageParams + ## v1.18.0 (2026-01-23) - support API 9.3 (December 31, 2025 update) diff --git a/README.md b/README.md index 3208034f..dd7701ba 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ > [Telegram Group](https://t.me/gotelegrambotui) -> Supports Bot API version: [9.3](https://core.telegram.org/bots/api#december-31-2025) from December 31, 2025 +> Supports Bot API version: [9.4](https://core.telegram.org/bots/api#february-9-2026) from February 9, 2026 It's a Go zero-dependencies telegram bot framework diff --git a/bot.go b/bot.go index c9ae9daf..3c3653a5 100644 --- a/bot.go +++ b/bot.go @@ -10,7 +10,7 @@ import ( "sync" "time" - "github.com/go-telegram/bot/models" + "github.com/TGlimmer/gobot/models" ) const ( diff --git a/bot_test.go b/bot_test.go index 3831eca7..55270f61 100644 --- a/bot_test.go +++ b/bot_test.go @@ -11,7 +11,7 @@ import ( "testing" "time" - "github.com/go-telegram/bot/models" + "github.com/TGlimmer/gobot/models" ) type serverMock struct { diff --git a/build_request_form.go b/build_request_form.go index ff231882..1c0e7eed 100644 --- a/build_request_form.go +++ b/build_request_form.go @@ -9,7 +9,7 @@ import ( "reflect" "strings" - "github.com/go-telegram/bot/models" + "github.com/TGlimmer/gobot/models" ) type inputMedia interface { diff --git a/build_request_form_test.go b/build_request_form_test.go index b0b86a74..91c1e240 100644 --- a/build_request_form_test.go +++ b/build_request_form_test.go @@ -6,7 +6,7 @@ import ( "strings" "testing" - "github.com/go-telegram/bot/models" + "github.com/TGlimmer/gobot/models" ) func assertFormData(t *testing.T, data, expect string) { diff --git a/examples/command_handler/main.go b/examples/command_handler/main.go index 48884e89..2c1abeee 100644 --- a/examples/command_handler/main.go +++ b/examples/command_handler/main.go @@ -5,8 +5,8 @@ import ( "os" "os/signal" - "github.com/go-telegram/bot" - "github.com/go-telegram/bot/models" + "github.com/TGlimmer/gobot" + "github.com/TGlimmer/gobot/models" ) // Send any text message to the bot after the bot has been started diff --git a/examples/commands/main.go b/examples/commands/main.go index bec80fd1..4e385925 100644 --- a/examples/commands/main.go +++ b/examples/commands/main.go @@ -5,8 +5,8 @@ import ( "os" "os/signal" - "github.com/go-telegram/bot" - "github.com/go-telegram/bot/models" + "github.com/TGlimmer/gobot" + "github.com/TGlimmer/gobot/models" ) // Send any text message to the bot after the bot has been started diff --git a/examples/create_new_sticker_set/main.go b/examples/create_new_sticker_set/main.go index 2cc28a0a..2c7144c7 100644 --- a/examples/create_new_sticker_set/main.go +++ b/examples/create_new_sticker_set/main.go @@ -9,8 +9,8 @@ import ( "os/signal" "time" - "github.com/go-telegram/bot" - "github.com/go-telegram/bot/models" + "github.com/TGlimmer/gobot" + "github.com/TGlimmer/gobot/models" ) // Send any text message to the bot after the bot has been started @@ -50,7 +50,7 @@ func handler(ctx context.Context, b *bot.Bot, update *models.Update) { fileContent, _ := images.ReadFile("images/telegram.png") inputSticker1 := models.InputSticker{ - Sticker: "https://github.com/go-telegram/bot/blob/main/examples/create_new_sticker_set/images/telegram.png?raw=true", + Sticker: "https://github.com/TGlimmer/gobot/blob/main/examples/create_new_sticker_set/images/telegram.png?raw=true", Format: "static", EmojiList: []string{"1️⃣"}, } diff --git a/examples/echo/main.go b/examples/echo/main.go index 26aa947c..071a115c 100644 --- a/examples/echo/main.go +++ b/examples/echo/main.go @@ -5,8 +5,8 @@ import ( "os" "os/signal" - "github.com/go-telegram/bot" - "github.com/go-telegram/bot/models" + "github.com/TGlimmer/gobot" + "github.com/TGlimmer/gobot/models" ) // Send any text message to the bot after the bot has been started diff --git a/examples/echo_with_webhook/main.go b/examples/echo_with_webhook/main.go index dba42097..391a6015 100644 --- a/examples/echo_with_webhook/main.go +++ b/examples/echo_with_webhook/main.go @@ -6,8 +6,8 @@ import ( "os" "os/signal" - "github.com/go-telegram/bot" - "github.com/go-telegram/bot/models" + "github.com/TGlimmer/gobot" + "github.com/TGlimmer/gobot/models" ) // Send any text message to the bot after the bot has been started diff --git a/examples/edit_message/main.go b/examples/edit_message/main.go index 2b1dd2ed..a67f9ed4 100644 --- a/examples/edit_message/main.go +++ b/examples/edit_message/main.go @@ -7,8 +7,8 @@ import ( "os/signal" "time" - "github.com/go-telegram/bot" - "github.com/go-telegram/bot/models" + "github.com/TGlimmer/gobot" + "github.com/TGlimmer/gobot/models" ) // Send any text message to the bot after the bot has been started diff --git a/examples/getme/main.go b/examples/getme/main.go index a28b8028..063b8b5c 100644 --- a/examples/getme/main.go +++ b/examples/getme/main.go @@ -5,7 +5,7 @@ import ( "fmt" "os" - "github.com/go-telegram/bot" + "github.com/TGlimmer/gobot" ) func main() { diff --git a/examples/handler_match_func/main.go b/examples/handler_match_func/main.go index 0c6c92e1..c9c30f40 100644 --- a/examples/handler_match_func/main.go +++ b/examples/handler_match_func/main.go @@ -6,8 +6,8 @@ import ( "os" "os/signal" - "github.com/go-telegram/bot" - "github.com/go-telegram/bot/models" + "github.com/TGlimmer/gobot" + "github.com/TGlimmer/gobot/models" ) // Send any text message to the bot after the bot has been started diff --git a/examples/inline_keyboard/main.go b/examples/inline_keyboard/main.go index fe95aee3..eae16758 100644 --- a/examples/inline_keyboard/main.go +++ b/examples/inline_keyboard/main.go @@ -5,8 +5,8 @@ import ( "os" "os/signal" - "github.com/go-telegram/bot" - "github.com/go-telegram/bot/models" + "github.com/TGlimmer/gobot" + "github.com/TGlimmer/gobot/models" ) // Send any text message to the bot after the bot has been started diff --git a/examples/inline_keyboard_multiselect/main.go b/examples/inline_keyboard_multiselect/main.go index 1573306f..93e53f89 100644 --- a/examples/inline_keyboard_multiselect/main.go +++ b/examples/inline_keyboard_multiselect/main.go @@ -6,8 +6,8 @@ import ( "os" "os/signal" - "github.com/go-telegram/bot" - "github.com/go-telegram/bot/models" + "github.com/TGlimmer/gobot" + "github.com/TGlimmer/gobot/models" ) // Send /select command to the bot to see the example in action. diff --git a/examples/inline_mode/main.go b/examples/inline_mode/main.go index 7f0418a1..adedf916 100644 --- a/examples/inline_mode/main.go +++ b/examples/inline_mode/main.go @@ -5,8 +5,8 @@ import ( "os" "os/signal" - "github.com/go-telegram/bot" - "github.com/go-telegram/bot/models" + "github.com/TGlimmer/gobot" + "github.com/TGlimmer/gobot/models" ) // Use inline mode @botname some_text diff --git a/examples/middleware/main.go b/examples/middleware/main.go index 854197ac..92efba52 100644 --- a/examples/middleware/main.go +++ b/examples/middleware/main.go @@ -7,8 +7,8 @@ import ( "os/signal" "sync" - "github.com/go-telegram/bot" - "github.com/go-telegram/bot/models" + "github.com/TGlimmer/gobot" + "github.com/TGlimmer/gobot/models" ) // Send any text message to the bot after the bot has been started diff --git a/examples/payment/main.go b/examples/payment/main.go index c624703c..83c6f907 100644 --- a/examples/payment/main.go +++ b/examples/payment/main.go @@ -6,8 +6,8 @@ import ( "os" "os/signal" - "github.com/go-telegram/bot" - "github.com/go-telegram/bot/models" + "github.com/TGlimmer/gobot" + "github.com/TGlimmer/gobot/models" ) // Payments example diff --git a/examples/send_document/main.go b/examples/send_document/main.go index a47997fb..6e8d4e49 100644 --- a/examples/send_document/main.go +++ b/examples/send_document/main.go @@ -7,8 +7,8 @@ import ( "os" "os/signal" - "github.com/go-telegram/bot" - "github.com/go-telegram/bot/models" + "github.com/TGlimmer/gobot" + "github.com/TGlimmer/gobot/models" ) // Send any text message to the bot after the bot has been started diff --git a/examples/send_media_group/main.go b/examples/send_media_group/main.go index 8cb0abde..551ca3fb 100644 --- a/examples/send_media_group/main.go +++ b/examples/send_media_group/main.go @@ -7,8 +7,8 @@ import ( "os" "os/signal" - "github.com/go-telegram/bot" - "github.com/go-telegram/bot/models" + "github.com/TGlimmer/gobot" + "github.com/TGlimmer/gobot/models" ) // Send any text message to the bot after the bot has been started diff --git a/examples/send_paid_media/main.go b/examples/send_paid_media/main.go index a2d7058f..ee947fea 100644 --- a/examples/send_paid_media/main.go +++ b/examples/send_paid_media/main.go @@ -8,8 +8,8 @@ import ( "os" "os/signal" - "github.com/go-telegram/bot" - "github.com/go-telegram/bot/models" + "github.com/TGlimmer/gobot" + "github.com/TGlimmer/gobot/models" ) func main() { diff --git a/examples/send_photo/main.go b/examples/send_photo/main.go index 2a1f1035..a4616ffb 100644 --- a/examples/send_photo/main.go +++ b/examples/send_photo/main.go @@ -5,8 +5,8 @@ import ( "os" "os/signal" - "github.com/go-telegram/bot" - "github.com/go-telegram/bot/models" + "github.com/TGlimmer/gobot" + "github.com/TGlimmer/gobot/models" ) // Send any text message to the bot after the bot has been started diff --git a/examples/send_photo_upload/main.go b/examples/send_photo_upload/main.go index 29111fde..a254442a 100644 --- a/examples/send_photo_upload/main.go +++ b/examples/send_photo_upload/main.go @@ -7,8 +7,8 @@ import ( "os" "os/signal" - "github.com/go-telegram/bot" - "github.com/go-telegram/bot/models" + "github.com/TGlimmer/gobot" + "github.com/TGlimmer/gobot/models" ) // Send any text message to the bot after the bot has been started diff --git a/examples/streaming_draft/main.go b/examples/streaming_draft/main.go index cbccd954..34ebd0e5 100644 --- a/examples/streaming_draft/main.go +++ b/examples/streaming_draft/main.go @@ -7,8 +7,8 @@ import ( "os/signal" "time" - "github.com/go-telegram/bot" - "github.com/go-telegram/bot/models" + "github.com/TGlimmer/gobot" + "github.com/TGlimmer/gobot/models" ) // This example demonstrates how to use sendMessageDraft to stream diff --git a/get_updates.go b/get_updates.go index feb77046..971fe621 100644 --- a/get_updates.go +++ b/get_updates.go @@ -7,7 +7,7 @@ import ( "sync/atomic" "time" - "github.com/go-telegram/bot/models" + "github.com/TGlimmer/gobot/models" ) const ( diff --git a/go.mod b/go.mod index 19692482..ccbfc53a 100644 --- a/go.mod +++ b/go.mod @@ -1,3 +1,3 @@ -module github.com/go-telegram/bot +module github.com/TGlimmer/gobot go 1.18 diff --git a/handlers.go b/handlers.go index 85457810..47bdc286 100644 --- a/handlers.go +++ b/handlers.go @@ -4,7 +4,7 @@ import ( "regexp" "strings" - "github.com/go-telegram/bot/models" + "github.com/TGlimmer/gobot/models" ) type HandlerType int diff --git a/handlers_test.go b/handlers_test.go index 4a48df3a..712271e3 100644 --- a/handlers_test.go +++ b/handlers_test.go @@ -4,7 +4,7 @@ import ( "regexp" "testing" - "github.com/go-telegram/bot/models" + "github.com/TGlimmer/gobot/models" ) func findHandler(b *Bot, id string) *handler { diff --git a/methods.go b/methods.go index 68e0a393..73d3f434 100644 --- a/methods.go +++ b/methods.go @@ -3,7 +3,7 @@ package bot import ( "context" - "github.com/go-telegram/bot/models" + "github.com/TGlimmer/gobot/models" ) // SetWebhook https://core.telegram.org/bots/api#setwebhook @@ -1125,3 +1125,31 @@ func (b *Bot) SendMessageDraft(ctx context.Context, params *SendMessageDraftPara err := b.rawRequest(ctx, "sendMessageDraft", params, &result) return result, err } + +// RepostStory https://core.telegram.org/bots/api#repoststory +func (b *Bot) RepostStory(ctx context.Context, params *RepostStoryParams) (*models.Story, error) { + result := &models.Story{} + err := b.rawRequest(ctx, "repostStory", params, &result) + return result, err +} + +// SetMyProfilePhoto https://core.telegram.org/bots/api#setmyprofilephoto +func (b *Bot) SetMyProfilePhoto(ctx context.Context, params *SetMyProfilePhotoParams) (bool, error) { + var result bool + err := b.rawRequest(ctx, "setMyProfilePhoto", params, &result) + return result, err +} + +// RemoveMyProfilePhoto https://core.telegram.org/bots/api#removemyprofilephoto +func (b *Bot) RemoveMyProfilePhoto(ctx context.Context) (bool, error) { + var result bool + err := b.rawRequest(ctx, "removeMyProfilePhoto", nil, &result) + return result, err +} + +// GetUserProfileAudios https://core.telegram.org/bots/api#getuserprofileaudios +func (b *Bot) GetUserProfileAudios(ctx context.Context, params *GetUserProfileAudiosParams) (*models.UserProfileAudios, error) { + result := &models.UserProfileAudios{} + err := b.rawRequest(ctx, "getUserProfileAudios", params, &result) + return result, err +} diff --git a/methods_params.go b/methods_params.go index ccbe7e80..2aeae37c 100644 --- a/methods_params.go +++ b/methods_params.go @@ -1,7 +1,7 @@ package bot import ( - "github.com/go-telegram/bot/models" + "github.com/TGlimmer/gobot/models" ) type SetWebhookParams struct { @@ -47,6 +47,7 @@ type ForwardMessageParams struct { DisableNotification bool `json:"disable_notification,omitempty"` ProtectContent bool `json:"protect_content,omitempty"` SuggestedPostParameters *models.SuggestedPostParameters `json:"suggested_post_parameters,omitempty"` + MessageEffectID string `json:"message_effect_id,omitempty"` MessageID int `json:"message_id"` } @@ -77,6 +78,7 @@ type CopyMessageParams struct { ProtectContent bool `json:"protect_content,omitempty"` AllowPaidBroadcast bool `json:"allow_paid_broadcast,omitempty"` SuggestedPostParameters *models.SuggestedPostParameters `json:"suggested_post_parameters,omitempty"` + MessageEffectID string `json:"message_effect_id,omitempty"` ReplyParameters *models.ReplyParameters `json:"reply_parameters,omitempty"` ReplyMarkup models.ReplyMarkup `json:"reply_markup,omitempty"` } @@ -1304,3 +1306,25 @@ type SendMessageDraftParams struct { ParseMode models.ParseMode `json:"parse_mode,omitempty"` Entities []models.MessageEntity `json:"entities,omitempty"` } + +// RepostStoryParams https://core.telegram.org/bots/api#repoststory +type RepostStoryParams struct { + BusinessConnectionID string `json:"business_connection_id"` + FromChatID int64 `json:"from_chat_id"` + FromStoryID int `json:"from_story_id"` + ActivePeriod int `json:"active_period"` + PostToChatPage bool `json:"post_to_chat_page,omitempty"` + ProtectContent bool `json:"protect_content,omitempty"` +} + +// SetMyProfilePhotoParams https://core.telegram.org/bots/api#setmyprofilephoto +type SetMyProfilePhotoParams struct { + Photo models.InputProfilePhoto `json:"photo"` +} + +// GetUserProfileAudiosParams https://core.telegram.org/bots/api#getuserprofileaudios +type GetUserProfileAudiosParams struct { + UserID int64 `json:"user_id"` + Offset int `json:"offset,omitempty"` + Limit int `json:"limit,omitempty"` +} diff --git a/methods_test.go b/methods_test.go index 795e40a4..0367f72b 100644 --- a/methods_test.go +++ b/methods_test.go @@ -8,7 +8,7 @@ import ( "net/http" "testing" - "github.com/go-telegram/bot/models" + "github.com/TGlimmer/gobot/models" ) type httpClient struct { diff --git a/models/chat.go b/models/chat.go index ef94517f..f3ffc8fb 100644 --- a/models/chat.go +++ b/models/chat.go @@ -153,4 +153,6 @@ type ChatFullInfo struct { LinkedChatID int64 `json:"linked_chat_id,omitempty"` Location *ChatLocation `json:"location,omitempty"` PaidMessageStarCount int `json:"paid_message_star_count,omitempty"` + Rating *UserRating `json:"rating,omitempty"` + FirstProfileAudio *Audio `json:"first_profile_audio,omitempty"` } diff --git a/models/checklist.go b/models/checklist.go index 92bb541e..7ecc2224 100644 --- a/models/checklist.go +++ b/models/checklist.go @@ -6,6 +6,7 @@ type ChecklistTask struct { Text string `json:"text"` TextEntities []MessageEntity `json:"text_entities,omitempty"` CompletedByUser *User `json:"completed_by_user,omitempty"` + CompletedByChat *Chat `json:"completed_by_chat,omitempty"` CompletionDate int `json:"completion_date,omitempty"` } diff --git a/models/forum.go b/models/forum.go index 66841998..747cd493 100644 --- a/models/forum.go +++ b/models/forum.go @@ -6,6 +6,7 @@ type ForumTopic struct { Name string `json:"name"` IconColor int `json:"icon_color,omitempty"` IconCustomEmojiID string `json:"icon_custom_emoji_id,omitempty"` + IsNameImplicit bool `json:"is_name_implicit,omitempty"` } // ForumTopicCreated https://core.telegram.org/bots/api#forumtopiccreated @@ -13,6 +14,7 @@ type ForumTopicCreated struct { Name string `json:"name"` IconColor int `json:"icon_color"` IconCustomEmojiID string `json:"icon_custom_emoji_id,omitempty"` + IsNameImplicit bool `json:"is_name_implicit,omitempty"` } // ForumTopicClosed https://core.telegram.org/bots/api#forumtopicclosed diff --git a/models/gift.go b/models/gift.go index 09eb57a6..1cd4358e 100644 --- a/models/gift.go +++ b/models/gift.go @@ -146,6 +146,7 @@ type UniqueGift struct { Backdrop UniqueGiftBackdrop `json:"backdrop"` IsPremium bool `json:"is_premium,omitempty"` IsFromBlockchain bool `json:"is_from_blockchain,omitempty"` + IsBurned bool `json:"is_burned,omitempty"` Colors *UniqueGiftColors `json:"colors,omitempty"` PublisherChat *Chat `json:"publisher_chat,omitempty"` } @@ -155,6 +156,7 @@ type UniqueGiftModel struct { Name string `json:"name"` Sticker Sticker `json:"sticker"` RarityPerMille int `json:"rarity_per_mille"` + Rarity string `json:"rarity,omitempty"` } // UniqueGiftSymbol https://core.telegram.org/bots/api#uniquegiftsymbol diff --git a/models/message.go b/models/message.go index d312b521..586fc021 100644 --- a/models/message.go +++ b/models/message.go @@ -68,6 +68,16 @@ type MessageAutoDeleteTimerChanged struct { MessageAutoDeleteTime int `json:"message_auto_delete_time"` } +// ChatOwnerLeft https://core.telegram.org/bots/api#chatownerleft +type ChatOwnerLeft struct { + NewOwner *User `json:"new_owner,omitempty"` +} + +// ChatOwnerChanged https://core.telegram.org/bots/api#chatownerchanged +type ChatOwnerChanged struct { + NewOwner User `json:"new_owner"` +} + // Message https://core.telegram.org/bots/api#message type Message struct { ID int `json:"message_id"` @@ -162,6 +172,8 @@ type Message struct { GiveawayWinners *GiveawayWinners `json:"giveaway_winners,omitempty"` GiveawayCompleted *GiveawayCompleted `json:"giveaway_completed,omitempty"` PaidMessagePriceChanged *PaidMessagePriceChanged `json:"paid_message_price_changed,omitempty"` + ChatOwnerLeft *ChatOwnerLeft `json:"chat_owner_left,omitempty"` + ChatOwnerChanged *ChatOwnerChanged `json:"chat_owner_changed,omitempty"` SuggestedPostApproved *SuggestedPostApproved `json:"suggested_post_approved,omitempty"` SuggestedPostApprovalFailed *SuggestedPostApprovalFailed `json:"suggested_post_approval_failed,omitempty"` SuggestedPostDeclined *SuggestedPostDeclined `json:"suggested_post_declined,omitempty"` diff --git a/models/reply_markup.go b/models/reply_markup.go index cd0d3edc..a59bc8fe 100644 --- a/models/reply_markup.go +++ b/models/reply_markup.go @@ -32,6 +32,8 @@ type CopyTextButton struct { // InlineKeyboardButton https://core.telegram.org/bots/api#inlinekeyboardbutton type InlineKeyboardButton struct { Text string `json:"text"` + IconCustomEmojiID string `json:"icon_custom_emoji_id,omitempty"` + Style string `json:"style,omitempty"` URL string `json:"url,omitempty"` CallbackData string `json:"callback_data,omitempty"` WebApp *WebAppInfo `json:"web_app,omitempty"` @@ -56,8 +58,10 @@ type ReplyKeyboardMarkup struct { // KeyboardButton https://core.telegram.org/bots/api#keyboardbutton type KeyboardButton struct { - Text string `json:"text"` - RequestUser *KeyboardButtonRequestUsers `json:"request_user,omitempty"` + Text string `json:"text"` + IconCustomEmojiID string `json:"icon_custom_emoji_id,omitempty"` + Style string `json:"style,omitempty"` + RequestUser *KeyboardButtonRequestUsers `json:"request_user,omitempty"` RequestUsers *KeyboardButtonRequestUsers `json:"request_users,omitempty"` RequestChat *KeyboardButtonRequestChat `json:"request_chat,omitempty"` RequestContact bool `json:"request_contact,omitempty"` diff --git a/models/user.go b/models/user.go index 712f888e..6274e397 100644 --- a/models/user.go +++ b/models/user.go @@ -19,6 +19,13 @@ type User struct { CanJoinGroups bool `json:"can_join_groups,omitempty"` 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"` + CanConnectToBusiness bool `json:"can_connect_to_business,omitempty"` + HasTopicsEnabled bool `json:"has_topics_enabled,omitempty"` + AllowsUsersToCreateTopics bool `json:"allows_users_to_create_topics,omitempty"` +} + +// UserProfileAudios https://core.telegram.org/bots/api#userprofileaudios +type UserProfileAudios struct { + TotalCount int `json:"total_count"` + Audios []Audio `json:"audios"` } diff --git a/models/user_rating.go b/models/user_rating.go new file mode 100644 index 00000000..4c4cd87a --- /dev/null +++ b/models/user_rating.go @@ -0,0 +1,9 @@ +package models + +// UserRating https://core.telegram.org/bots/api#userrating +type UserRating struct { + Level int `json:"level"` + Rating int `json:"rating"` + CurrentLevelRating int `json:"current_level_rating"` + NextLevelRating int `json:"next_level_rating,omitempty"` +} diff --git a/models/video.go b/models/video.go index 0f00a56f..24fa1d31 100644 --- a/models/video.go +++ b/models/video.go @@ -1,16 +1,27 @@ package models +// VideoQuality https://core.telegram.org/bots/api#videoquality +type VideoQuality struct { + FileID string `json:"file_id"` + FileUniqueID string `json:"file_unique_id"` + Width int `json:"width"` + Height int `json:"height"` + Codec string `json:"codec"` + FileSize int64 `json:"file_size,omitempty"` +} + // Video https://core.telegram.org/bots/api#video type Video struct { - FileID string `json:"file_id"` - FileUniqueID string `json:"file_unique_id"` - Width int `json:"width"` - Height int `json:"height"` - Duration int `json:"duration"` - Thumbnail *PhotoSize `json:"thumbnail,omitempty"` - Cover []PhotoSize `json:"cover,omitempty"` - StartTimestamp int `json:"start_timestamp,omitempty"` - FileName string `json:"file_name,omitempty"` - MimeType string `json:"mime_type,omitempty"` - FileSize int64 `json:"file_size,omitempty"` + FileID string `json:"file_id"` + FileUniqueID string `json:"file_unique_id"` + Width int `json:"width"` + Height int `json:"height"` + Duration int `json:"duration"` + Thumbnail *PhotoSize `json:"thumbnail,omitempty"` + Cover []PhotoSize `json:"cover,omitempty"` + StartTimestamp int `json:"start_timestamp,omitempty"` + FileName string `json:"file_name,omitempty"` + MimeType string `json:"mime_type,omitempty"` + FileSize int64 `json:"file_size,omitempty"` + Qualities []VideoQuality `json:"qualities,omitempty"` } diff --git a/options.go b/options.go index 0530ab18..e5be7b29 100644 --- a/options.go +++ b/options.go @@ -3,7 +3,7 @@ package bot import ( "time" - "github.com/go-telegram/bot/models" + "github.com/TGlimmer/gobot/models" ) // Option is a function that configures a bot. diff --git a/process_update.go b/process_update.go index 88d56beb..506494aa 100644 --- a/process_update.go +++ b/process_update.go @@ -3,7 +3,7 @@ package bot import ( "context" - "github.com/go-telegram/bot/models" + "github.com/TGlimmer/gobot/models" ) func applyMiddlewares(h HandlerFunc, m ...Middleware) HandlerFunc { diff --git a/process_update_test.go b/process_update_test.go index 117f4c98..c49116dd 100644 --- a/process_update_test.go +++ b/process_update_test.go @@ -4,7 +4,7 @@ import ( "context" "testing" - "github.com/go-telegram/bot/models" + "github.com/TGlimmer/gobot/models" ) func Test_applyMiddlewares(t *testing.T) { diff --git a/webhook_handler.go b/webhook_handler.go index 2cc55779..e35c31e2 100644 --- a/webhook_handler.go +++ b/webhook_handler.go @@ -5,7 +5,7 @@ import ( "io" "net/http" - "github.com/go-telegram/bot/models" + "github.com/TGlimmer/gobot/models" ) func (b *Bot) WebhookHandler() http.HandlerFunc { diff --git a/webhook_handler_test.go b/webhook_handler_test.go index 20eff637..ae52fbc8 100644 --- a/webhook_handler_test.go +++ b/webhook_handler_test.go @@ -10,7 +10,7 @@ import ( "net/http/httptest" "testing" - "github.com/go-telegram/bot/models" + "github.com/TGlimmer/gobot/models" ) type mockDebugHandler struct {