From e4e76c64502f6c795fefefde2ab85a02252cf2ee Mon Sep 17 00:00:00 2001 From: Maxim Lebedev Date: Wed, 13 Dec 2017 18:43:11 +0500 Subject: [PATCH] :sparkles: Added DeleteChatStickerSet method --- delete_chat_sticker_set.go | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 delete_chat_sticker_set.go diff --git a/delete_chat_sticker_set.go b/delete_chat_sticker_set.go new file mode 100644 index 0000000..7b32bcb --- /dev/null +++ b/delete_chat_sticker_set.go @@ -0,0 +1,26 @@ +package telegram + +import ( + "strconv" + + json "github.com/pquerna/ffjson/ffjson" + http "github.com/valyala/fasthttp" +) + +// DeleteChatStickerSet delete a group sticker set from a supergroup. The bot must be an administrator +// in the chat for this to work and must have the appropriate admin rights. Use the field +// can_set_sticker_set optionally returned in getChat requests to check if the bot can use this +// method. Returns True on success. +func (bot *Bot) DeleteChatStickerSet(chatID int64) (bool, error) { + var args http.Args + args.Add("chat_id", strconv.FormatInt(chatID, 10)) + + resp, err := bot.request(nil, "deleteChatStickerSet", &args) + if err != nil { + return false, err + } + + var data bool + err = json.Unmarshal(*resp.Result, &data) + return data, err +}