From 7ee714b36c449493499da55eb73a823c2307f108 Mon Sep 17 00:00:00 2001 From: netkas Date: Wed, 6 Nov 2024 17:13:08 -0500 Subject: [PATCH] Add unpinAllChatMessages method --- src/TgBotLib/Enums/Methods.php | 3 ++ src/TgBotLib/Methods/UnpinAllChatMessages.php | 37 +++++++++++++++++++ 2 files changed, 40 insertions(+) create mode 100644 src/TgBotLib/Methods/UnpinAllChatMessages.php diff --git a/src/TgBotLib/Enums/Methods.php b/src/TgBotLib/Enums/Methods.php index 62ad53e..c609912 100644 --- a/src/TgBotLib/Enums/Methods.php +++ b/src/TgBotLib/Enums/Methods.php @@ -56,6 +56,7 @@ use TgBotLib\Methods\SetWebhook; use TgBotLib\Methods\UnbanChatMember; use TgBotLib\Methods\UnbanChatSenderChat; + use TgBotLib\Methods\UnpinAllChatMessages; use TgBotLib\Methods\UnpinChatMessage; enum Methods : string @@ -112,6 +113,7 @@ case SET_CHAT_DESCRIPTION = 'setChatDescription'; case PIN_CHAT_MESSAGE = 'pinChatMessage'; case UNPIN_CHAT_MESSAGE = 'unpinChatMessage'; + case UNPIN_ALL_CHAT_MESSAGES = 'unpinAllChatMessages'; /** * Executes a command on the provided bot with the given parameters. @@ -177,6 +179,7 @@ self::SET_CHAT_DESCRIPTION => SetChatDescription::execute($bot, $parameters), self::PIN_CHAT_MESSAGE => PinChatMessage::execute($bot, $parameters), self::UNPIN_CHAT_MESSAGE => UnpinChatMessage::execute($bot, $parameters), + self::UNPIN_ALL_CHAT_MESSAGES => UnpinAllChatMessages::execute($bot, $parameters), }; } } diff --git a/src/TgBotLib/Methods/UnpinAllChatMessages.php b/src/TgBotLib/Methods/UnpinAllChatMessages.php new file mode 100644 index 0000000..77db539 --- /dev/null +++ b/src/TgBotLib/Methods/UnpinAllChatMessages.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