diff options
| author | Austin Hellyer <[email protected]> | 2016-12-18 12:26:50 -0800 |
|---|---|---|
| committer | Austin Hellyer <[email protected]> | 2016-12-18 12:26:50 -0800 |
| commit | 42290348bc05c876b7e70c570a485160e594e098 (patch) | |
| tree | fb36e7419e36c3ca4c8690665a9f7d77899b06e2 /src/model | |
| parent | Default Framework command use_quotes to false (diff) | |
| download | serenity-42290348bc05c876b7e70c570a485160e594e098.tar.xz serenity-42290348bc05c876b7e70c570a485160e594e098.zip | |
Fix Message::delete()
Diffstat (limited to 'src/model')
| -rw-r--r-- | src/model/channel.rs | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/model/channel.rs b/src/model/channel.rs index d769016..90fcc50 100644 --- a/src/model/channel.rs +++ b/src/model/channel.rs @@ -420,12 +420,6 @@ impl Group { } impl Message { - /// True only if message was sent using a webhook. - #[cfg(feature="methods")] - pub fn is_webhook(&self) -> bool { - self.webhook_id.is_some() - } - /// Deletes the message. /// /// **Note**: The logged in user must either be the author of the message or @@ -446,7 +440,7 @@ impl Message { pub fn delete(&self) -> Result<()> { feature_cache_enabled! {{ let req = permissions::MANAGE_MESSAGES; - let is_author = self.author.id != CACHE.read().unwrap().user.id; + let is_author = self.author.id == CACHE.read().unwrap().user.id; let has_perms = utils::user_has_perms(self.channel_id, req)?; if !is_author && !has_perms { @@ -578,6 +572,12 @@ impl Message { } } + /// True only if message was sent using a webhook. + #[cfg(feature="methods")] + pub fn is_webhook(&self) -> bool { + self.webhook_id.is_some() + } + /// Checks the length of a string to ensure that it is within Discord's /// maximum message length limit. /// |