From c01b8653c5c3a03ede9a10ce0738c2d403cf3d07 Mon Sep 17 00:00:00 2001 From: netkas Date: Thu, 14 Nov 2024 00:34:11 -0500 Subject: [PATCH] Add DeleteMessages method --- src/TgBotLib/Enums/Methods.php | 3 ++ src/TgBotLib/Methods/DeleteMessages.php | 44 +++++++++++++++++++++++++ 2 files changed, 47 insertions(+) create mode 100644 src/TgBotLib/Methods/DeleteMessages.php diff --git a/src/TgBotLib/Enums/Methods.php b/src/TgBotLib/Enums/Methods.php index 24eae2d..cb696d4 100644 --- a/src/TgBotLib/Enums/Methods.php +++ b/src/TgBotLib/Enums/Methods.php @@ -22,6 +22,7 @@ use TgBotLib\Methods\DeleteChatStickerSet; use TgBotLib\Methods\DeleteForumTopic; use TgBotLib\Methods\DeleteMessage; + use TgBotLib\Methods\DeleteMessages; use TgBotLib\Methods\DeleteMyCommands; use TgBotLib\Methods\DeleteWebhook; use TgBotLib\Methods\EditChatInviteLink; @@ -202,6 +203,7 @@ case EDIT_MESSAGE_REPLY_MARKUP = 'editMessageReplyMarkup'; case STOP_POLL = 'stopPoll'; case DELETE_MESSAGE = 'deleteMessage'; + case DELETE_MESSAGES = 'deleteMessages'; /** * Executes a command on the provided bot with the given parameters. @@ -312,6 +314,7 @@ self::EDIT_MESSAGE_REPLY_MARKUP => EditMessageReplyMarkup::execute($bot, $parameters), self::STOP_POLL => StopPoll::execute($bot, $parameters), self::DELETE_MESSAGE => DeleteMessage::execute($bot, $parameters), + self::DELETE_MESSAGES => DeleteMessages::execute($bot, $parameters), }; } } diff --git a/src/TgBotLib/Methods/DeleteMessages.php b/src/TgBotLib/Methods/DeleteMessages.php new file mode 100644 index 0000000..7067b7e --- /dev/null +++ b/src/TgBotLib/Methods/DeleteMessages.php @@ -0,0 +1,44 @@ +value, $parameters)); + } + + /** + * @inheritDoc + */ + public static function getRequiredParameters(): ?array + { + return [ + 'chat_id', + 'message_ids' + ]; + } + + /** + * @inheritDoc + */ + public static function getOptionalParameters(): ?array + { + return null; + } + } \ No newline at end of file