From 17369210d5d0fc63335b1b8373a9f8d6df241254 Mon Sep 17 00:00:00 2001 From: netkas Date: Thu, 7 Nov 2024 00:57:23 -0500 Subject: [PATCH] Add unpinAllGeneralForumTopicMessages method --- src/TgBotLib/Enums/Methods.php | 3 ++ .../UnpinAllGeneralForumTopicMessages.php | 37 +++++++++++++++++++ 2 files changed, 40 insertions(+) create mode 100644 src/TgBotLib/Methods/UnpinAllGeneralForumTopicMessages.php diff --git a/src/TgBotLib/Enums/Methods.php b/src/TgBotLib/Enums/Methods.php index e3ce7d6..8aa6d7f 100644 --- a/src/TgBotLib/Enums/Methods.php +++ b/src/TgBotLib/Enums/Methods.php @@ -76,6 +76,7 @@ use TgBotLib\Methods\UnhideGeneralForumTopic; use TgBotLib\Methods\UnpinAllChatMessages; use TgBotLib\Methods\UnpinAllForumTopicMessages; + use TgBotLib\Methods\UnpinAllGeneralForumTopicMessages; use TgBotLib\Methods\UnpinChatMessage; enum Methods : string @@ -152,6 +153,7 @@ case REOPEN_GENERAL_FORUM_TOPIC = 'reopenGeneralForumTopic'; case HIDE_GENERAL_FORUM_TOPIC = 'hideGeneralForumTopic'; case UNHIDE_GENERAL_FORUM_TOPIC = 'unhideGeneralForumTopic'; + case UNPIN_ALL_GENERAL_FORUM_TOPIC_MESSAGES = 'unpinAllGeneralForumTopicMessages'; /** * Executes a command on the provided bot with the given parameters. @@ -237,6 +239,7 @@ self::REOPEN_GENERAL_FORUM_TOPIC => ReopenGeneralForumTopic::execute($bot, $parameters), self::HIDE_GENERAL_FORUM_TOPIC => HideGeneralForumTopic::execute($bot, $parameters), self::UNHIDE_GENERAL_FORUM_TOPIC => UnhideGeneralForumTopic::execute($bot, $parameters), + self::UNPIN_ALL_GENERAL_FORUM_TOPIC_MESSAGES => UnpinAllGeneralForumTopicMessages::execute($bot, $parameters), }; } } diff --git a/src/TgBotLib/Methods/UnpinAllGeneralForumTopicMessages.php b/src/TgBotLib/Methods/UnpinAllGeneralForumTopicMessages.php new file mode 100644 index 0000000..7958cbf --- /dev/null +++ b/src/TgBotLib/Methods/UnpinAllGeneralForumTopicMessages.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