Skip to content

Commit 88fa0b8

Browse files
committed
Update to Bot API 8.2
1 parent 385b300 commit 88fa0b8

File tree

4 files changed

+44
-6
lines changed

4 files changed

+44
-6
lines changed

api.go

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1042,3 +1042,35 @@ func (a API) SendGift(userID int64, giftID string, opts *GiftOptions) (res APIRe
10421042
vals.Set("gift_id", giftID)
10431043
return res, client.get(a.base, "sendGift", addValues(vals, opts), &res)
10441044
}
1045+
1046+
// VerifyUser verifies a user on behalf of the organization which is represented by the bot.
1047+
func (a API) VerifyUser(userID int64, opts *VerifyOptions) (res APIResponseBool, err error) {
1048+
var vals = make(url.Values)
1049+
1050+
vals.Set("user_id", itoa(userID))
1051+
return res, client.get(a.base, "verifyUser", addValues(vals, opts), &res)
1052+
}
1053+
1054+
// VerifyChat verifies a chat on behalf of the organization which is represented by the bot.
1055+
func (a API) VerifyChat(chatID int64, opts *VerifyOptions) (res APIResponseBool, err error) {
1056+
var vals = make(url.Values)
1057+
1058+
vals.Set("chat_id", itoa(chatID))
1059+
return res, client.get(a.base, "verifyChat", addValues(vals, opts), &res)
1060+
}
1061+
1062+
// RemoveUserVerification removes verification from a user who is currently verified on behalf of the organization represented by the bot.
1063+
func (a API) RemoveUserVerification(userID int64) (res APIResponseBool, err error) {
1064+
var vals = make(url.Values)
1065+
1066+
vals.Set("user_id", itoa(userID))
1067+
return res, client.get(a.base, "verifyUser", vals, &res)
1068+
}
1069+
1070+
// RemoveChatVerification removes verification from a chat who is currently verified on behalf of the organization represented by the bot.
1071+
func (a API) RemoveChatVerification(chatID int64) (res APIResponseBool, err error) {
1072+
var vals = make(url.Values)
1073+
1074+
vals.Set("chat_id", itoa(chatID))
1075+
return res, client.get(a.base, "verifyChat", vals, &res)
1076+
}

inline.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,6 @@ type InlineQueryResultArticle struct {
8080
URL string `json:"url,omitempty"`
8181
ThumbnailWidth int `json:"thumbnail_width,omitempty"`
8282
ThumbnailHeight int `json:"thumbnail_height,omitempty"`
83-
HideURL bool `json:"hide_url,omitempty"`
8483
}
8584

8685
// ImplementsInlineQueryResult is used to implement the InlineQueryResult interface.

options.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -826,4 +826,10 @@ type GiftOptions struct {
826826
Text string `query:"text"`
827827
TextParseMode string `query:"text_parse_mode"`
828828
TextEntities []MessageEntity `query:"text_entities"`
829+
PayForUpgrade bool `query:"pay_for_upgrade"`
830+
}
831+
832+
// VerifyOptions contains the optional parameters used by the VerifyUser and VerifyChat API methods.
833+
type VerifyOptions struct {
834+
CustomDescription string `query:"custom_description"`
829835
}

types.go

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1791,11 +1791,12 @@ type GiveawayCompleted struct {
17911791

17921792
// Gift represents a gift that can be sent by the bot.
17931793
type Gift struct {
1794-
ID string `json:"id"`
1795-
Sticker Sticker `json:"sticker"`
1796-
StarCount int `json:"star_count"`
1797-
TotalCount int `json:"total_count,omitempty"`
1798-
RemainingCount int `json:"remaining_count,omitempty"`
1794+
ID string `json:"id"`
1795+
Sticker Sticker `json:"sticker"`
1796+
StarCount int `json:"star_count"`
1797+
UpgradeStarCount int `json:"upgrade_star_count,omitempty"`
1798+
TotalCount int `json:"total_count,omitempty"`
1799+
RemainingCount int `json:"remaining_count,omitempty"`
17991800
}
18001801

18011802
// Gifts represents a list of gifts.

0 commit comments

Comments
 (0)