(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
+48
View File
@@ -3,6 +3,7 @@ package tgapi
import "context"
// SendSticker holds parameters for the sendSticker method.
// Since: Bot API 1.3
// See https://core.telegram.org/bots/api#sendsticker
type SendSticker struct {
BusinessConnectionID string `json:"business_connection_id,omitempty"`
@@ -23,6 +24,7 @@ type SendSticker struct {
}
// SendSticker sends a static .WEBP, animated .TGS, or video .WEBM sticker.
// Since: Bot API 1.3
// See https://core.telegram.org/bots/api#sendsticker
func (api *API) SendSticker(params SendSticker) (Message, error) {
req := NewRequestWithChatID[Message]("sendSticker", params, params.ChatID)
@@ -30,6 +32,7 @@ func (api *API) SendSticker(params SendSticker) (Message, error) {
}
// SendStickerWithContext is the context-aware variant of SendSticker.
// Since: Bot API 1.3
// It executes the same request but uses ctx for cancellation and deadlines.
// See https://core.telegram.org/bots/api#sendsticker
func (api *API) SendStickerWithContext(ctx context.Context, params SendSticker) (Message, error) {
@@ -38,12 +41,14 @@ func (api *API) SendStickerWithContext(ctx context.Context, params SendSticker)
}
// GetStickerSet holds parameters for the getStickerSet method.
// Since: Bot API 3.2
// See https://core.telegram.org/bots/api#getstickerset
type GetStickerSet struct {
Name string `json:"name"`
}
// GetStickerSet returns a sticker set by its name.
// Since: Bot API 3.2
// See https://core.telegram.org/bots/api#getstickerset
func (api *API) GetStickerSet(params GetStickerSet) (StickerSet, error) {
req := NewRequest[StickerSet]("getStickerSet", params)
@@ -51,6 +56,7 @@ func (api *API) GetStickerSet(params GetStickerSet) (StickerSet, error) {
}
// GetStickerSetWithContext is the context-aware variant of GetStickerSet.
// Since: Bot API 3.2
// It executes the same request but uses ctx for cancellation and deadlines.
// See https://core.telegram.org/bots/api#getstickerset
func (api *API) GetStickerSetWithContext(ctx context.Context, params GetStickerSet) (StickerSet, error) {
@@ -59,12 +65,14 @@ func (api *API) GetStickerSetWithContext(ctx context.Context, params GetStickerS
}
// GetCustomEmojiStickers holds parameters for the getCustomEmojiStickers method.
// Since: Bot API 6.2
// See https://core.telegram.org/bots/api#getcustomemojistickers
type GetCustomEmojiStickers struct {
CustomEmojiIDs []string `json:"custom_emoji_ids"`
}
// GetCustomEmojiStickers returns information about custom emoji stickers by their IDs.
// Since: Bot API 6.2
// See https://core.telegram.org/bots/api#getcustomemojistickers
func (api *API) GetCustomEmojiStickers(params GetCustomEmojiStickers) ([]Sticker, error) {
req := NewRequest[[]Sticker]("getCustomEmojiStickers", params)
@@ -72,6 +80,7 @@ func (api *API) GetCustomEmojiStickers(params GetCustomEmojiStickers) ([]Sticker
}
// GetCustomEmojiStickersWithContext is the context-aware variant of GetCustomEmojiStickers.
// Since: Bot API 6.2
// It executes the same request but uses ctx for cancellation and deadlines.
// See https://core.telegram.org/bots/api#getcustomemojistickers
func (api *API) GetCustomEmojiStickersWithContext(ctx context.Context, params GetCustomEmojiStickers) ([]Sticker, error) {
@@ -80,6 +89,7 @@ func (api *API) GetCustomEmojiStickersWithContext(ctx context.Context, params Ge
}
// UploadStickerFile holds parameters for the uploadStickerFile method.
// Since: Bot API 3.2
// See https://core.telegram.org/bots/api#uploadstickerfile
type UploadStickerFile struct {
UserID int64 `json:"user_id"`
@@ -87,6 +97,7 @@ type UploadStickerFile struct {
}
// UploadStickerFile uploads a sticker file for later use in sticker set methods.
// Since: Bot API 3.2
// sticker is the file to upload.
// See https://core.telegram.org/bots/api#uploadstickerfile
func (api *API) UploadStickerFile(params UploadStickerFile, sticker UploaderFile) (File, error) {
@@ -99,6 +110,7 @@ func (api *API) UploadStickerFile(params UploadStickerFile, sticker UploaderFile
}
// UploadStickerFileWithContext is the context-aware variant of UploadStickerFile.
// Since: Bot API 3.2
// It executes the same request but uses ctx for cancellation and deadlines.
// See https://core.telegram.org/bots/api#uploadstickerfile
func (api *API) UploadStickerFileWithContext(ctx context.Context, params UploadStickerFile, sticker UploaderFile) (File, error) {
@@ -111,6 +123,7 @@ func (api *API) UploadStickerFileWithContext(ctx context.Context, params UploadS
}
// CreateNewStickerSet holds parameters for the createNewStickerSet method.
// Since: Bot API 3.2
// See https://core.telegram.org/bots/api#createnewstickerset
type CreateNewStickerSet struct {
UserID int64 `json:"user_id"`
@@ -123,6 +136,7 @@ type CreateNewStickerSet struct {
}
// CreateNewStickerSet creates a new sticker set owned by a user.
// Since: Bot API 3.2
// Returns True on success.
// See https://core.telegram.org/bots/api#createnewstickerset
func (api *API) CreateNewStickerSet(params CreateNewStickerSet) (bool, error) {
@@ -131,6 +145,7 @@ func (api *API) CreateNewStickerSet(params CreateNewStickerSet) (bool, error) {
}
// CreateNewStickerSetWithContext is the context-aware variant of CreateNewStickerSet.
// Since: Bot API 3.2
// It executes the same request but uses ctx for cancellation and deadlines.
// See https://core.telegram.org/bots/api#createnewstickerset
func (api *API) CreateNewStickerSetWithContext(ctx context.Context, params CreateNewStickerSet) (bool, error) {
@@ -139,6 +154,7 @@ func (api *API) CreateNewStickerSetWithContext(ctx context.Context, params Creat
}
// AddStickerToSet holds parameters for the addStickerToSet method.
// Since: Bot API 3.2
// See https://core.telegram.org/bots/api#addstickertoset
type AddStickerToSet struct {
UserID int64 `json:"user_id"`
@@ -147,6 +163,7 @@ type AddStickerToSet struct {
}
// AddStickerToSet adds a new sticker to a set created by the bot.
// Since: Bot API 3.2
// Returns True on success.
// See https://core.telegram.org/bots/api#addstickertoset
func (api *API) AddStickerToSet(params AddStickerToSet) (bool, error) {
@@ -155,6 +172,7 @@ func (api *API) AddStickerToSet(params AddStickerToSet) (bool, error) {
}
// AddStickerToSetWithContext is the context-aware variant of AddStickerToSet.
// Since: Bot API 3.2
// It executes the same request but uses ctx for cancellation and deadlines.
// See https://core.telegram.org/bots/api#addstickertoset
func (api *API) AddStickerToSetWithContext(ctx context.Context, params AddStickerToSet) (bool, error) {
@@ -163,6 +181,7 @@ func (api *API) AddStickerToSetWithContext(ctx context.Context, params AddSticke
}
// SetStickerPositionInSet holds parameters for the setStickerPositionInSet method.
// Since: Bot API 3.2
// See https://core.telegram.org/bots/api#setstickerpositioninset
type SetStickerPositionInSet struct {
Sticker string `json:"sticker"`
@@ -170,6 +189,7 @@ type SetStickerPositionInSet struct {
}
// SetStickerPositionInSet moves a sticker in a set to a specific position.
// Since: Bot API 3.2
// Returns True on success.
// See https://core.telegram.org/bots/api#setstickerpositioninset
func (api *API) SetStickerPositionInSet(params SetStickerPositionInSet) (bool, error) {
@@ -178,6 +198,7 @@ func (api *API) SetStickerPositionInSet(params SetStickerPositionInSet) (bool, e
}
// SetStickerPositionInSetWithContext is the context-aware variant of SetStickerPositionInSet.
// Since: Bot API 3.2
// It executes the same request but uses ctx for cancellation and deadlines.
// See https://core.telegram.org/bots/api#setstickerpositioninset
func (api *API) SetStickerPositionInSetWithContext(ctx context.Context, params SetStickerPositionInSet) (bool, error) {
@@ -186,12 +207,14 @@ func (api *API) SetStickerPositionInSetWithContext(ctx context.Context, params S
}
// DeleteStickerFromSet holds parameters for the deleteStickerFromSet method.
// Since: Bot API 3.2
// See https://core.telegram.org/bots/api#deletestickerfromset
type DeleteStickerFromSet struct {
Sticker string `json:"sticker"`
}
// DeleteStickerFromSet deletes a sticker from a set created by the bot.
// Since: Bot API 3.2
// Returns True on success.
// See https://core.telegram.org/bots/api#deletestickerfromset
func (api *API) DeleteStickerFromSet(params DeleteStickerFromSet) (bool, error) {
@@ -200,6 +223,7 @@ func (api *API) DeleteStickerFromSet(params DeleteStickerFromSet) (bool, error)
}
// DeleteStickerFromSetWithContext is the context-aware variant of DeleteStickerFromSet.
// Since: Bot API 3.2
// It executes the same request but uses ctx for cancellation and deadlines.
// See https://core.telegram.org/bots/api#deletestickerfromset
func (api *API) DeleteStickerFromSetWithContext(ctx context.Context, params DeleteStickerFromSet) (bool, error) {
@@ -208,6 +232,7 @@ func (api *API) DeleteStickerFromSetWithContext(ctx context.Context, params Dele
}
// ReplaceStickerInSet holds parameters for the replaceStickerInSet method.
// Since: Bot API 7.2
// See https://core.telegram.org/bots/api#replacestickerinset
type ReplaceStickerInSet struct {
UserID int64 `json:"user_id"`
@@ -217,6 +242,7 @@ type ReplaceStickerInSet struct {
}
// ReplaceStickerInSet replaces an existing sticker in a set with a new one.
// Since: Bot API 7.2
// Returns True on success.
// See https://core.telegram.org/bots/api#replacestickerinset
func (api *API) ReplaceStickerInSet(params ReplaceStickerInSet) (bool, error) {
@@ -225,6 +251,7 @@ func (api *API) ReplaceStickerInSet(params ReplaceStickerInSet) (bool, error) {
}
// ReplaceStickerInSetWithContext is the context-aware variant of ReplaceStickerInSet.
// Since: Bot API 7.2
// It executes the same request but uses ctx for cancellation and deadlines.
// See https://core.telegram.org/bots/api#replacestickerinset
func (api *API) ReplaceStickerInSetWithContext(ctx context.Context, params ReplaceStickerInSet) (bool, error) {
@@ -233,6 +260,7 @@ func (api *API) ReplaceStickerInSetWithContext(ctx context.Context, params Repla
}
// SetStickerEmojiList holds parameters for the setStickerEmojiList method.
// Since: Bot API 6.6
// See https://core.telegram.org/bots/api#setstickeremojilist
type SetStickerEmojiList struct {
Sticker string `json:"sticker"`
@@ -240,6 +268,7 @@ type SetStickerEmojiList struct {
}
// SetStickerEmojiList changes the list of emoji associated with a sticker.
// Since: Bot API 6.6
// Returns True on success.
// See https://core.telegram.org/bots/api#setstickeremojilist
func (api *API) SetStickerEmojiList(params SetStickerEmojiList) (bool, error) {
@@ -248,6 +277,7 @@ func (api *API) SetStickerEmojiList(params SetStickerEmojiList) (bool, error) {
}
// SetStickerEmojiListWithContext is the context-aware variant of SetStickerEmojiList.
// Since: Bot API 6.6
// It executes the same request but uses ctx for cancellation and deadlines.
// See https://core.telegram.org/bots/api#setstickeremojilist
func (api *API) SetStickerEmojiListWithContext(ctx context.Context, params SetStickerEmojiList) (bool, error) {
@@ -256,6 +286,7 @@ func (api *API) SetStickerEmojiListWithContext(ctx context.Context, params SetSt
}
// SetStickerKeywords holds parameters for the setStickerKeywords method.
// Since: Bot API 6.6
// See https://core.telegram.org/bots/api#setstickerkeywords
type SetStickerKeywords struct {
Sticker string `json:"sticker"`
@@ -263,6 +294,7 @@ type SetStickerKeywords struct {
}
// SetStickerKeywords changes the keywords of a sticker.
// Since: Bot API 6.6
// Returns True on success.
// See https://core.telegram.org/bots/api#setstickerkeywords
func (api *API) SetStickerKeywords(params SetStickerKeywords) (bool, error) {
@@ -271,6 +303,7 @@ func (api *API) SetStickerKeywords(params SetStickerKeywords) (bool, error) {
}
// SetStickerKeywordsWithContext is the context-aware variant of SetStickerKeywords.
// Since: Bot API 6.6
// It executes the same request but uses ctx for cancellation and deadlines.
// See https://core.telegram.org/bots/api#setstickerkeywords
func (api *API) SetStickerKeywordsWithContext(ctx context.Context, params SetStickerKeywords) (bool, error) {
@@ -279,6 +312,7 @@ func (api *API) SetStickerKeywordsWithContext(ctx context.Context, params SetSti
}
// SetStickerMaskPosition holds parameters for the setStickerMaskPosition method.
// Since: Bot API 6.6
// See https://core.telegram.org/bots/api#setstickermaskposition
type SetStickerMaskPosition struct {
Sticker string `json:"sticker"`
@@ -286,6 +320,7 @@ type SetStickerMaskPosition struct {
}
// SetStickerMaskPosition changes the mask position of a mask sticker.
// Since: Bot API 6.6
// Returns True on success.
// See https://core.telegram.org/bots/api#setstickermaskposition
func (api *API) SetStickerMaskPosition(params SetStickerMaskPosition) (bool, error) {
@@ -294,6 +329,7 @@ func (api *API) SetStickerMaskPosition(params SetStickerMaskPosition) (bool, err
}
// SetStickerMaskPositionWithContext is the context-aware variant of SetStickerMaskPosition.
// Since: Bot API 6.6
// It executes the same request but uses ctx for cancellation and deadlines.
// See https://core.telegram.org/bots/api#setstickermaskposition
func (api *API) SetStickerMaskPositionWithContext(ctx context.Context, params SetStickerMaskPosition) (bool, error) {
@@ -302,6 +338,7 @@ func (api *API) SetStickerMaskPositionWithContext(ctx context.Context, params Se
}
// SetStickerSetTitle holds parameters for the setStickerSetTitle method.
// Since: Bot API 6.6
// See https://core.telegram.org/bots/api#setstickersettitle
type SetStickerSetTitle struct {
Name string `json:"name"`
@@ -309,6 +346,7 @@ type SetStickerSetTitle struct {
}
// SetStickerSetTitle sets the title of a sticker set created by the bot.
// Since: Bot API 6.6
// Returns True on success.
// See https://core.telegram.org/bots/api#setstickersettitle
func (api *API) SetStickerSetTitle(params SetStickerSetTitle) (bool, error) {
@@ -317,6 +355,7 @@ func (api *API) SetStickerSetTitle(params SetStickerSetTitle) (bool, error) {
}
// SetStickerSetTitleWithContext is the context-aware variant of SetStickerSetTitle.
// Since: Bot API 6.6
// It executes the same request but uses ctx for cancellation and deadlines.
// See https://core.telegram.org/bots/api#setstickersettitle
func (api *API) SetStickerSetTitleWithContext(ctx context.Context, params SetStickerSetTitle) (bool, error) {
@@ -325,6 +364,7 @@ func (api *API) SetStickerSetTitleWithContext(ctx context.Context, params SetSti
}
// SetStickerSetThumbnail holds parameters for the setStickerSetThumbnail method.
// Since: Bot API 6.6
// See https://core.telegram.org/bots/api#setstickersetthumbnail
type SetStickerSetThumbnail struct {
Name string `json:"name"`
@@ -334,6 +374,7 @@ type SetStickerSetThumbnail struct {
}
// SetStickerSetThumbnail sets the thumbnail of a sticker set.
// Since: Bot API 6.6
// Returns True on success.
// See https://core.telegram.org/bots/api#setstickersetthumbnail
func (api *API) SetStickerSetThumbnail(params SetStickerSetThumbnail) (bool, error) {
@@ -342,6 +383,7 @@ func (api *API) SetStickerSetThumbnail(params SetStickerSetThumbnail) (bool, err
}
// SetStickerSetThumbnailWithContext is the context-aware variant of SetStickerSetThumbnail.
// Since: Bot API 6.6
// It executes the same request but uses ctx for cancellation and deadlines.
// See https://core.telegram.org/bots/api#setstickersetthumbnail
func (api *API) SetStickerSetThumbnailWithContext(ctx context.Context, params SetStickerSetThumbnail) (bool, error) {
@@ -350,6 +392,7 @@ func (api *API) SetStickerSetThumbnailWithContext(ctx context.Context, params Se
}
// SetCustomEmojiStickerSetThumbnail holds parameters for the setCustomEmojiStickerSetThumbnail method.
// Since: Bot API 6.6
// See https://core.telegram.org/bots/api#setcustomemojistickersetthumbnail
type SetCustomEmojiStickerSetThumbnail struct {
Name string `json:"name"`
@@ -357,6 +400,7 @@ type SetCustomEmojiStickerSetThumbnail struct {
}
// SetCustomEmojiStickerSetThumbnail sets the thumbnail of a custom emoji sticker set.
// Since: Bot API 6.6
// Returns True on success.
// See https://core.telegram.org/bots/api#setcustomemojistickersetthumbnail
func (api *API) SetCustomEmojiStickerSetThumbnail(params SetCustomEmojiStickerSetThumbnail) (bool, error) {
@@ -365,6 +409,7 @@ func (api *API) SetCustomEmojiStickerSetThumbnail(params SetCustomEmojiStickerSe
}
// SetCustomEmojiStickerSetThumbnailWithContext is the context-aware variant of SetCustomEmojiStickerSetThumbnail.
// Since: Bot API 6.6
// It executes the same request but uses ctx for cancellation and deadlines.
// See https://core.telegram.org/bots/api#setcustomemojistickersetthumbnail
func (api *API) SetCustomEmojiStickerSetThumbnailWithContext(ctx context.Context, params SetCustomEmojiStickerSetThumbnail) (bool, error) {
@@ -373,12 +418,14 @@ func (api *API) SetCustomEmojiStickerSetThumbnailWithContext(ctx context.Context
}
// DeleteStickerSet holds parameters for the deleteStickerSet method.
// Since: Bot API 6.6
// See https://core.telegram.org/bots/api#deletestickerset
type DeleteStickerSet struct {
Name string `json:"name"`
}
// DeleteStickerSet deletes a sticker set created by the bot.
// Since: Bot API 6.6
// Returns True on success.
// See https://core.telegram.org/bots/api#deletestickerset
func (api *API) DeleteStickerSet(params DeleteStickerSet) (bool, error) {
@@ -387,6 +434,7 @@ func (api *API) DeleteStickerSet(params DeleteStickerSet) (bool, error) {
}
// DeleteStickerSetWithContext is the context-aware variant of DeleteStickerSet.
// Since: Bot API 6.6
// It executes the same request but uses ctx for cancellation and deadlines.
// See https://core.telegram.org/bots/api#deletestickerset
func (api *API) DeleteStickerSetWithContext(ctx context.Context, params DeleteStickerSet) (bool, error) {