From db3500d46e11f1fd68b78e50477dfdaa3e544eb2 Mon Sep 17 00:00:00 2001 From: netkas Date: Wed, 6 Nov 2024 00:20:22 -0500 Subject: [PATCH] Add unban chat sender functionality --- src/TgBotLib/Enums/Methods.php | 3 ++ src/TgBotLib/Methods/UnbanChatSenderChat.php | 38 ++++++++++++++++++++ 2 files changed, 41 insertions(+) create mode 100644 src/TgBotLib/Methods/UnbanChatSenderChat.php diff --git a/src/TgBotLib/Enums/Methods.php b/src/TgBotLib/Enums/Methods.php index 471dfac..4f2d4c6 100644 --- a/src/TgBotLib/Enums/Methods.php +++ b/src/TgBotLib/Enums/Methods.php @@ -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) }; } } diff --git a/src/TgBotLib/Methods/UnbanChatSenderChat.php b/src/TgBotLib/Methods/UnbanChatSenderChat.php new file mode 100644 index 0000000..fe501f0 --- /dev/null +++ b/src/TgBotLib/Methods/UnbanChatSenderChat.php @@ -0,0 +1,38 @@ +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; + } + } \ No newline at end of file