From 4886173e89336d9ae09e067f6f81d60691fe52b6 Mon Sep 17 00:00:00 2001 From: netkas Date: Thu, 28 Nov 2024 00:30:41 -0500 Subject: [PATCH] Implement UnbanChatMember method in TgBotLib. --- src/TgBotLib/Methods/UnbanChatMember.php | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/src/TgBotLib/Methods/UnbanChatMember.php b/src/TgBotLib/Methods/UnbanChatMember.php index de22330..9fabbb8 100644 --- a/src/TgBotLib/Methods/UnbanChatMember.php +++ b/src/TgBotLib/Methods/UnbanChatMember.php @@ -4,6 +4,7 @@ use TgBotLib\Abstracts\Method; use TgBotLib\Bot; + use TgBotLib\Enums\Methods; class UnbanChatMember extends Method { @@ -11,9 +12,9 @@ /** * @inheritDoc */ - public static function execute(Bot $bot, array $parameters = []): mixed + public static function execute(Bot $bot, array $parameters = []): true { - // TODO: Implement execute() method. + return (bool)self::executeCurl(self::buildPost($bot, Methods::UNBAN_CHAT_MEMBER->value, $parameters)); } /** @@ -21,7 +22,10 @@ */ public static function getRequiredParameters(): ?array { - // TODO: Implement getRequiredParameters() method. + return [ + 'chat_id', + 'user_id', + ]; } /** @@ -29,6 +33,8 @@ */ public static function getOptionalParameters(): ?array { - // TODO: Implement getOptionalParameters() method. + return [ + 'only_if_banned' + ]; } } \ No newline at end of file