diff --git a/src/TgBotLib/Enums/Methods.php b/src/TgBotLib/Enums/Methods.php index a7596be..f9b6698 100644 --- a/src/TgBotLib/Enums/Methods.php +++ b/src/TgBotLib/Enums/Methods.php @@ -103,6 +103,7 @@ use TgBotLib\Methods\SetStickerEmojiList; use TgBotLib\Methods\SetStickerMaskPosition; use TgBotLib\Methods\SetStickerPositionInSet; + use TgBotLib\Methods\SetStickerSetThumbnail; use TgBotLib\Methods\SetStickerSetTitle; use TgBotLib\Methods\SetWebhook; use TgBotLib\Methods\StopMessageLiveLocation; @@ -228,6 +229,7 @@ case SET_STICKER_EMOJI_LIST = 'setStickerEmojiList'; case SET_STICKER_MASK_POSITION = 'setStickerMaskPosition'; case SET_STICKER_SET_TITLE = 'setStickerSetTitle'; + case SET_STICKER_SET_THUMBNAIL = 'setStickerSetThumbnail'; /** * Executes a command on the provided bot with the given parameters. @@ -351,6 +353,7 @@ self::SET_STICKER_EMOJI_LIST => SetStickerEmojiList::execute($bot, $parameters), self::SET_STICKER_MASK_POSITION => SetStickerMaskPosition::execute($bot, $parameters), self::SET_STICKER_SET_TITLE => SetStickerSetTitle::execute($bot, $parameters), + self::SET_STICKER_SET_THUMBNAIL => SetStickerSetThumbnail::execute($bot, $parameters), }; } } diff --git a/src/TgBotLib/Methods/SetStickerSetThumbnail.php b/src/TgBotLib/Methods/SetStickerSetThumbnail.php new file mode 100644 index 0000000..905bd16 --- /dev/null +++ b/src/TgBotLib/Methods/SetStickerSetThumbnail.php @@ -0,0 +1,54 @@ +value, 'thumbnail', $thumbnail, array_diff_key($parameters, ['thumbnail' => null]))); + } + } + + return (bool)self::executeCurl(self::buildPost($bot, Methods::SET_STICKER_SET_THUMBNAIL->value, $parameters)); + } + + /** + * @inheritDoc + */ + public static function getRequiredParameters(): ?array + { + return [ + 'name', + 'user_id', + 'format' + ]; + } + + /** + * @inheritDoc + */ + public static function getOptionalParameters(): ?array + { + return [ + 'thumbnail' + ]; + } + } \ No newline at end of file