Add BanChatMember method to TgBotLib

This commit is contained in:
netkas 2024-11-05 19:24:25 -05:00
parent d9dd03f601
commit 9e2e19d593
2 changed files with 44 additions and 0 deletions

View file

@ -0,0 +1,41 @@
<?php
namespace TgBotLib\Methods;
use TgBotLib\Abstracts\Method;
use TgBotLib\Bot;
use TgBotLib\Enums\Methods;
class BanChatMember extends Method
{
/**
* @inheritDoc
*/
public static function execute(Bot $bot, array $parameters = []): true
{
return (bool)$bot->sendRequest(Methods::BAN_CHAT_MEMBER->value, $parameters);
}
/**
* @inheritDoc
*/
public static function getRequiredParameters(): ?array
{
return [
'chat_id',
'user_id'
];
}
/**
* @inheritDoc
*/
public static function getOptionalParameters(): ?array
{
return [
'until_date',
'revoke_messages'
];
}
}