From 78b4f8c24dadb87db0e151f12587075c15257d56 Mon Sep 17 00:00:00 2001 From: netkas Date: Wed, 6 Nov 2024 15:20:41 -0500 Subject: [PATCH] Add ApproveChatJoinRequest method --- src/TgBotLib/Enums/Methods.php | 3 ++ .../Methods/ApproveChatJoinRequest.php | 39 +++++++++++++++++++ 2 files changed, 42 insertions(+) create mode 100644 src/TgBotLib/Methods/ApproveChatJoinRequest.php diff --git a/src/TgBotLib/Enums/Methods.php b/src/TgBotLib/Enums/Methods.php index 3124e9d..233e13b 100644 --- a/src/TgBotLib/Enums/Methods.php +++ b/src/TgBotLib/Enums/Methods.php @@ -5,6 +5,7 @@ use TgBotLib\Bot; use TgBotLib\Exceptions\TelegramException; use TgBotLib\Interfaces\ObjectTypeInterface; + use TgBotLib\Methods\ApproveChatJoinRequest; use TgBotLib\Methods\BanChatMember; use TgBotLib\Methods\BanChatSenderChat; use TgBotLib\Methods\Close; @@ -96,6 +97,7 @@ case CREATE_CHAT_SUBSCRIPTION_INVITE_LINK = 'createChatSubscriptionInviteLink'; case EDIT_CHAT_SUBSCRIPTION_INVITE_LINK = 'editChatSubscriptionInviteLink'; case REVOKE_CHAT_INVITE_LINK = 'revokeChatInviteLink'; + case APPROVE_CHAT_JOIN_REQUEST = 'approveChatJoinRequest'; /** * Executes a command on the provided bot with the given parameters. @@ -153,6 +155,7 @@ self::CREATE_CHAT_SUBSCRIPTION_INVITE_LINK => CreateChatSubscriptionInviteLink::execute($bot, $parameters), self::EDIT_CHAT_SUBSCRIPTION_INVITE_LINK => EditChatSubscriptionInviteLink::execute($bot, $parameters), self::REVOKE_CHAT_INVITE_LINK => RevokeChatInviteLink::execute($bot, $parameters), + self::APPROVE_CHAT_JOIN_REQUEST => ApproveChatJoinRequest::execute($bot, $parameters), }; } } diff --git a/src/TgBotLib/Methods/ApproveChatJoinRequest.php b/src/TgBotLib/Methods/ApproveChatJoinRequest.php new file mode 100644 index 0000000..36c57fb --- /dev/null +++ b/src/TgBotLib/Methods/ApproveChatJoinRequest.php @@ -0,0 +1,39 @@ +value, $parameters)); + } + + /** + * @inheritDoc + */ + public static function getRequiredParameters(): ?array + { + return [ + 'chat_id', + 'invite_link' + ]; + } + + /** + * @inheritDoc + */ + public static function getOptionalParameters(): ?array + { + return null; + } + } \ No newline at end of file