all repos — telegram-bot-api @ 2d0a34c34b2947e8f12372d6e1c56fd5bed01673

Golang bindings for the Telegram Bot API

Add types_tests for bot api 6.6 and replace PNGSticker and TGSSticker with the parameters sticker
OvyFlash olegshva4ko@gmail.com
Tue, 04 Jul 2023 23:00:35 +0300
commit

2d0a34c34b2947e8f12372d6e1c56fd5bed01673

parent

a4b5cdb16fde6853486990878f019251eca5c542

2 files changed, 16 insertions(+), 28 deletions(-)

jump to
M configs.goconfigs.go

@@ -2165,15 +2165,10 @@ return params, nil

} func (config UploadStickerConfig) files() []RequestFile { - return []RequestFile{{ - Name: "png_sticker", - Data: config.PNGSticker, - }} + return []RequestFile{config.Sticker} } // NewStickerSetConfig allows creating a new sticker set. -// -// You must set either PNGSticker or TGSSticker. type NewStickerSetConfig struct { UserID int64 Name string

@@ -2204,17 +2199,11 @@ return params, err

} func (config NewStickerSetConfig) files() []RequestFile { - if config.PNGSticker != nil { - return []RequestFile{{ - Name: "png_sticker", - Data: config.PNGSticker, - }} + requestFiles := []RequestFile{} + for _, v := range config.Stickers { + requestFiles = append(requestFiles, v.Sticker) } - - return []RequestFile{{ - Name: "tgs_sticker", - Data: config.TGSSticker, - }} + return requestFiles } // AddStickerConfig allows you to add a sticker to a set.

@@ -2238,18 +2227,7 @@ return params, err

} func (config AddStickerConfig) files() []RequestFile { - if config.PNGSticker != nil { - return []RequestFile{{ - Name: "png_sticker", - Data: config.PNGSticker, - }} - } - - return []RequestFile{{ - Name: "tgs_sticker", - Data: config.TGSSticker, - }} - + return []RequestFile{config.Sticker.Sticker} } // SetStickerPositionConfig allows you to change the position of a sticker in a set.
M types_test.gotypes_test.go

@@ -359,6 +359,16 @@ _ Chattable = CloseGeneralForumTopicConfig{}

_ Chattable = ReopenGeneralForumTopicConfig{} _ Chattable = HideGeneralForumTopicConfig{} _ Chattable = UnhideGeneralForumTopicConfig{} + _ Chattable = SetCustomEmojiStickerSetThumbnalConfig{} + _ Chattable = SetStickerSetTitleConfig{} + _ Chattable = DeleteStickerSetConfig{} + _ Chattable = SetStickerEmojiListConfig{} + _ Chattable = SetStickerKeywordsConfig{} + _ Chattable = SetStickerMaskPositionConfig{} + _ Chattable = GetMyDescriptionConfig{} + _ Chattable = SetMyDescriptionConfig{} + _ Chattable = GetMyShortDescriptionConfig{} + _ Chattable = SetMyShortDescriptionConfig{} ) // Ensure all Fileable types are correct.