Fixed AI bullying feature
Some checks failed
Rust / check (push) Failing after 48s

This commit is contained in:
August 2026-05-26 22:49:41 -04:00
parent 814a789d9c
commit a45292611e
Signed by: shibedrill
SSH Key Fingerprint: SHA256:M0m3JW1s38BgO2t0fG146Yxd9OJ2IOqkvCAsuRHQ6Pw
5 changed files with 28 additions and 6 deletions

1
Cargo.lock generated
View File

@ -2711,6 +2711,7 @@ dependencies = [
"structstruck", "structstruck",
"tempfile", "tempfile",
"tokio", "tokio",
"url",
"vergen", "vergen",
"zip", "zip",
] ]

View File

@ -30,7 +30,8 @@ self-replace = { version = "1.5.0", optional = true }
zip = { version = "7.2.0", optional = true } zip = { version = "7.2.0", optional = true }
nix = { version = "0.31.1", features = ["process"], optional = true } nix = { version = "0.31.1", features = ["process"], optional = true }
minreq = { version = "2.14.0", features = ["https"], optional = true } minreq = { version = "2.14.0", features = ["https"], optional = true }
url = "2.5.8"
[features] [features]
self-update=["octocrab", "tempfile", "self-replace", "zip", "nix", "minreq"] self-update=["octocrab", "tempfile", "self-replace", "zip", "nix", "minreq"]

View File

@ -1,6 +1,17 @@
const SLOP_SCOUNDREL_SERVER_ID: u64 = 752667089155915846; const SLOP_SCOUNDREL_SERVER_ID: u64 = 752667089155915846;
const SLOP_SCOUNDREL_ROLE_ID: u64 = 1508961172223951078; const SLOP_SCOUNDREL_ROLE_ID: u64 = 1508961172223951078;
use rand::{self, seq::IndexedRandom};
const HATE: [&str; 6] = [
"kys sloplord",
"you post slop stfu",
"go generate some hoes",
"can we kill this guy",
"are you dense",
"SHUUUUT UUUPPPPPPPP!!!!"
];
#[allow(unused_imports)] #[allow(unused_imports)]
use crate::settings::*; use crate::settings::*;
@ -34,9 +45,21 @@ pub async fn event_handler(
RoleId::new(SLOP_SCOUNDREL_ROLE_ID), RoleId::new(SLOP_SCOUNDREL_ROLE_ID),
) )
.await .await
.unwrap() && !new_message.attachments.is_empty() .unwrap()
{ {
new_message.channel_id.say(ctx.http.clone(), "kys").await?; // TODO: Find out why this is necessary
let real_message = new_message.channel(ctx.http.clone()).await.unwrap().guild().unwrap().message(ctx.http.clone(), new_message.id).await.unwrap();
if !real_message.attachments.is_empty()
|| !real_message.embeds.is_empty()
|| real_message.content.contains("https://tenor.com/view")
{
let message = {
let mut rng = rand::rng();
HATE.choose(&mut rng).unwrap().to_string()
};
new_message.channel_id.say(ctx.http.clone(), message).await?;
}
} }
} }
} }

View File

@ -1 +0,0 @@

View File

@ -40,8 +40,6 @@ use crate::command::{
util::*, util::*,
}; };
mod event_handlers;
// Path at which our settings are stored (currently PWD) // Path at which our settings are stored (currently PWD)
//const SETTINGS_PATH: &str = "settings.json"; //const SETTINGS_PATH: &str = "settings.json";