mirror of
https://github.com/revanced/revanced-discord-bot.git
synced 2025-05-01 15:04:25 +02:00
fix(media-channel): correctly check for admin status
This commit is contained in:
parent
4f2250c71f
commit
b0ce5ae370
@ -19,13 +19,12 @@ pub async fn handle_media_channel(
|
|||||||
.iter()
|
.iter()
|
||||||
.any(|&channel| channel == current_channel);
|
.any(|&channel| channel == current_channel);
|
||||||
|
|
||||||
if is_media_channel
|
let is_admin = configuration
|
||||||
&& (new_message.attachments.is_empty()
|
.administrators
|
||||||
|| !configuration
|
.users
|
||||||
.administrators
|
.contains(&new_message.author.id.0);
|
||||||
.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 {
|
if let Err(why) = new_message.delete(&ctx.http).await {
|
||||||
error!("Error deleting message: {:?}", why);
|
error!("Error deleting message: {:?}", why);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user