From d171c61e7f1433b37f02056f989d12a33b7477bb Mon Sep 17 00:00:00 2001 From: Netkas Date: Mon, 10 Apr 2023 20:48:06 -0400 Subject: [PATCH] Added method `\TgBotLib\Bot > deleteStickerSet()` to delete a sticker set. See [deleteStickerSet](https://core.telegram.org/bots/api#deletestickerset) for more information. https://git.n64.cc/nosial/libs/tgbot/-/issues/2 --- CHANGELOG.md | 2 ++ src/TgBotLib/Bot.php | 19 +++++++++++++++++++ 2 files changed, 21 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index cc8293f..99180b2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -34,6 +34,8 @@ This update accompanies the release of the [Telegram Bot API 6.6](https://core.t See [setStickerSetThumbnail](https://core.telegram.org/bots/api#setstickersetthumbnail) for more information. * Added method `\TgBotLib\Bot > setStickerSetTitle()` to set the title of a sticker set. See [setStickerSetTitle](https://core.telegram.org/bots/api#setstickersettitle) for more information. + * Added method `\TgBotLib\Bot > deleteStickerSet()` to delete a sticker set. + See [deleteStickerSet](https://core.telegram.org/bots/api#deletestickerset) for more information. ### Changed * Removed unused `__destruct()` method from `\TgBotLib\Bot` diff --git a/src/TgBotLib/Bot.php b/src/TgBotLib/Bot.php index 53a5ae5..8b03084 100644 --- a/src/TgBotLib/Bot.php +++ b/src/TgBotLib/Bot.php @@ -2649,4 +2649,23 @@ return true; } + + /** + * Use this method to delete a sticker set that was created by the bot. Returns True on success. + * + * @param string $name Sticker set name + * @param array $options Optional parameters + * @return bool + * @throws TelegramException + * @link https://core.telegram.org/bots/api#deletestickerset + * @noinspection PhpUnused + */ + public function deleteStickerSet(string $name, array $options=[]): bool + { + $this->sendRequest('deleteStickerSet', array_merge([ + 'name' => $name + ], $options)); + + return true; + } } \ No newline at end of file