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