From fdf1dca2a12a6c65fa1abfa92656c780cba52287 Mon Sep 17 00:00:00 2001 From: oSumAtrIX Date: Mon, 24 Oct 2022 19:07:18 +0200 Subject: [PATCH] fix(media-channel): change order of condition check --- src/utils/media_channel.rs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/utils/media_channel.rs b/src/utils/media_channel.rs index d400684..e9fedf5 100644 --- a/src/utils/media_channel.rs +++ b/src/utils/media_channel.rs @@ -19,12 +19,12 @@ pub async fn handle_media_channel( .iter() .any(|&channel| channel == current_channel); - if !configuration - .administrators - .users - .contains(&new_message.author.id.0) - && is_media_channel - && !new_message.attachments.is_empty() + if is_media_channel + && (new_message.attachments.is_empty() + || !configuration + .administrators + .users + .contains(&new_message.author.id.0)) { if let Err(why) = new_message.delete(&ctx.http).await { error!("Error deleting message: {:?}", why);