media: implement Media interface for the Sticker

pull/477/head
Demian 3 years ago
parent 5aece88b1a
commit fdbd536401

@ -261,6 +261,26 @@ func (v *VideoNote) MediaFile() *File {
return &v.File return &v.File
} }
// Sticker object represents a WebP image, so-called sticker.
type Sticker struct {
File
Width int `json:"width"`
Height int `json:"height"`
Animated bool `json:"is_animated"`
Thumbnail *Photo `json:"thumb"`
Emoji string `json:"emoji"`
SetName string `json:"set_name"`
MaskPosition *MaskPosition `json:"mask_position"`
}
func (s *Sticker) MediaType() string {
return "sticker"
}
func (s *Sticker) MediaFile() *File {
return &s.File
}
// Contact object represents a contact to Telegram user. // Contact object represents a contact to Telegram user.
type Contact struct { type Contact struct {
PhoneNumber string `json:"phone_number"` PhoneNumber string `json:"phone_number"`

@ -5,18 +5,6 @@ import (
"strconv" "strconv"
) )
// Sticker object represents a WebP image, so-called sticker.
type Sticker struct {
File
Width int `json:"width"`
Height int `json:"height"`
Animated bool `json:"is_animated"`
Thumbnail *Photo `json:"thumb"`
Emoji string `json:"emoji"`
SetName string `json:"set_name"`
MaskPosition *MaskPosition `json:"mask_position"`
}
// StickerSet represents a sticker set. // StickerSet represents a sticker set.
type StickerSet struct { type StickerSet struct {
Name string `json:"name"` Name string `json:"name"`

Loading…
Cancel
Save