fix(media-channel): correctly check for admin status

This commit is contained in:
oSumAtrIX 2022-11-08 00:28:02 +01:00
parent 4f2250c71f
commit b0ce5ae370
No known key found for this signature in database
GPG Key ID: A9B3094ACDB604B4

View File

@ -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
let is_admin = configuration
.administrators
.users
.contains(&new_message.author.id.0))
{
.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);
}