From 4893a23bfa30f5480c8a5e467e3f802fa47ea67b Mon Sep 17 00:00:00 2001 From: netkas Date: Wed, 6 Nov 2024 17:24:15 -0500 Subject: [PATCH] Add GetChatMember method functionality --- src/TgBotLib/Enums/Methods.php | 3 ++ src/TgBotLib/Methods/GetChatMember.php | 39 ++++++++++++++++++++++++++ 2 files changed, 42 insertions(+) create mode 100644 src/TgBotLib/Methods/GetChatMember.php diff --git a/src/TgBotLib/Enums/Methods.php b/src/TgBotLib/Enums/Methods.php index c256d68..e828d08 100644 --- a/src/TgBotLib/Enums/Methods.php +++ b/src/TgBotLib/Enums/Methods.php @@ -23,6 +23,7 @@ use TgBotLib\Methods\ForwardMessages; use TgBotLib\Methods\GetChat; use TgBotLib\Methods\GetChatAdministrators; + use TgBotLib\Methods\GetChatMember; use TgBotLib\Methods\GetChatMemberCount; use TgBotLib\Methods\GetFile; use TgBotLib\Methods\GetMe; @@ -122,6 +123,7 @@ case GET_CHAT = 'getChat'; case GET_CHAT_ADMINISTRATORS = 'getChatAdministrators'; case GET_CHAT_MEMBER_COUNT = 'getChatMemberCount'; + case GET_CHAT_MEMBER = 'getChatMember'; /** * Executes a command on the provided bot with the given parameters. @@ -192,6 +194,7 @@ self::GET_CHAT => GetChat::execute($bot, $parameters), self::GET_CHAT_ADMINISTRATORS => GetChatAdministrators::execute($bot, $parameters), self::GET_CHAT_MEMBER_COUNT => GetChatMemberCount::execute($bot, $parameters), + self::GET_CHAT_MEMBER => GetChatMember::execute($bot, $parameters), }; } } diff --git a/src/TgBotLib/Methods/GetChatMember.php b/src/TgBotLib/Methods/GetChatMember.php new file mode 100644 index 0000000..31ce608 --- /dev/null +++ b/src/TgBotLib/Methods/GetChatMember.php @@ -0,0 +1,39 @@ +value, $parameters))); + } + + /** + * @inheritDoc + */ + public static function getRequiredParameters(): ?array + { + return [ + 'chat_id', + 'user_id' + ]; + } + + /** + * @inheritDoc + */ + public static function getOptionalParameters(): ?array + { + return null; + } + } \ No newline at end of file