1
0
Fork 0

Added IsWebP method for sticker

Also fixed Set method
This commit is contained in:
Maxim Lebedev 2018-09-05 16:46:58 +05:00
parent bec98b4a68
commit 4131980f6a
No known key found for this signature in database
GPG Key ID: F8978F46FF0FFA4F
1 changed files with 6 additions and 1 deletions

View File

@ -7,11 +7,16 @@ func (s *Sticker) InSet() bool {
return s != nil && s.SetName != ""
}
// IsWebP check that the current sticker is a WebP file uploaded by user.
func (s *Sticker) IsWebP() bool {
return s != nil && s.SetName == ""
}
// Set use bot for getting parent StickerSet if SetName is present.
//
// Return nil if current sticker has been uploaded by user as WebP file.
func (s *Sticker) Set(bot *Bot) *StickerSet {
if !s.InSet() || bot == nil {
if s.IsWebP() || bot == nil {
return nil
}