diff --git a/src/TgBotLib/Enums/Methods.php b/src/TgBotLib/Enums/Methods.php index 336969f..ea00f9e 100644 --- a/src/TgBotLib/Enums/Methods.php +++ b/src/TgBotLib/Enums/Methods.php @@ -12,6 +12,7 @@ use TgBotLib\Methods\CopyMessages; use TgBotLib\Methods\CreateChatInviteLink; use TgBotLib\Methods\DeleteWebhook; + use TgBotLib\Methods\EditChatInviteLink; use TgBotLib\Methods\ExportChatInviteLink; use TgBotLib\Methods\ForwardMessage; use TgBotLib\Methods\ForwardMessages; @@ -88,6 +89,7 @@ case SET_CHAT_PERMISSIONS = 'setChatPermissions'; case EXPORT_CHAT_INVITE_LINK = 'exportChatInviteLink'; case CREATE_CHAT_INVITE_LINK = 'createChatInviteLink'; + case EDIT_CHAT_INVITE_LINK = 'editChatInviteLink'; /** * Executes a command on the provided bot with the given parameters. @@ -141,6 +143,7 @@ self::SET_CHAT_PERMISSIONS => SetChatPermissions::execute($bot, $parameters), self::EXPORT_CHAT_INVITE_LINK => ExportChatInviteLink::execute($bot, $parameters), self::CREATE_CHAT_INVITE_LINK => CreateChatInviteLink::execute($bot, $parameters), + self::EDIT_CHAT_INVITE_LINK => EditChatInviteLink::execute($bot, $parameters), }; } } diff --git a/src/TgBotLib/Methods/EditChatInviteLink.php b/src/TgBotLib/Methods/EditChatInviteLink.php new file mode 100644 index 0000000..85403da --- /dev/null +++ b/src/TgBotLib/Methods/EditChatInviteLink.php @@ -0,0 +1,43 @@ +sendRequest(Methods::EDIT_CHAT_INVITE_LINK->value, $parameters)); + } + + /** + * @inheritDoc + */ + public static function getRequiredParameters(): ?array + { + return [ + 'chat_id', + 'invite_link' + ]; + } + + /** + * @inheritDoc + */ + public static function getOptionalParameters(): ?array + { + return [ + 'name', + 'expire_date', + 'member_limit', + 'creates_join_request' + ]; + } + } \ No newline at end of file