Skip to content

Commit

Permalink
fix(media-channel): correctly check for admin status
Browse files Browse the repository at this point in the history
  • Loading branch information
oSumAtrIX committed Nov 7, 2022
1 parent 4f2250c commit b0ce5ae
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions src/utils/media_channel.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,12 @@ pub async fn handle_media_channel(
.iter()
.any(|&channel| channel == current_channel);

if is_media_channel
&& (new_message.attachments.is_empty()
|| !configuration
.administrators
.users
.contains(&new_message.author.id.0))
{
let is_admin = configuration
.administrators
.users
.contains(&new_message.author.id.0);

if is_media_channel && new_message.attachments.is_empty() && !is_admin {
if let Err(why) = new_message.delete(&ctx.http).await {
error!("Error deleting message: {:?}", why);
}
Expand Down

0 comments on commit b0ce5ae

Please sign in to comment.