Rename files and update namespaces to reflect methods

This commit is contained in:
netkas 2024-11-14 22:40:27 -05:00
parent 36e2305ce7
commit 58a04ba94c
3 changed files with 4 additions and 4 deletions

View file

@ -1,45 +0,0 @@
<?php
namespace TgBotLib\Objects;
use TgBotLib\Abstracts\Method;
use TgBotLib\Bot;
use TgBotLib\Enums\Methods;
use TgBotLib\Objects\Stickers\Sticker;
class GetCustomEmojiStickers extends Method
{
/**
* @inheritDoc
*/
public static function execute(Bot $bot, array $parameters = []): array
{
if(isset($parameters['custom_emoji_ids']) && is_array($parameters['custom_emoji_ids']))
{
$parameters['custom_emoji_ids'] = json_encode($parameters['custom_emoji_ids']);
}
return array_map(function($emoji) {
return Sticker::fromArray($emoji);
}, self::executeCurl(self::buildPost($bot, Methods::GET_CUSTOM_EMOJI_STICKERS->value, $parameters)));
}
/**
* @inheritDoc
*/
public static function getRequiredParameters(): ?array
{
return [
'custom_emoji_ids'
];
}
/**
* @inheritDoc
*/
public static function getOptionalParameters(): ?array
{
return null;
}
}

View file

@ -1,38 +0,0 @@
<?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;
}
}