Skip to content

Commit

Permalink
api 8.2 (#144)
Browse files Browse the repository at this point in the history
* api 8.2

* fix readme
  • Loading branch information
negasus authored Jan 10, 2025
1 parent 6bbaef2 commit 934a13a
Show file tree
Hide file tree
Showing 5 changed files with 58 additions and 7 deletions.
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: [8.1](https://core.telegram.org/bots/api#december-4-2024) from December 4, 2024
> Supports Bot API version: [8.2](https://core.telegram.org/bots/api#january-1-2025) from January 1, 2025
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 @@ -915,3 +915,31 @@ func (b *Bot) SendGift(ctx context.Context, params *SendGiftParams) (bool, error
err := b.rawRequest(ctx, "sendGift", params, &result)
return result, err
}

// VerifyUser https://core.telegram.org/bots/api#verifyuser
func (b *Bot) VerifyUser(ctx context.Context, params *VerifyUserParams) (bool, error) {
var result bool
err := b.rawRequest(ctx, "verifyUser", params, &result)
return result, err
}

// VerifyChat https://core.telegram.org/bots/api#verifychat
func (b *Bot) VerifyChat(ctx context.Context, params *VerifyChatParams) (bool, error) {
var result bool
err := b.rawRequest(ctx, "verifyChat", params, &result)
return result, err
}

// RemoveUserVerification https://core.telegram.org/bots/api#removeuserverification
func (b *Bot) RemoveUserVerification(ctx context.Context, params *RemoveUserVerificationParams) (bool, error) {
var result bool
err := b.rawRequest(ctx, "removeUserVerification", params, &result)
return result, err
}

// RemoveChatVerification https://core.telegram.org/bots/api#removechatverification
func (b *Bot) RemoveChatVerification(ctx context.Context, params *RemoveChatVerificationParams) (bool, error) {
var result bool
err := b.rawRequest(ctx, "removeChatVerification", params, &result)
return result, err
}
23 changes: 23 additions & 0 deletions methods_params.go
Original file line number Diff line number Diff line change
Expand Up @@ -1032,7 +1032,30 @@ type GetGameHighScoresParams struct {
type SendGiftParams struct {
UserID int64 `json:"user_id"`
GiftID string `json:"gift_id"`
PayForUpgrade bool `json:"pay_for_upgrade,omitempty"`
Text string `json:"text,omitempty"`
TextParseMode models.ParseMode `json:"text_parse_mode,omitempty"`
TextEntities []models.MessageEntity `json:"text_entities,omitempty"`
}

// VerifyUserParams https://core.telegram.org/bots/api#verifyuser
type VerifyUserParams struct {
UserID int64 `json:"user_id"`
CustomDescription string `json:"custom_description,omitempty"`
}

// VerifyChatParams https://core.telegram.org/bots/api#verifychat
type VerifyChatParams struct {
ChatID any `json:"chat_id"`
CustomDescription string `json:"custom_description,omitempty"`
}

// RemoveUserVerificationParams https://core.telegram.org/bots/api#removeuserverification
type RemoveUserVerificationParams struct {
UserID int64 `json:"user_id"`
}

// RemoveChatVerificationParams https://core.telegram.org/bots/api#removechatverification
type RemoveChatVerificationParams struct {
ChatID any `json:"chat_id"`
}
11 changes: 6 additions & 5 deletions models/gift.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,10 @@ type Gifts struct {

// Gift https://core.telegram.org/bots/api#gift
type Gift struct {
ID string `json:"id"`
Sticker Sticker `json:"sticker"`
StarCount int `json:"star_count"`
TotalCount int `json:"total_count,omitempty"`
RemainingCount int `json:"remaining_count,omitempty"`
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"`
}
1 change: 0 additions & 1 deletion models/inline_query.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ type InlineQueryResultArticle struct {
InputMessageContent InputMessageContent `json:"input_message_content,omitempty"`
ReplyMarkup ReplyMarkup `json:"reply_markup,omitempty"`
URL string `json:"url,omitempty"`
HideURL bool `json:"hide_url,omitempty"`
Description string `json:"description,omitempty"`
ThumbnailURL string `json:"thumbnail_url,omitempty"`
ThumbnailWidth int `json:"thumbnail_width,omitempty"`
Expand Down

0 comments on commit 934a13a

Please sign in to comment.