Skip to content

Commit

Permalink
support API v7.1 (#61)
Browse files Browse the repository at this point in the history
  • Loading branch information
negasus authored Feb 19, 2024
1 parent 427189d commit ceeb95e
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 2 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

## v1.1.0 (2024-02-19)

- support API v7.1

## v1.0.1 (2024-01-15)

- fix: add 'omitempty' to LinkPreviewOptions.URL
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: [7.0](https://core.telegram.org/bots/api#december-29-2023) from December 29, 2023
> Supports Bot API version: [7.1](https://core.telegram.org/bots/api#february-16-2024) from February 16, 2024
It's a Go zero-dependencies telegram bot framework

Expand Down
5 changes: 5 additions & 0 deletions models/boost.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@ import (
"fmt"
)

// ChatBoostAdded https://core.telegram.org/bots/api#chatboostadded
type ChatBoostAdded struct {
BoostCount int `json:"boost_count"`
}

// ChatBoostUpdated https://core.telegram.org/bots/api#chatboostupdated
type ChatBoostUpdated struct {
Chat Chat `json:"chat"`
Expand Down
2 changes: 2 additions & 0 deletions models/chat.go
Original file line number Diff line number Diff line change
Expand Up @@ -102,13 +102,15 @@ type Chat struct {
PinnedMessage *Message `json:"pinned_message,omitempty"`
Permissions *ChatPermissions `json:"permissions,omitempty"`
SlowModeDelay int `json:"slow_mode_delay,omitempty"`
UnrestrictBoostCount int `json:"unrestrict_boost_count,omitempty"`
MessageAutoDeleteTime int `json:"message_auto_delete_time,omitempty"`
HasAggressiveAntiSpamEnabled bool `json:"has_aggressive_anti_spam_enabled,omitempty"`
HasHiddenMembers bool `json:"has_hidden_members,omitempty"`
HasProtectedContent bool `json:"has_protected_content,omitempty"`
HasVisibleHistory bool `json:"has_visible_history,omitempty"`
StickerSetName string `json:"sticker_set_name,omitempty"`
CanSetStickerSet bool `json:"can_set_sticker_set,omitempty"`
CustomEmojiStickerSetName string `json:"custom_emoji_sticker_set_name,omitempty"`
LinkedChatID int64 `json:"linked_chat_id,omitempty"`
Location *ChatLocation `json:"location,omitempty"`
}
3 changes: 3 additions & 0 deletions models/message.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ type Message struct {
MessageThreadID int `json:"message_thread_id,omitempty"`
From *User `json:"from,omitempty"`
SenderChat *Chat `json:"sender_chat,omitempty"`
SenderBoostCount int `json:"sender_boost_count,omitempty"`
Date int `json:"date"`
Chat Chat `json:"chat"`
ForwardOrigin *MessageOrigin `json:"forward_origin,omitempty"`
Expand All @@ -70,6 +71,7 @@ type Message struct {
ReplyToMessage *Message `json:"reply_to_message,omitempty"`
ExternalReply *ExternalReplyInfo `json:"external_reply,omitempty"`
Quote *TextQuote `json:"quote,omitempty"`
ReplyToStore *Story `json:"reply_to_store,omitempty"`
ViaBot *User `json:"via_bot,omitempty"`
EditDate int `json:"edit_date,omitempty"`
HasProtectedContent bool `json:"has_protected_content,omitempty"`
Expand Down Expand Up @@ -116,6 +118,7 @@ type Message struct {
WriteAccessAllowed *WriteAccessAllowed `json:"write_access_allowed,omitempty"`
PassportData *PassportData `json:"passport_data,omitempty"`
ProximityAlertTriggered *ProximityAlertTriggered `json:"proximity_alert_triggered,omitempty"`
BoostAdded *ChatBoostAdded `json:"boost_added,omitempty"`
ForumTopicCreated *ForumTopicCreated `json:"forum_topic_created,omitempty"`
ForumTopicEdited *ForumTopicEdited `json:"forum_topic_edited,omitempty"`
ForumTopicClosed *ForumTopicClosed `json:"forum_topic_closed,omitempty"`
Expand Down
5 changes: 4 additions & 1 deletion models/story.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
package models

type Story struct{}
type Story struct {
Chat Chat `json:"chat"`
ID int `json:"id"`
}

0 comments on commit ceeb95e

Please sign in to comment.