Add DeleteStickerFromSet method

This commit is contained in:
netkas 2024-11-15 00:34:19 -05:00
parent 9a7fb4194f
commit cd03e91807
2 changed files with 40 additions and 0 deletions

View file

@ -26,6 +26,7 @@
use TgBotLib\Methods\DeleteMessage; use TgBotLib\Methods\DeleteMessage;
use TgBotLib\Methods\DeleteMessages; use TgBotLib\Methods\DeleteMessages;
use TgBotLib\Methods\DeleteMyCommands; use TgBotLib\Methods\DeleteMyCommands;
use TgBotLib\Methods\DeleteStickerFromSet;
use TgBotLib\Methods\DeleteWebhook; use TgBotLib\Methods\DeleteWebhook;
use TgBotLib\Methods\EditChatInviteLink; use TgBotLib\Methods\EditChatInviteLink;
use TgBotLib\Methods\EditChatSubscriptionInviteLink; use TgBotLib\Methods\EditChatSubscriptionInviteLink;
@ -218,6 +219,7 @@
case CREATE_NEW_STICKER_SET = 'createNewStickerSet'; case CREATE_NEW_STICKER_SET = 'createNewStickerSet';
case ADD_STICKER_TO_SET = 'addStickerToSet'; case ADD_STICKER_TO_SET = 'addStickerToSet';
case SET_STICKER_POSITION_IN_SET = 'setStickerPositionInSet'; case SET_STICKER_POSITION_IN_SET = 'setStickerPositionInSet';
case DELETE_STICKER_FROM_SET = 'deleteStickerFromSet';
/** /**
* Executes a command on the provided bot with the given parameters. * Executes a command on the provided bot with the given parameters.
@ -336,6 +338,7 @@
self::CREATE_NEW_STICKER_SET => CreateNewStickerSet::execute($bot, $parameters), self::CREATE_NEW_STICKER_SET => CreateNewStickerSet::execute($bot, $parameters),
self::ADD_STICKER_TO_SET => AddStickerToSet::execute($bot, $parameters), self::ADD_STICKER_TO_SET => AddStickerToSet::execute($bot, $parameters),
self::SET_STICKER_POSITION_IN_SET => SetStickerPositionInSet::execute($bot, $parameters), self::SET_STICKER_POSITION_IN_SET => SetStickerPositionInSet::execute($bot, $parameters),
self::DELETE_STICKER_FROM_SET => DeleteStickerFromSet::execute($bot, $parameters),
}; };
} }
} }

View file

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