Add GetStickerSet method
This commit is contained in:
parent
ea6fe91d9d
commit
a5b472794d
2 changed files with 41 additions and 0 deletions
|
@ -104,6 +104,7 @@
|
|||
use TgBotLib\Methods\UnpinAllForumTopicMessages;
|
||||
use TgBotLib\Methods\UnpinAllGeneralForumTopicMessages;
|
||||
use TgBotLib\Methods\UnpinChatMessage;
|
||||
use TgBotLib\Objects\GetStickerSet;
|
||||
|
||||
enum Methods : string
|
||||
{
|
||||
|
@ -206,6 +207,7 @@
|
|||
case DELETE_MESSAGE = 'deleteMessage';
|
||||
case DELETE_MESSAGES = 'deleteMessages';
|
||||
case SEND_STICKER = 'sendSticker';
|
||||
case GET_STICKER_SET = 'getStickerSet';
|
||||
|
||||
/**
|
||||
* Executes a command on the provided bot with the given parameters.
|
||||
|
@ -318,6 +320,7 @@
|
|||
self::DELETE_MESSAGE => DeleteMessage::execute($bot, $parameters),
|
||||
self::DELETE_MESSAGES => DeleteMessages::execute($bot, $parameters),
|
||||
self::SEND_STICKER => SendSticker::execute($bot, $parameters),
|
||||
self::GET_STICKER_SET => GetStickerSet::execute($bot, $parameters),
|
||||
};
|
||||
}
|
||||
}
|
||||
|
|
38
src/TgBotLib/Objects/GetStickerSet.php
Normal file
38
src/TgBotLib/Objects/GetStickerSet.php
Normal file
|
@ -0,0 +1,38 @@
|
|||
<?php
|
||||
|
||||
namespace TgBotLib\Objects;
|
||||
|
||||
use TgBotLib\Abstracts\Method;
|
||||
use TgBotLib\Bot;
|
||||
use TgBotLib\Enums\Methods;
|
||||
use TgBotLib\Objects\Stickers\StickerSet;
|
||||
|
||||
class GetStickerSet extends Method
|
||||
{
|
||||
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
public static function execute(Bot $bot, array $parameters = []): StickerSet
|
||||
{
|
||||
return StickerSet::fromArray(self::executeCurl(self::buildPost($bot, Methods::GET_STICKER_SET->value, $parameters)));
|
||||
}
|
||||
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
public static function getRequiredParameters(): ?array
|
||||
{
|
||||
return [
|
||||
'name'
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
public static function getOptionalParameters(): ?array
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
Loading…
Add table
Reference in a new issue