(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
+11
View File
@@ -3,6 +3,7 @@ package tgapi
import "context"
// GetStarTransactions holds parameters for the getStarTransactions method.
// Since: Bot API 7.5
// See https://core.telegram.org/bots/api#getstartransactions
type GetStarTransactions struct {
Offset int `json:"offset,omitempty"`
@@ -10,6 +11,7 @@ type GetStarTransactions struct {
}
// GetMyStarBalance returns the bot's Telegram Star balance.
// Since: Bot API 7.5
// See https://core.telegram.org/bots/api#getmystarbalance
func (api *API) GetMyStarBalance() (StarAmount, error) {
req := NewRequest[StarAmount]("getMyStarBalance", NoParams)
@@ -17,6 +19,7 @@ func (api *API) GetMyStarBalance() (StarAmount, error) {
}
// GetMyStarBalanceWithContext is the context-aware variant of GetMyStarBalance.
// Since: Bot API 7.5
// It executes the same request but uses ctx for cancellation and deadlines.
// See https://core.telegram.org/bots/api#getmystarbalance
func (api *API) GetMyStarBalanceWithContext(ctx context.Context) (StarAmount, error) {
@@ -25,6 +28,7 @@ func (api *API) GetMyStarBalanceWithContext(ctx context.Context) (StarAmount, er
}
// GetStarTransactions returns Telegram Star transactions for the bot.
// Since: Bot API 7.5
// See https://core.telegram.org/bots/api#getstartransactions
func (api *API) GetStarTransactions(params GetStarTransactions) (StarTransactions, error) {
req := NewRequest[StarTransactions]("getStarTransactions", params)
@@ -32,6 +36,7 @@ func (api *API) GetStarTransactions(params GetStarTransactions) (StarTransaction
}
// GetStarTransactionsWithContext is the context-aware variant of GetStarTransactions.
// Since: Bot API 7.5
// It executes the same request but uses ctx for cancellation and deadlines.
// See https://core.telegram.org/bots/api#getstartransactions
func (api *API) GetStarTransactionsWithContext(ctx context.Context, params GetStarTransactions) (StarTransactions, error) {
@@ -40,6 +45,7 @@ func (api *API) GetStarTransactionsWithContext(ctx context.Context, params GetSt
}
// RefundStarPayment holds parameters for the refundStarPayment method.
// Since: Bot API 7.4
// See https://core.telegram.org/bots/api#refundstarpayment
type RefundStarPayment struct {
UserID int64 `json:"user_id"`
@@ -47,6 +53,7 @@ type RefundStarPayment struct {
}
// RefundStarPayment refunds a successful Telegram Stars payment.
// Since: Bot API 7.4
// Returns true on success.
// See https://core.telegram.org/bots/api#refundstarpayment
func (api *API) RefundStarPayment(params RefundStarPayment) (bool, error) {
@@ -55,6 +62,7 @@ func (api *API) RefundStarPayment(params RefundStarPayment) (bool, error) {
}
// RefundStarPaymentWithContext is the context-aware variant of RefundStarPayment.
// Since: Bot API 7.4
// It executes the same request but uses ctx for cancellation and deadlines.
// See https://core.telegram.org/bots/api#refundstarpayment
func (api *API) RefundStarPaymentWithContext(ctx context.Context, params RefundStarPayment) (bool, error) {
@@ -63,6 +71,7 @@ func (api *API) RefundStarPaymentWithContext(ctx context.Context, params RefundS
}
// EditUserStarSubscription holds parameters for the editUserStarSubscription method.
// Since: Bot API 8.0
// See https://core.telegram.org/bots/api#edituserstarsubscription
type EditUserStarSubscription struct {
UserID int64 `json:"user_id"`
@@ -71,6 +80,7 @@ type EditUserStarSubscription struct {
}
// EditUserStarSubscription cancels or re-enables a user star subscription extension.
// Since: Bot API 8.0
// Returns true on success.
// See https://core.telegram.org/bots/api#edituserstarsubscription
func (api *API) EditUserStarSubscription(params EditUserStarSubscription) (bool, error) {
@@ -79,6 +89,7 @@ func (api *API) EditUserStarSubscription(params EditUserStarSubscription) (bool,
}
// EditUserStarSubscriptionWithContext is the context-aware variant of EditUserStarSubscription.
// Since: Bot API 8.0
// It executes the same request but uses ctx for cancellation and deadlines.
// See https://core.telegram.org/bots/api#edituserstarsubscription
func (api *API) EditUserStarSubscriptionWithContext(ctx context.Context, params EditUserStarSubscription) (bool, error) {