-
Notifications
You must be signed in to change notification settings - Fork 470
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
api: implement 6.6, 6.7 features #655
Conversation
Previous type StickerSet struct {
Type StickerSetType `json:"sticker_type"`
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"` // FIXME: can be removed
MaskPosition *MaskPosition `json:"mask_position"`
} New type StickerSet struct {
Type StickerSetType `json:"sticker_type"`
Format StickerSetFormat `json:"sticker_format"`
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"`
Emojis string `json:"emojis"`
ContainsMasks bool `json:"contains_masks"` // FIXME: can be removed
MaskPosition *MaskPosition `json:"mask_position"`
Repaint bool `json:"needs_repainting"`
Stickers []Sticker `json:"stickers"`
} |
stickers.go
Outdated
@@ -72,6 +73,31 @@ func (b *Bot) UploadSticker(to Recipient, png *File) (*File, error) { | |||
return &resp.Result, nil | |||
} | |||
|
|||
// UploadStickerFile uploads a PNG file with a sticker for later use. | |||
func (b *Bot) UploadStickerFile(to Recipient, s Sticker) (*File, error) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rename it to the UploadSticker
, remove the original one.
stickers.go
Outdated
@@ -145,6 +172,33 @@ func (b *Bot) AddSticker(to Recipient, s StickerSet) error { | |||
return err | |||
} | |||
|
|||
// AddStickerToSet adds a new sticker to the existing sticker set. | |||
func (b *Bot) AddStickerToSet(to Recipient, name string, s Sticker) error { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove AddSticker
type StickerSetFormat = string | ||
|
||
const ( | ||
StickerStatic = "static" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Worth adding a context to these constants:
StickerStatic StickerSetFormat = "static"
StickerAnimated StickerSetFormat = "animated"
StickerVideo StickerSetFormat = "video"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do same for the StickerSetType
above.
No description provided.