From 89af7589cb0125a4d74ed7f3ad30e495711bf879 Mon Sep 17 00:00:00 2001 From: netkas Date: Thu, 7 Nov 2024 00:52:20 -0500 Subject: [PATCH] Add ReopenGeneralForumTopic method --- src/TgBotLib/Enums/Methods.php | 3 ++ .../Methods/ReopenGeneralForumTopic.php | 37 +++++++++++++++++++ 2 files changed, 40 insertions(+) create mode 100644 src/TgBotLib/Methods/ReopenGeneralForumTopic.php diff --git a/src/TgBotLib/Enums/Methods.php b/src/TgBotLib/Enums/Methods.php index efa7490..a3ee530 100644 --- a/src/TgBotLib/Enums/Methods.php +++ b/src/TgBotLib/Enums/Methods.php @@ -43,6 +43,7 @@ use TgBotLib\Methods\PinChatMessage; use TgBotLib\Methods\PromoteChatMember; use TgBotLib\Methods\ReopenForumTopic; + use TgBotLib\Methods\ReopenGeneralForumTopic; use TgBotLib\Methods\RestrictChatMember; use TgBotLib\Methods\RevokeChatInviteLink; use TgBotLib\Methods\SendAnimation; @@ -146,6 +147,7 @@ case UNPIN_ALLL_FORUM_TOPIC_MESSAGES = 'UnpinAllForumTopicMessages'; case EDIT_GENERAL_FORUM_TOPIC = 'editGeneralForumTopic'; case CLOSE_GENERAL_FORUM_TOPIC = 'closeGeneralForumTopic'; + case REOPEN_GENERAL_FORUM_TOPIC = 'reopenGeneralForumTopic'; /** * Executes a command on the provided bot with the given parameters. @@ -228,6 +230,7 @@ self::UNPIN_ALLL_FORUM_TOPIC_MESSAGES => UnpinAllForumTopicMessages::execute($bot, $parameters), self::EDIT_GENERAL_FORUM_TOPIC => EditGeneralForumTopic::execute($bot, $parameters), self::CLOSE_GENERAL_FORUM_TOPIC => CloseGeneralForumTopic::execute($bot, $parameters), + self::REOPEN_GENERAL_FORUM_TOPIC => ReopenGeneralForumTopic::execute($bot, $parameters), }; } } diff --git a/src/TgBotLib/Methods/ReopenGeneralForumTopic.php b/src/TgBotLib/Methods/ReopenGeneralForumTopic.php new file mode 100644 index 0000000..e98bfbb --- /dev/null +++ b/src/TgBotLib/Methods/ReopenGeneralForumTopic.php @@ -0,0 +1,37 @@ +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