Add unban chat sender functionality
This commit is contained in:
parent
3757b9106a
commit
db3500d46e
2 changed files with 41 additions and 0 deletions
|
@ -41,6 +41,7 @@
|
|||
use TgBotLib\Methods\SetMessageReaction;
|
||||
use TgBotLib\Methods\SetWebhook;
|
||||
use TgBotLib\Methods\UnbanChatMember;
|
||||
use TgBotLib\Methods\UnbanChatSenderChat;
|
||||
|
||||
enum Methods : string
|
||||
{
|
||||
|
@ -80,6 +81,7 @@
|
|||
case PROMOTE_CHAT_MEMBER = 'promoteChatMember';
|
||||
case SET_CHAT_ADMINISTRATOR_CUSTOM_TITLE = 'setChatAdministratorCustomTitle';
|
||||
case BAN_CHAT_SENDER_CHAT = 'banChatSenderChat';
|
||||
case UNBAN_CHAT_SENDER_CHAT = 'unbanChatSenderChat';
|
||||
|
||||
/**
|
||||
* Executes a command on the provided bot with the given parameters.
|
||||
|
@ -129,6 +131,7 @@
|
|||
self::PROMOTE_CHAT_MEMBER => PromoteChatMember::execute($bot, $parameters),
|
||||
self::SET_CHAT_ADMINISTRATOR_CUSTOM_TITLE => SetChatAdministratorCustomTitle::execute($bot, $parameters),
|
||||
self::BAN_CHAT_SENDER_CHAT => BanChatSenderChat::execute($bot, $parameters),
|
||||
self::UNBAN_CHAT_SENDER_CHAT => UnbanChatSenderChat::execute($bot, $parameters)
|
||||
};
|
||||
}
|
||||
}
|
||||
|
|
38
src/TgBotLib/Methods/UnbanChatSenderChat.php
Normal file
38
src/TgBotLib/Methods/UnbanChatSenderChat.php
Normal file
|
@ -0,0 +1,38 @@
|
|||
<?php
|
||||
|
||||
namespace TgBotLib\Methods;
|
||||
|
||||
use TgBotLib\Abstracts\Method;
|
||||
use TgBotLib\Bot;
|
||||
use TgBotLib\Enums\Methods;
|
||||
|
||||
class UnbanChatSenderChat extends Method
|
||||
{
|
||||
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
public static function execute(Bot $bot, array $parameters = []): true
|
||||
{
|
||||
return (bool)$bot->sendRequest(Methods::UNBAN_CHAT_SENDER_CHAT->value, $parameters);
|
||||
}
|
||||
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
public static function getRequiredParameters(): ?array
|
||||
{
|
||||
return [
|
||||
'chat_id',
|
||||
'sender_chat_id'
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
public static function getOptionalParameters(): ?array
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
Loading…
Add table
Reference in a new issue