diff --git a/src/model/channel/channel_id.rs b/src/model/channel/channel_id.rs index f7281919811..2e415dcb9fe 100644 --- a/src/model/channel/channel_id.rs +++ b/src/model/channel/channel_id.rs @@ -122,10 +122,14 @@ impl ChannelId { .into_iter() .map(|message_id| message_id.as_ref().0) .collect::>(); + + if ids.len() == 1 { + self.delete_message(ids[0]) + } else { + let map = json!({ "messages": ids }); - let map = json!({ "messages": ids }); - - http::delete_messages(self.0, &map) + http::delete_messages(self.0, &map) + } } /// Deletes all permission overrides in the channel from a member or role. diff --git a/src/model/channel/guild_channel.rs b/src/model/channel/guild_channel.rs index e2e5f0971d1..d6649b40ac4 100644 --- a/src/model/channel/guild_channel.rs +++ b/src/model/channel/guild_channel.rs @@ -258,7 +258,7 @@ impl GuildChannel { /// [`Channel::delete_messages`]: enum.Channel.html#method.delete_messages /// [Manage Messages]: permissions/constant.MANAGE_MESSAGES.html #[inline] - pub fn delete_messages<'a, It: IntoIterator>(&self, message_ids: It) -> Result<()> { + pub fn delete_messages, It: IntoIterator>(&self, message_ids: It) -> Result<()> { self.id.delete_messages(message_ids) }