From cad5face2ddc67879bcad562de7792611ef7c02a Mon Sep 17 00:00:00 2001 From: netkas Date: Thu, 7 Nov 2024 00:44:43 -0500 Subject: [PATCH] Add ReopenForumTopic method --- src/TgBotLib/Enums/Methods.php | 3 ++ src/TgBotLib/Methods/ReopenForumTopic.php | 38 +++++++++++++++++++++++ 2 files changed, 41 insertions(+) create mode 100644 src/TgBotLib/Methods/ReopenForumTopic.php diff --git a/src/TgBotLib/Enums/Methods.php b/src/TgBotLib/Enums/Methods.php index 1e6c4db..66ab886 100644 --- a/src/TgBotLib/Enums/Methods.php +++ b/src/TgBotLib/Enums/Methods.php @@ -39,6 +39,7 @@ use TgBotLib\Methods\Logout; use TgBotLib\Methods\PinChatMessage; use TgBotLib\Methods\PromoteChatMember; + use TgBotLib\Methods\ReopenForumTopic; use TgBotLib\Methods\RestrictChatMember; use TgBotLib\Methods\RevokeChatInviteLink; use TgBotLib\Methods\SendAnimation; @@ -136,6 +137,7 @@ case CREATE_FORUM_TOPIC = 'createForumTopic'; case EDIT_FORUM_TOPIC = 'editForumTopic'; case CLOSE_FORUM_TOPIC = 'closeForumTopic'; + case REOPEN_FORUM_TOPIC = 'reopenForumTopic'; /** * Executes a command on the provided bot with the given parameters. @@ -213,6 +215,7 @@ self::CREATE_FORUM_TOPIC => CreateForumTopic::execute($bot, $parameters), self::EDIT_FORUM_TOPIC => EditForumTopic::execute($bot, $parameters), self::CLOSE_FORUM_TOPIC => CloseForumTopic::execute($bot, $parameters), + self::REOPEN_FORUM_TOPIC => ReopenForumTopic::execute($bot, $parameters), }; } } diff --git a/src/TgBotLib/Methods/ReopenForumTopic.php b/src/TgBotLib/Methods/ReopenForumTopic.php new file mode 100644 index 0000000..29498cd --- /dev/null +++ b/src/TgBotLib/Methods/ReopenForumTopic.php @@ -0,0 +1,38 @@ +value, $parameters))); + } + + /** + * @inheritDoc + */ + public static function getRequiredParameters(): ?array + { + return [ + 'chat_id', + 'message_thread_id' + ]; + } + + /** + * @inheritDoc + */ + public static function getOptionalParameters(): ?array + { + return null; + } + } \ No newline at end of file