From 528341629266ea1fd3c3baf29b5357d3602b6395 Mon Sep 17 00:00:00 2001 From: Netkas Date: Mon, 10 Apr 2023 20:34:14 -0400 Subject: [PATCH] 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. https://git.n64.cc/nosial/libs/tgbot/-/issues/2 --- CHANGELOG.md | 2 ++ src/TgBotLib/Bot.php | 23 +++++++++++++++++++++++ 2 files changed, 25 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index ddf205f..cc8293f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -32,6 +32,8 @@ This update accompanies the release of the [Telegram Bot API 6.6](https://core.t * Added object `\TgBotLib\Objects\Telegram > StickerSet` to represent a sticker set. * Added method `\TgBotLib\Bot > setStickerSetThumbnail()` to set the thumbnail of a sticker set. 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. ### Changed * Removed unused `__destruct()` method from `\TgBotLib\Bot` diff --git a/src/TgBotLib/Bot.php b/src/TgBotLib/Bot.php index 6deb060..53a5ae5 100644 --- a/src/TgBotLib/Bot.php +++ b/src/TgBotLib/Bot.php @@ -2604,6 +2604,8 @@ * @param array $options Optional parameters * @return bool * @throws TelegramException + * @link https://core.telegram.org/bots/api#setstickersetthumbnail + * @noinspection PhpUnused */ public function setStickerSetThumbnail(string $name, int $user_id, string $thumb, array $options=[]): bool { @@ -2626,4 +2628,25 @@ return true; } + + /** + * Use this method to set the title of a created sticker set. Returns True on success. + * + * @param string $name Sticker set name + * @param string $title Sticker set title, 1-64 characters + * @param array $options Optional parameters + * @return bool + * @throws TelegramException + * @link https://core.telegram.org/bots/api#setstickersettitle + * @noinspection PhpUnused + */ + public function setStickerSetTitle(string $name, string $title, array $options=[]): bool + { + $this->sendRequest('setStickerSetTitle', array_merge([ + 'name' => $name, + 'title' => $title + ], $options)); + + return true; + } } \ No newline at end of file