Skip to content

Commit

Permalink
Fix faulty check in suppress_embeds (serenity-rs#2582)
Browse files Browse the repository at this point in the history
  • Loading branch information
fawni authored Nov 22, 2023
1 parent a2bec96 commit d37db64
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions src/model/channel/message.rs
Original file line number Diff line number Diff line change
Expand Up @@ -796,15 +796,13 @@ impl Message {
#[cfg(feature = "cache")]
{
if let Some(cache) = cache_http.cache() {
utils::user_has_perms_cache(
cache,
self.channel_id,
self.guild_id,
Permissions::MANAGE_MESSAGES,
)?;

if self.author.id != cache.current_user_id() {
return Err(Error::Model(ModelError::NotAuthor));
utils::user_has_perms_cache(
cache,
self.channel_id,
self.guild_id,
Permissions::MANAGE_MESSAGES,
)?;
}
}
}
Expand Down

0 comments on commit d37db64

Please sign in to comment.