Skip to content

Commit

Permalink
stickers: support video
Browse files Browse the repository at this point in the history
  • Loading branch information
setval committed Feb 5, 2022
1 parent 1cfc31f commit 40504d2
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
1 change: 1 addition & 0 deletions media.go
Original file line number Diff line number Diff line change
Expand Up @@ -282,6 +282,7 @@ type Sticker struct {
Width int `json:"width"`
Height int `json:"height"`
Animated bool `json:"is_animated"`
Video bool `json:"is_video"`
Thumbnail *Photo `json:"thumb"`
Emoji string `json:"emoji"`
SetName string `json:"set_name"`
Expand Down
7 changes: 7 additions & 0 deletions stickers.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,12 @@ type StickerSet struct {
Name string `json:"name"`
Title string `json:"title"`
Animated bool `json:"is_animated"`
Video bool `json:"is_video"`
Stickers []Sticker `json:"stickers"`
Thumbnail *Photo `json:"thumb"`
PNG *File `json:"png_sticker"`
TGS *File `json:"tgs_sticker"`
WebM *File `json:"webm_sticker"`
Emojis string `json:"emojis"`
ContainsMasks bool `json:"contains_masks"`
MaskPosition *MaskPosition `json:"mask_position"`
Expand Down Expand Up @@ -76,6 +78,9 @@ func (b *Bot) CreateStickerSet(to Recipient, s StickerSet) error {
if s.TGS != nil {
files["tgs_sticker"] = *s.TGS
}
if s.WebM != nil {
files["webm_sticker"] = *s.WebM
}

params := map[string]string{
"user_id": to.Recipient(),
Expand All @@ -101,6 +106,8 @@ func (b *Bot) AddSticker(to Recipient, s StickerSet) error {
files["png_sticker"] = *s.PNG
} else if s.TGS != nil {
files["tgs_sticker"] = *s.TGS
} else if s.WebM != nil {
files["webm_sticker"] = *s.WebM
}

params := map[string]string{
Expand Down

0 comments on commit 40504d2

Please sign in to comment.