Add BanChatMember method to TgBotLib
This commit is contained in:
parent
d9dd03f601
commit
9e2e19d593
2 changed files with 44 additions and 0 deletions
41
src/TgBotLib/Methods/BanChatMember.php
Normal file
41
src/TgBotLib/Methods/BanChatMember.php
Normal 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'
|
||||
];
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue