From 853f17799c68e073965cc568308333f436fadc44 Mon Sep 17 00:00:00 2001 From: NiiightmareXD <90005793+NiiightmareXD@users.noreply.github.com> Date: Mon, 30 Sep 2024 16:50:43 +0330 Subject: [PATCH] Expand `delete_messages` documentation (#2973) I stated in the document that the function also handles the case of a single message, also it would be a good idea if it just returns in case of an empty array. --- src/model/channel/channel_id.rs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/model/channel/channel_id.rs b/src/model/channel/channel_id.rs index 3494da5a6a2..6211fb3cea8 100644 --- a/src/model/channel/channel_id.rs +++ b/src/model/channel/channel_id.rs @@ -163,9 +163,10 @@ impl ChannelId { http.as_ref().delete_message(self, message_id.into(), None).await } - /// Deletes all messages by Ids from the given vector in the given channel. + /// Deletes messages by Ids from the given vector in the given channel. /// - /// The minimum amount of messages is 2 and the maximum amount is 100. + /// The Discord API supports deleting between 2 and 100 messages at once. This function + /// also handles the case of a single message by calling `delete_message` internally. /// /// Requires the [Manage Messages] permission. /// @@ -173,7 +174,7 @@ impl ChannelId { /// /// # Errors /// - /// Returns [`ModelError::BulkDeleteAmount`] if an attempt was made to delete either 0 or more + /// Returns [`ModelError::BulkDeleteAmount`] if an attempt was made to delete 0 or more /// than 100 messages. /// /// Also will return [`Error::Http`] if the current user lacks permission to delete messages.