FILE / ScuroNeko/Laniakea
tgapi/stickers_types.go
Исходный файл и его история в репозитории.
131 lines
6.1 KiB
Go
131 lines
6.1 KiB
Go
package tgapi
|
|
|
|
// MaskPositionPoint represents the part of the face where a mask should be placed.
|
|
type MaskPositionPoint string
|
|
|
|
const (
|
|
// MaskPositionForehead places the mask on the forehead.
|
|
MaskPositionForehead MaskPositionPoint = "forehead"
|
|
// MaskPositionEyes places the mask on the eyes.
|
|
MaskPositionEyes MaskPositionPoint = "eyes"
|
|
// MaskPositionMouth places the mask on the mouth.
|
|
MaskPositionMouth MaskPositionPoint = "mouth"
|
|
// MaskPositionChin places the mask on the chin.
|
|
MaskPositionChin MaskPositionPoint = "chin"
|
|
)
|
|
|
|
// MaskPosition describes the position on faces where a mask should be placed by default.
|
|
// Since: Bot API 3.2
|
|
// See https://core.telegram.org/bots/api#maskposition
|
|
type MaskPosition struct {
|
|
// Point The part of the face relative to which the mask should be placed. One of “forehead”,
|
|
// “eyes”, “mouth”, or “chin”.
|
|
Point MaskPositionPoint `json:"point"`
|
|
// XShift Shift by X-axis measured in widths of the mask scaled to the face size, from left to right. For
|
|
// example, choosing -1.0 will place mask just to the left of the default mask position.
|
|
XShift float32 `json:"x_shift"`
|
|
// YShift Shift by Y-axis measured in heights of the mask scaled to the face size, from top to bottom. For
|
|
// example, 1.0 will place the mask just below the default mask position.
|
|
YShift float32 `json:"y_shift"`
|
|
// Scale Mask scaling coefficient. For example, 2.0 means double size.
|
|
Scale float32 `json:"scale"`
|
|
}
|
|
|
|
// StickerType represents the type of a sticker.
|
|
type StickerType string
|
|
|
|
const (
|
|
// StickerTypeRegular is a regular sticker.
|
|
StickerTypeRegular StickerType = "regular"
|
|
// StickerTypeMask is a mask sticker that can be placed on faces.
|
|
StickerTypeMask StickerType = "mask"
|
|
// StickerTypeCustomEmoji is a custom emoji sticker.
|
|
StickerTypeCustomEmoji StickerType = "custom_emoji"
|
|
)
|
|
|
|
// Sticker represents a sticker.
|
|
// Since: Bot API 1.0
|
|
// See https://core.telegram.org/bots/api#sticker
|
|
type Sticker struct {
|
|
// FileID Identifier for this file, which can be used to download or reuse the file
|
|
FileID string `json:"file_id"`
|
|
// FileUniqueID Unique identifier for this file, which is supposed to be the same over time and for
|
|
// different bots. Can't be used to download or reuse the file.
|
|
FileUniqueID string `json:"file_unique_id"`
|
|
// Width Sticker width
|
|
Width int `json:"width"`
|
|
// Height Sticker height
|
|
Height int `json:"height"`
|
|
|
|
// Type Type of the sticker, currently one of “regular”, “mask”, “custom_emoji”. The type of the
|
|
// sticker is independent from its format, which is determined by the fields is_animated and is_video.
|
|
Type StickerType `json:"type"` // Since: Bot API 6.2
|
|
// IsAnimated True, if the sticker is animated
|
|
IsAnimated bool `json:"is_animated"` // Since: Bot API 4.4
|
|
// IsVideo True, if the sticker is a video sticker
|
|
IsVideo bool `json:"is_video"` // Since: Bot API 5.7
|
|
// Thumbnail Optional. Sticker thumbnail in the .WEBP or .JPG format
|
|
Thumbnail *PhotoSize `json:"thumbnail,omitempty"` // Since: Bot API 6.6
|
|
// Emoji Optional. Emoji associated with the sticker
|
|
Emoji *string `json:"emoji,omitempty"`
|
|
// SetName Optional. Name of the sticker set to which the sticker belongs
|
|
SetName *string `json:"set_name,omitempty"` // Since: Bot API 3.2
|
|
// MaskPosition Optional. For mask stickers, the position where the mask should be placed
|
|
MaskPosition *MaskPosition `json:"mask_position,omitempty"` // Since: Bot API 3.2
|
|
// CustomEmojiID Optional. For custom emoji stickers, unique identifier of the custom emoji
|
|
CustomEmojiID *string `json:"custom_emoji_id,omitempty"` // Since: Bot API 6.2
|
|
// NeedRepainting reports whether Telegram must recolor the custom emoji sticker.
|
|
NeedRepainting *bool `json:"need_repainting,omitempty"` // Since: Bot API 6.6
|
|
// FileSize Optional. File size in bytes
|
|
FileSize *int64 `json:"file_size,omitempty"`
|
|
}
|
|
|
|
// StickerSet represents a sticker set.
|
|
// Since: Bot API 3.2
|
|
// See https://core.telegram.org/bots/api#stickerset
|
|
type StickerSet struct {
|
|
// Name Sticker set name
|
|
Name string `json:"name"`
|
|
// Title Sticker set title
|
|
Title string `json:"title"`
|
|
// StickerType Type of stickers in the set, currently one of “regular”, “mask”, “custom_emoji”
|
|
StickerType StickerType `json:"sticker_type"`
|
|
// Stickers List of all set stickers
|
|
Stickers []Sticker `json:"stickers"`
|
|
// Thumbnail Optional. Sticker set thumbnail in the .WEBP, .TGS, or .WEBM format
|
|
Thumbnail *PhotoSize `json:"thumbnail,omitempty"`
|
|
}
|
|
|
|
// InputStickerFormat represents the format of an input sticker.
|
|
type InputStickerFormat string
|
|
|
|
const (
|
|
// InputStickerFormatStatic is a static sticker (WEBP).
|
|
InputStickerFormatStatic InputStickerFormat = "static"
|
|
// InputStickerFormatAnimated is an animated sticker (TGS).
|
|
InputStickerFormatAnimated InputStickerFormat = "animated"
|
|
// InputStickerFormatVideo is a video sticker (WEBM).
|
|
InputStickerFormatVideo InputStickerFormat = "video"
|
|
)
|
|
|
|
// InputSticker describes a sticker to be added to a sticker set.
|
|
// Since: Bot API 6.6
|
|
// See https://core.telegram.org/bots/api#inputsticker
|
|
type InputSticker struct {
|
|
// Sticker The added sticker. 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 pass
|
|
// “attach://<file_attach_name>” to upload a new file using multipart/form-data under <file_attach_name>
|
|
// name. Animated and video stickers can't be uploaded via HTTP URL. More information on Sending Files »
|
|
Sticker string `json:"sticker"`
|
|
// Format Format of the added sticker, must be one of “static” for a .WEBP or .PNG image, “animated”
|
|
// for a .TGS animation, “video” for a .WEBM video
|
|
Format InputStickerFormat `json:"format"`
|
|
// EmojiList List of 1-20 emoji associated with the sticker
|
|
EmojiList []string `json:"emoji_list"`
|
|
// MaskPosition Optional. Position where the mask should be placed on faces. For “mask” stickers only.
|
|
MaskPosition *MaskPosition `json:"mask_position,omitempty"`
|
|
// Keywords Optional. List of 0-20 search keywords for the sticker with total length of up to 64 characters.
|
|
// For “regular” and “custom_emoji” stickers only.
|
|
Keywords []string `json:"keywords,omitempty"`
|
|
}
|