From 2f2fefbe9dcdeb02d79ffaab4975b5744f9836f0 Mon Sep 17 00:00:00 2001 From: netkas Date: Wed, 6 Nov 2024 00:24:46 -0500 Subject: [PATCH] Add ExportChatInviteLink method to TgBotLib --- src/TgBotLib/Enums/Methods.php | 3 ++ src/TgBotLib/Methods/ExportChatInviteLink.php | 37 +++++++++++++++++++ 2 files changed, 40 insertions(+) create mode 100644 src/TgBotLib/Methods/ExportChatInviteLink.php diff --git a/src/TgBotLib/Enums/Methods.php b/src/TgBotLib/Enums/Methods.php index 9657d4f..3638052 100644 --- a/src/TgBotLib/Enums/Methods.php +++ b/src/TgBotLib/Enums/Methods.php @@ -11,6 +11,7 @@ use TgBotLib\Methods\CopyMessage; use TgBotLib\Methods\CopyMessages; use TgBotLib\Methods\DeleteWebhook; + use TgBotLib\Methods\ExportChatInviteLink; use TgBotLib\Methods\ForwardMessage; use TgBotLib\Methods\ForwardMessages; use TgBotLib\Methods\GetFile; @@ -84,6 +85,7 @@ case BAN_CHAT_SENDER_CHAT = 'banChatSenderChat'; case UNBAN_CHAT_SENDER_CHAT = 'unbanChatSenderChat'; case SET_CHAT_PERMISSIONS = 'setChatPermissions'; + case EXPORT_CHAT_INVITE_LINK = 'exportChatInviteLink'; /** * Executes a command on the provided bot with the given parameters. @@ -135,6 +137,7 @@ self::BAN_CHAT_SENDER_CHAT => BanChatSenderChat::execute($bot, $parameters), self::UNBAN_CHAT_SENDER_CHAT => UnbanChatSenderChat::execute($bot, $parameters), self::SET_CHAT_PERMISSIONS => SetChatPermissions::execute($bot, $parameters), + self::EXPORT_CHAT_INVITE_LINK => ExportChatInviteLink::execute($bot, $parameters), }; } } diff --git a/src/TgBotLib/Methods/ExportChatInviteLink.php b/src/TgBotLib/Methods/ExportChatInviteLink.php new file mode 100644 index 0000000..efe6eb4 --- /dev/null +++ b/src/TgBotLib/Methods/ExportChatInviteLink.php @@ -0,0 +1,37 @@ +sendRequest(Methods::EXPORT_CHAT_INVITE_LINK->value, $parameters); + } + + /** + * @inheritDoc + */ + public static function getRequiredParameters(): ?array + { + return [ + 'chat_id' + ]; + } + + /** + * @inheritDoc + */ + public static function getOptionalParameters(): ?array + { + return null; + } + } \ No newline at end of file