Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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)
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
28 changes: 28 additions & 0 deletions methods.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
24 changes: 24 additions & 0 deletions methods_params.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"`
}

Expand Down Expand Up @@ -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"`
}
Expand Down Expand Up @@ -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"`
}
2 changes: 2 additions & 0 deletions models/chat.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"`
}
1 change: 1 addition & 0 deletions models/checklist.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"`
}

Expand Down
2 changes: 2 additions & 0 deletions models/forum.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,15 @@ 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
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
Expand Down
2 changes: 2 additions & 0 deletions models/gift.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"`
}
Expand All @@ -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
Expand Down
12 changes: 12 additions & 0 deletions models/message.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"`
Expand Down Expand Up @@ -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"`
Expand Down
8 changes: 6 additions & 2 deletions models/reply_markup.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"`
Expand All @@ -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"`
Expand Down
11 changes: 9 additions & 2 deletions models/user.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"`
}
9 changes: 9 additions & 0 deletions models/user_rating.go
Original file line number Diff line number Diff line change
@@ -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"`
}
33 changes: 22 additions & 11 deletions models/video.go
Original file line number Diff line number Diff line change
@@ -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"`
}
Loading