(new): Bot API 10.0
Golang lint / lint (push) Successful in 2m53s
Golang lint / lint (pull_request) Successful in 2m54s

(doc): Since: Bot API X.Y annotations across all tgapi types and methods
This commit is contained in:
2026-05-19 13:42:10 +03:00
parent affb802a7b
commit 1e26d871b5
29 changed files with 1347 additions and 242 deletions
+9
View File
@@ -3,6 +3,7 @@ package tgapi
import "context"
// SendGame holds parameters for the sendGame method.
// Since: Bot API 2.2
// See https://core.telegram.org/bots/api#sendgame
type SendGame struct {
BusinessConnectionID string `json:"business_connection_id,omitempty"`
@@ -20,6 +21,7 @@ type SendGame struct {
}
// SendGame sends a game message.
// Since: Bot API 2.2
// See https://core.telegram.org/bots/api#sendgame
func (api *API) SendGame(params SendGame) (Message, error) {
req := NewRequestWithChatID[Message]("sendGame", params, params.ChatID)
@@ -27,6 +29,7 @@ func (api *API) SendGame(params SendGame) (Message, error) {
}
// SendGameWithContext is the context-aware variant of SendGame.
// Since: Bot API 2.2
// It executes the same request but uses ctx for cancellation and deadlines.
// See https://core.telegram.org/bots/api#sendgame
func (api *API) SendGameWithContext(ctx context.Context, params SendGame) (Message, error) {
@@ -35,6 +38,7 @@ func (api *API) SendGameWithContext(ctx context.Context, params SendGame) (Messa
}
// SetGameScore holds parameters for the setGameScore method.
// Since: Bot API 2.2
// See https://core.telegram.org/bots/api#setgamescore
type SetGameScore struct {
UserID int64 `json:"user_id"`
@@ -47,6 +51,7 @@ type SetGameScore struct {
}
// SetGameScore sets a user's score in a game message.
// Since: Bot API 2.2
// If inline_message_id is provided, returns a boolean success flag.
// Otherwise returns the edited Message.
// See https://core.telegram.org/bots/api#setgamescore
@@ -63,6 +68,7 @@ func (api *API) SetGameScore(params SetGameScore) (Message, bool, error) {
}
// SetGameScoreWithContext is the context-aware variant of SetGameScore.
// Since: Bot API 2.2
// It executes the same request but uses ctx for cancellation and deadlines.
// See https://core.telegram.org/bots/api#setgamescore
func (api *API) SetGameScoreWithContext(ctx context.Context, params SetGameScore) (Message, bool, error) {
@@ -78,6 +84,7 @@ func (api *API) SetGameScoreWithContext(ctx context.Context, params SetGameScore
}
// GetGameHighScores holds parameters for the getGameHighScores method.
// Since: Bot API 2.2
// See https://core.telegram.org/bots/api#getgamehighscores
type GetGameHighScores struct {
UserID int64 `json:"user_id"`
@@ -87,6 +94,7 @@ type GetGameHighScores struct {
}
// GetGameHighScores returns game high score data for a user.
// Since: Bot API 2.2
// See https://core.telegram.org/bots/api#getgamehighscores
func (api *API) GetGameHighScores(params GetGameHighScores) ([]GameHighScore, error) {
req := NewRequestWithChatID[[]GameHighScore]("getGameHighScores", params, params.ChatID)
@@ -94,6 +102,7 @@ func (api *API) GetGameHighScores(params GetGameHighScores) ([]GameHighScore, er
}
// GetGameHighScoresWithContext is the context-aware variant of GetGameHighScores.
// Since: Bot API 2.2
// It executes the same request but uses ctx for cancellation and deadlines.
// See https://core.telegram.org/bots/api#getgamehighscores
func (api *API) GetGameHighScoresWithContext(ctx context.Context, params GetGameHighScores) ([]GameHighScore, error) {