Fix ghoul message spam

This commit is contained in:
joeyahines committed 2025-09-24 18:03:01 -06:00
1 parent c6786a77f7
commit 2901ed3be2
3 files changed
+11 -2

No files matched your search

+9
View File
@@ -12,6 +12,7 @@ use rand::{Rng, rng};
use serde::{Deserialize, Serialize};
use std::fmt::Debug;
use std::sync::Arc;
use crate::discord::get_role;
#[derive(Debug, Clone, Serialize, Deserialize, PartialEq)]
#[serde(tag = "type")]
@@ -243,6 +244,14 @@ impl Listener {
trigger_event.channel_id.say(ctx.http(), msg).await?;
}
Action::Ghoulify { hours } => {
// slight hack to prevent ghoul spamming
let ghoul_role = get_role(&ctx.http, data.cfg.guild_id, &UserRole::Ghoul.to_string()).await?;
if let Ok(user) = data.cfg.guild_id.member(&ctx.http(), trigger_event.triggerer).await
&& let Some(ghoul_role) = ghoul_role
&& user.roles.contains(&ghoul_role) {
break;
}
User::add_role(
ctx.http(),
&data.db,