Add SetCustomEmojiStickerSetThumbnail method

This commit is contained in:
netkas 2024-11-15 15:14:10 -05:00
parent c5e0e1992a
commit 9468bdda90
2 changed files with 42 additions and 0 deletions

View file

@ -94,6 +94,7 @@
use TgBotLib\Methods\SetChatPhoto;
use TgBotLib\Methods\SetChatStickerSet;
use TgBotLib\Methods\SetChatTitle;
use TgBotLib\Methods\SetCustomEmojiStickerSetThumbnail;
use TgBotLib\Methods\SetMessageReaction;
use TgBotLib\Methods\SetMyCommands;
use TgBotLib\Methods\SetMyDefaultAdministratorRights;
@ -230,6 +231,7 @@
case SET_STICKER_MASK_POSITION = 'setStickerMaskPosition';
case SET_STICKER_SET_TITLE = 'setStickerSetTitle';
case SET_STICKER_SET_THUMBNAIL = 'setStickerSetThumbnail';
case SET_CUSTOM_EMOJI_STICKER_SET_THUMBNAIL = 'setCustomEmojiStickerSetThumbnail';
/**
* Executes a command on the provided bot with the given parameters.
@ -354,6 +356,7 @@
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),
self::SET_CUSTOM_EMOJI_STICKER_SET_THUMBNAIL => SetCustomEmojiStickerSetThumbnail::execute($bot, $parameters),
};
}
}

View file

@ -0,0 +1,39 @@
<?php
namespace TgBotLib\Methods;
use TgBotLib\Abstracts\Method;
use TgBotLib\Bot;
use TgBotLib\Enums\Methods;
class SetCustomEmojiStickerSetThumbnail extends Method
{
/**
* @inheritDoc
*/
public static function execute(Bot $bot, array $parameters = []): true
{
return (bool)self::executeCurl(self::buildPost($bot, Methods::SET_CUSTOM_EMOJI_STICKER_SET_THUMBNAIL->value, $parameters));
}
/**
* @inheritDoc
*/
public static function getRequiredParameters(): ?array
{
return [
'name'
];
}
/**
* @inheritDoc
*/
public static function getOptionalParameters(): ?array
{
return [
'custom_emoji_id'
];
}
}