(new): v1.2 release
Golang lint / lint (push) Successful in 11m32s

This commit is contained in:
2026-08-19 14:58:25 +03:00
parent f03a081ed6
commit 29b208eeec
79 changed files with 7301 additions and 2060 deletions
+118 -36
View File
@@ -6,25 +6,52 @@ import "context"
// Since: Bot API 1.3
// See https://core.telegram.org/bots/api#sendsticker
type SendSticker struct {
BusinessConnectionID string `json:"business_connection_id,omitempty"`
ChatID int64 `json:"chat_id"`
MessageThreadID int `json:"message_thread_id,omitempty"`
DirectMessagesTopicID int `json:"direct_messages_topic_id,omitempty"`
// BusinessConnectionID Optional. Unique identifier of the business connection on behalf of which the
// message will be sent
BusinessConnectionID string `json:"business_connection_id,omitempty"`
// ChatID Required. Unique identifier for the target chat or username of the target bot, supergroup or
// channel in the format @username
ChatID int64 `json:"chat_id"`
// MessageThreadID Optional. Unique identifier for the target message thread (topic) of a forum; for forum
// supergroups and private chats of bots with forum topic mode enabled only
MessageThreadID int `json:"message_thread_id,omitempty"`
// DirectMessagesTopicID Optional. Identifier of the direct messages topic to which the message will be
// sent; required if the message is sent to a direct messages chat
DirectMessagesTopicID int `json:"direct_messages_topic_id,omitempty"`
// ReceiverUserID identifies the user who can see the ephemeral message.
ReceiverUserID int64 `json:"receiver_user_id,omitempty"` // Since: Bot API 10.2
// CallbackQueryID identifies the callback query that triggered an ephemeral response.
CallbackQueryID string `json:"callback_query_id,omitempty"` // Since: Bot API 10.2
Sticker string `json:"sticker"`
Emoji string `json:"emoji,omitempty"`
DisableNotification bool `json:"disable_notification,omitempty"`
ProtectContent bool `json:"protect_content,omitempty"`
AllowPaidBroadcast bool `json:"allow_paid_broadcast,omitempty"`
MessageEffectID string `json:"message_effect_id,omitempty"`
// Sticker Required. Sticker to send. Pass a file_id as String to send a file that exists on the Telegram
// servers (recommended), pass an HTTP URL as a String for Telegram to get a .WEBP sticker from the
// Internet, or upload a new .WEBP, .TGS, or .WEBM sticker using multipart/form-data. More information on
// Sending Files ». Video and animated stickers can't be sent via an HTTP URL.
Sticker string `json:"sticker"`
// Emoji Optional. Emoji associated with the sticker; only for just uploaded stickers
Emoji string `json:"emoji,omitempty"`
// DisableNotification Optional. Sends the message silently. Users will receive a notification with no
// sound.
DisableNotification bool `json:"disable_notification,omitempty"`
// ProtectContent Optional. Protects the contents of the sent message from forwarding and saving
ProtectContent bool `json:"protect_content,omitempty"`
// AllowPaidBroadcast Optional. Pass True to allow up to 1000 messages per second, ignoring broadcasting
// limits for a fee of 0.1 Telegram Stars per message. The relevant Stars will be withdrawn from the bot's
// balance.
AllowPaidBroadcast bool `json:"allow_paid_broadcast,omitempty"`
// MessageEffectID Optional. Unique identifier of the message effect to be added to the message; for private
// chats only
MessageEffectID string `json:"message_effect_id,omitempty"`
// SuggestedPostParameters Optional. A JSON-serialized object containing the parameters of the suggested
// post to send; for direct messages chats only. If the message is sent as a reply to another suggested
// post, then that suggested post is automatically declined.
SuggestedPostParameters *SuggestedPostParameters `json:"suggested_post_parameters,omitempty"`
ReplyParameters *ReplyParameters `json:"reply_parameters,omitempty"`
ReplyMarkup *ReplyMarkup `json:"reply_markup,omitempty"`
// ReplyParameters Optional. Description of the message to reply to
ReplyParameters *ReplyParameters `json:"reply_parameters,omitempty"`
// ReplyMarkup Optional. Additional interface options. A JSON-serialized object for an inline keyboard,
// custom reply keyboard, instructions to remove a reply keyboard or to force a reply from the user.
ReplyMarkup *ReplyMarkup `json:"reply_markup,omitempty"`
}
// SendSticker sends a static .WEBP, animated .TGS, or video .WEBM sticker.
@@ -48,6 +75,7 @@ func (api *API) SendStickerWithContext(ctx context.Context, params SendSticker)
// Since: Bot API 3.2
// See https://core.telegram.org/bots/api#getstickerset
type GetStickerSet struct {
// Name Required. Name of the sticker set
Name string `json:"name"`
}
@@ -72,6 +100,8 @@ func (api *API) GetStickerSetWithContext(ctx context.Context, params GetStickerS
// Since: Bot API 6.2
// See https://core.telegram.org/bots/api#getcustomemojistickers
type GetCustomEmojiStickers struct {
// CustomEmojiIDs Required. A JSON-serialized list of custom emoji identifiers. At most 200 custom emoji
// identifiers can be specified.
CustomEmojiIDs []string `json:"custom_emoji_ids"`
}
@@ -96,7 +126,9 @@ func (api *API) GetCustomEmojiStickersWithContext(ctx context.Context, params Ge
// Since: Bot API 3.2
// See https://core.telegram.org/bots/api#uploadstickerfile
type UploadStickerFile struct {
UserID int64 `json:"user_id"`
// UserID Required. User identifier of sticker file owner
UserID int64 `json:"user_id"`
// StickerFormat Required. Format of the sticker, must be one of “static”, “animated”, “video”
StickerFormat InputStickerFormat `json:"sticker_format"`
}
@@ -130,13 +162,24 @@ func (api *API) UploadStickerFileWithContext(ctx context.Context, params UploadS
// Since: Bot API 3.2
// See https://core.telegram.org/bots/api#createnewstickerset
type CreateNewStickerSet struct {
UserID int64 `json:"user_id"`
Name string `json:"name"`
Title string `json:"title"`
// UserID Required. User identifier of created sticker set owner
UserID int64 `json:"user_id"`
// Name Required. Short name of sticker set, to be used in t.me/addstickers/ URLs (e.g., animals). Can
// contain only English letters, digits and underscores. Must begin with a letter, can't contain consecutive
// underscores and must end in "_by_<bot_username>". <bot_username> is case insensitive. 1-64 characters.
Name string `json:"name"`
// Title Required. Sticker set title, 1-64 characters
Title string `json:"title"`
Stickers []InputSticker `json:"stickers"`
StickerType StickerType `json:"sticker_type,omitempty"`
NeedsRepainting bool `json:"needs_repainting,omitempty"`
// Stickers Required. A JSON-serialized list of 1-50 initial stickers to be added to the sticker set
Stickers []InputSticker `json:"stickers"`
// StickerType Optional. Type of stickers in the set, pass “regular”, “mask”, or “custom_emoji”.
// By default, a regular sticker set is created.
StickerType StickerType `json:"sticker_type,omitempty"`
// NeedsRepainting Optional. Pass True if stickers in the sticker set must be repainted to the color of text
// when used in messages, the accent color if used as emoji status, white on chat photos, or another
// appropriate color based on context; for custom emoji sticker sets only
NeedsRepainting bool `json:"needs_repainting,omitempty"`
}
// CreateNewStickerSet creates a new sticker set owned by a user.
@@ -161,8 +204,12 @@ func (api *API) CreateNewStickerSetWithContext(ctx context.Context, params Creat
// Since: Bot API 3.2
// See https://core.telegram.org/bots/api#addstickertoset
type AddStickerToSet struct {
UserID int64 `json:"user_id"`
Name string `json:"name"`
// UserID Required. User identifier of sticker set owner
UserID int64 `json:"user_id"`
// Name Required. Sticker set name
Name string `json:"name"`
// Sticker Required. A JSON-serialized object with information about the added sticker. If exactly the same
// sticker had already been added to the set, then the set isn't changed.
Sticker InputSticker `json:"sticker"`
}
@@ -188,8 +235,10 @@ func (api *API) AddStickerToSetWithContext(ctx context.Context, params AddSticke
// Since: Bot API 3.2
// See https://core.telegram.org/bots/api#setstickerpositioninset
type SetStickerPositionInSet struct {
Sticker string `json:"sticker"`
Position int `json:"position"`
// Sticker Required. File identifier of the sticker
Sticker string `json:"sticker"`
// Position Required. New sticker position in the set, zero-based
Position int `json:"position"`
}
// SetStickerPositionInSet moves a sticker in a set to a specific position.
@@ -214,6 +263,7 @@ func (api *API) SetStickerPositionInSetWithContext(ctx context.Context, params S
// Since: Bot API 3.2
// See https://core.telegram.org/bots/api#deletestickerfromset
type DeleteStickerFromSet struct {
// Sticker Required. File identifier of the sticker
Sticker string `json:"sticker"`
}
@@ -239,10 +289,15 @@ func (api *API) DeleteStickerFromSetWithContext(ctx context.Context, params Dele
// Since: Bot API 7.2
// See https://core.telegram.org/bots/api#replacestickerinset
type ReplaceStickerInSet struct {
UserID int64 `json:"user_id"`
Name string `json:"name"`
OldSticker string `json:"old_sticker"`
Sticker InputSticker `json:"sticker"`
// UserID Required. User identifier of the sticker set owner
UserID int64 `json:"user_id"`
// Name Required. Sticker set name
Name string `json:"name"`
// OldSticker Required. File identifier of the replaced sticker
OldSticker string `json:"old_sticker"`
// Sticker Required. A JSON-serialized object with information about the added sticker. If exactly the same
// sticker had already been added to the set, then the set remains unchanged.
Sticker InputSticker `json:"sticker"`
}
// ReplaceStickerInSet replaces an existing sticker in a set with a new one.
@@ -267,7 +322,9 @@ func (api *API) ReplaceStickerInSetWithContext(ctx context.Context, params Repla
// Since: Bot API 6.6
// See https://core.telegram.org/bots/api#setstickeremojilist
type SetStickerEmojiList struct {
Sticker string `json:"sticker"`
// Sticker Required. File identifier of the sticker
Sticker string `json:"sticker"`
// EmojiList Required. A JSON-serialized list of 1-20 emoji associated with the sticker
EmojiList []string `json:"emoji_list"`
}
@@ -293,7 +350,10 @@ func (api *API) SetStickerEmojiListWithContext(ctx context.Context, params SetSt
// Since: Bot API 6.6
// See https://core.telegram.org/bots/api#setstickerkeywords
type SetStickerKeywords struct {
Sticker string `json:"sticker"`
// Sticker Required. File identifier of the sticker
Sticker string `json:"sticker"`
// Keywords Optional. A JSON-serialized list of 0-20 search keywords for the sticker with total length of up
// to 64 characters
Keywords []string `json:"keywords"`
}
@@ -319,7 +379,10 @@ func (api *API) SetStickerKeywordsWithContext(ctx context.Context, params SetSti
// Since: Bot API 6.6
// See https://core.telegram.org/bots/api#setstickermaskposition
type SetStickerMaskPosition struct {
Sticker string `json:"sticker"`
// Sticker Required. File identifier of the sticker
Sticker string `json:"sticker"`
// MaskPosition Optional. A JSON-serialized object with the position where the mask should be placed on
// faces. Omit the parameter to remove the mask position.
MaskPosition *MaskPosition `json:"mask_position,omitempty"`
}
@@ -345,7 +408,9 @@ func (api *API) SetStickerMaskPositionWithContext(ctx context.Context, params Se
// Since: Bot API 6.6
// See https://core.telegram.org/bots/api#setstickersettitle
type SetStickerSetTitle struct {
Name string `json:"name"`
// Name Required. Sticker set name
Name string `json:"name"`
// Title Required. Sticker set title, 1-64 characters
Title string `json:"title"`
}
@@ -371,10 +436,23 @@ func (api *API) SetStickerSetTitleWithContext(ctx context.Context, params SetSti
// Since: Bot API 6.6
// See https://core.telegram.org/bots/api#setstickersetthumbnail
type SetStickerSetThumbnail struct {
Name string `json:"name"`
UserID int64 `json:"user_id"`
Thumbnail string `json:"thumbnail"`
Format InputStickerFormat `json:"format"`
// Name Required. Sticker set name
Name string `json:"name"`
// UserID Required. User identifier of the sticker set owner
UserID int64 `json:"user_id"`
// Thumbnail Optional. A .WEBP or .PNG image with the thumbnail, must be up to 128 kilobytes in size and
// have a width and height of exactly 100px, or a .TGS animation with a thumbnail up to 32 kilobytes in size
// (see https://core.telegram.org/stickers#animation-requirements for animated sticker technical
// requirements), or a .WEBM video with the thumbnail up to 32 kilobytes in size; see
// https://core.telegram.org/stickers#video-requirements for video sticker technical requirements. Pass a
// file_id as a String to send a file that already exists on the Telegram servers, pass an HTTP URL as a
// String for Telegram to get a file from the Internet, or upload a new one using multipart/form-data. More
// information on Sending Files ». Animated and video sticker set thumbnails can't be uploaded via HTTP
// URL. If omitted, then the thumbnail is dropped and the first sticker is used as the thumbnail.
Thumbnail string `json:"thumbnail"`
// Format Required. Format of the thumbnail, must be one of “static” for a .WEBP or .PNG image,
// “animated” for a .TGS animation, or “video” for a .WEBM video
Format InputStickerFormat `json:"format"`
}
// SetStickerSetThumbnail sets the thumbnail of a sticker set.
@@ -399,7 +477,10 @@ func (api *API) SetStickerSetThumbnailWithContext(ctx context.Context, params Se
// Since: Bot API 6.6
// See https://core.telegram.org/bots/api#setcustomemojistickersetthumbnail
type SetCustomEmojiStickerSetThumbnail struct {
Name string `json:"name"`
// Name Required. Sticker set name
Name string `json:"name"`
// CustomEmojiID Optional. Custom emoji identifier of a sticker from the sticker set; pass an empty string
// to drop the thumbnail and use the first sticker as the thumbnail
CustomEmojiID string `json:"custom_emoji_id,omitempty"`
}
@@ -425,6 +506,7 @@ func (api *API) SetCustomEmojiStickerSetThumbnailWithContext(ctx context.Context
// Since: Bot API 6.6
// See https://core.telegram.org/bots/api#deletestickerset
type DeleteStickerSet struct {
// Name Required. Sticker set name
Name string `json:"name"`
}