Clippy fixes
All checks were successful
Rust / check (push) Successful in 39s

This commit is contained in:
August 2026-05-26 23:12:34 -04:00
parent 07f7cddf71
commit accc834375
Signed by: shibedrill
SSH Key Fingerprint: SHA256:M0m3JW1s38BgO2t0fG146Yxd9OJ2IOqkvCAsuRHQ6Pw

View File

@ -39,48 +39,44 @@ pub async fn event_handler(
) -> 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 { if let &FullEvent::Message { new_message } = &event {
&FullEvent::Message { new_message } => { if new_message.guild_id.unwrap() == SLOP_SCOUNDREL_SERVER_ID
if new_message.guild_id.unwrap() == SLOP_SCOUNDREL_SERVER_ID { && new_message
if new_message .author
.author .has_role(
.has_role( ctx.http.clone(),
ctx.http.clone(), new_message.guild_id.unwrap(),
new_message.guild_id.unwrap(), RoleId::new(SLOP_SCOUNDREL_ROLE_ID),
RoleId::new(SLOP_SCOUNDREL_ROLE_ID), )
) .await
.await .unwrap()
.unwrap() {
{ info!("Testing message with ID: {}", new_message.id);
info!("Testing message with ID: {}", new_message.id); // TODO: Find out why this is necessary
// TODO: Find out why this is necessary let real_message = new_message
let real_message = new_message .channel(ctx.http.clone())
.channel(ctx.http.clone()) .await
.await .unwrap()
.unwrap() .guild()
.guild() .unwrap()
.unwrap() .message(ctx.http.clone(), new_message.id)
.message(ctx.http.clone(), new_message.id) .await
.await .unwrap();
.unwrap(); if !real_message.attachments.is_empty()
if !real_message.attachments.is_empty() || !real_message.embeds.is_empty()
|| !real_message.embeds.is_empty() || real_message.content.contains("https://tenor.com/view")
|| real_message.content.contains("https://tenor.com/view") {
{ let message = {
let message = { let mut rng = rand::rng();
let mut rng = rand::rng(); HATE.choose(&mut rng).unwrap().to_string()
HATE.choose(&mut rng).unwrap().to_string() };
}; info!("Sending a rude message");
info!("Sending a rude message"); let _reply = real_message
let _reply = real_message .channel_id
.channel_id .say(ctx.http.clone(), message)
.say(ctx.http.clone(), message) .await?;
.await?;
}
}
} }
} }
_ => {}
} }
Ok(()) Ok(())
} }