aboutsummaryrefslogtreecommitdiff
path: root/src/model/channel/channel_id.rs
diff options
context:
space:
mode:
authoracdenisSK <[email protected]>2017-10-24 18:10:10 +0200
committeracdenisSK <[email protected]>2017-10-24 18:10:10 +0200
commitef60c3cd5b93d61ff8200f5f6871b449bf7dccb5 (patch)
treeff9ec9e09dc363c05c6b582380a120ca47290a9f /src/model/channel/channel_id.rs
parentRemove `on_` prefix to EventHandler tymethods (diff)
parentFall back to `str::parse` if `parse_username` fails (diff)
downloadserenity-ef60c3cd5b93d61ff8200f5f6871b449bf7dccb5.tar.xz
serenity-ef60c3cd5b93d61ff8200f5f6871b449bf7dccb5.zip
Merge v0.4.2
Diffstat (limited to 'src/model/channel/channel_id.rs')
-rw-r--r--src/model/channel/channel_id.rs10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/model/channel/channel_id.rs b/src/model/channel/channel_id.rs
index 3bed660..158ebcf 100644
--- a/src/model/channel/channel_id.rs
+++ b/src/model/channel/channel_id.rs
@@ -124,10 +124,14 @@ impl ChannelId {
.into_iter()
.map(|message_id| message_id.as_ref().0)
.collect::<Vec<u64>>();
+
+ 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.