I hate AI
Some checks failed
Rust / check (push) Failing after 52s

This commit is contained in:
August 2026-05-26 22:10:35 -04:00
parent 34bc901916
commit 814a789d9c
Signed by: shibedrill
SSH Key Fingerprint: SHA256:M0m3JW1s38BgO2t0fG146Yxd9OJ2IOqkvCAsuRHQ6Pw
2 changed files with 26 additions and 8 deletions

View File

@ -1,10 +1,11 @@
// Tokio async crap const SLOP_SCOUNDREL_SERVER_ID: u64 = 752667089155915846;
const SLOP_SCOUNDREL_ROLE_ID: u64 = 1508961172223951078;
use poise::serenity_prelude as serenity;
#[allow(unused_imports)] #[allow(unused_imports)]
use crate::settings::*; use crate::settings::*;
use poise::serenity_prelude::{self as serenity, FullEvent, RoleId};
// Data passed to every command (shared state) // Data passed to every command (shared state)
pub struct Data {} pub struct Data {}
@ -15,13 +16,31 @@ pub type Error = Box<dyn std::error::Error + Send + Sync>;
pub type Context<'a> = poise::Context<'a, Data, Error>; pub type Context<'a> = poise::Context<'a, Data, Error>;
pub async fn event_handler( pub async fn event_handler(
_ctx: &serenity::Context, ctx: &serenity::Context,
_event: &serenity::FullEvent, event: &serenity::FullEvent,
_framework: poise::FrameworkContext<'_, Data, Error>, _framework: poise::FrameworkContext<'_, Data, Error>,
_data: &Data, _data: &Data,
) -> Result<(), Error> { ) -> Result<(), Error> {
// Future event handling will go here // Future event handling will go here
// Data will contain the database connection // Data will contain the database connection
match &event {
&FullEvent::Message { new_message } => {
if new_message.guild_id.unwrap() == SLOP_SCOUNDREL_SERVER_ID {
if new_message
.author
.has_role(
ctx.http.clone(),
new_message.guild_id.unwrap(),
RoleId::new(SLOP_SCOUNDREL_ROLE_ID),
)
.await
.unwrap() && !new_message.attachments.is_empty()
{
new_message.channel_id.say(ctx.http.clone(), "kys").await?;
}
}
}
_ => {}
}
Ok(()) Ok(())
} }

View File

@ -1,2 +1 @@
#[allow(dead_code)]
const SLOP_SCOUNDREL_ROLE_ID: u64 = 1508961172223951078;