Add sticker and sticker set type documentation

bot-api-6.1
Ilya Kaznacheev 2020-10-24 15:44:24 +03:00
parent b6df6c273a
commit 1f1d97f1e3
No known key found for this signature in database
GPG Key ID: 7E2C1D8A4AB37D50
1 changed files with 74 additions and 29 deletions

View File

@ -428,50 +428,95 @@ func (e MessageEntity) IsTextLink() bool {
// PhotoSize contains information about photos.
type PhotoSize struct {
// FileID identifier for this file, which can be used to download or reuse the file
FileID string `json:"file_id"`
// Width photo width
Width int `json:"width"`
// Height photo height
Height int `json:"height"`
FileSize int `json:"file_size"` // optional
// FileSize file size
// optional
FileSize int `json:"file_size"`
}
// Audio contains information about audio.
type Audio struct {
// FileID is an identifier for this file, which can be used to download or reuse the file
FileID string `json:"file_id"`
// Duration of the audio in seconds as defined by sender
Duration int `json:"duration"`
Performer string `json:"performer"` // optional
Title string `json:"title"` // optional
MimeType string `json:"mime_type"` // optional
FileSize int `json:"file_size"` // optional
// Performer of the audio as defined by sender or by audio tags
// optional
Performer string `json:"performer"`
// Title of the audio as defined by sender or by audio tags
// optional
Title string `json:"title"`
// MimeType of the file as defined by sender
// optional
MimeType string `json:"mime_type"`
// FileSize file size
// optional
FileSize int `json:"file_size"`
}
// Document contains information about a document.
type Document struct {
// FileID is a identifier for this file, which can be used to download or reuse the file
FileID string `json:"file_id"`
Thumbnail *PhotoSize `json:"thumb"` // optional
FileName string `json:"file_name"` // optional
MimeType string `json:"mime_type"` // optional
FileSize int `json:"file_size"` // optional
// Thumbnail document thumbnail as defined by sender
// optional
Thumbnail *PhotoSize `json:"thumb"`
// FileName original filename as defined by sender
// optional
FileName string `json:"file_name"`
// MimeType of the file as defined by sender
// optional
MimeType string `json:"mime_type"`
// FileSize file size
// optional
FileSize int `json:"file_size"`
}
// Sticker contains information about a sticker.
type Sticker struct {
// FileUniqueID is an 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"`
// FileID is an identifier for this file, which can be used to download or reuse the file
FileID string `json:"file_id"`
// Width sticker width
Width int `json:"width"`
// Height sticker height
Height int `json:"height"`
Thumbnail *PhotoSize `json:"thumb"` // optional
Emoji string `json:"emoji"` // optional
FileSize int `json:"file_size"` // optional
SetName string `json:"set_name"` // optional
IsAnimated bool `json:"is_animated"` // optional
// Thumbnail sticker thumbnail in the .WEBP or .JPG format
// optional
Thumbnail *PhotoSize `json:"thumb"`
// Emoji associated with the sticker
// optional
Emoji string `json:"emoji"`
// FileSize
// optional
FileSize int `json:"file_size"`
// SetName of the sticker set to which the sticker belongs
// optional
SetName string `json:"set_name"`
// IsAnimated true, if the sticker is animated
// optional
IsAnimated bool `json:"is_animated"`
}
// StickerSet contains information about an sticker set.
type StickerSet struct {
// Name sticker set name
Name string `json:"name"`
// Title sticker set title
Title string `json:"title"`
// IsAnimated true, if the sticker set contains animated stickers
IsAnimated bool `json:"is_animated"`
// ContainsMasks true, if the sticker set contains masks
ContainsMasks bool `json:"contains_masks"`
// Stickers list of all set stickers
Stickers []Sticker `json:"stickers"`
}