This commit is contained in:
kittentm 2026-05-12 21:45:33 +02:00
commit c0f300a958
Signed by: kitten
GPG key ID: 394B4EABE4405A83
5 changed files with 0 additions and 110 deletions

View file

@ -1,65 +0,0 @@
use once_cell::sync::Lazy;
use regex::Regex;
use serenity::all::{Context, EventHandler, Message};
use serenity::async_trait;
static AY_REGEX: Lazy<Regex> =
Lazy::new(|| Regex::new("(^|\\s)[Aa][Yy]+($|\\s)").expect("invalid regex"));
pub struct AyyHandler;
#[async_trait]
impl EventHandler for AyyHandler {
async fn message(&self, ctx: Context, msg: Message) {
if msg.author.bot{
return;
}
if AY_REGEX.is_match(&msg.content){
let mut output = "".to_owned();
let mut lastpos = 0;
for ay in AY_REGEX.find_iter(&msg.content){
output += &msg.content[lastpos..ay.start()];
lastpos = ay.end();
let mut str = ay.as_str();
if str.starts_with(' '){
str = &str[1..];
output.push(' ');
}
let mut chars = str.chars();
let Some(first_char) = chars.next() else{
return
};
if first_char.is_lowercase(){
output.push_str("lma")
} else {
output.push_str("LMA")
}
for char in chars{
if char == ' '{
output.push(' ');
break;
}
if char.is_lowercase(){
output.push('o');
} else {
output.push('O');
}
}
}
output += &msg.content[lastpos..];
msg.reply(&ctx.http, output).await.ok();
}
}
}

View file

@ -1,22 +0,0 @@
use once_cell::sync::Lazy;
use regex::Regex;
use serenity::all::{Context, CreateCommand, EventHandler, Message};
use serenity::async_trait;
use crate::error_codes::ErrorCodeHandler;
static CHEESEBURGER_REGEX: Lazy<Regex> =
Lazy::new(|| Regex::new("[Cc]heeseburger(s)?").expect("invalid regex"));
pub struct CheeseburgerHandler;
#[async_trait]
impl EventHandler for CheeseburgerHandler {
async fn message(&self, ctx: Context, msg: Message) {
if msg.author.bot{
return;
}
if CHEESEBURGER_REGEX.is_match(&msg.content){
msg.reply(&ctx.http, "currently scratching the FUCK out of my bum bum idgaf").await.ok();
}
}
}

View file

@ -1,10 +1,7 @@
mod ayy;
mod cheeseburger;
mod emergency_report; mod emergency_report;
mod error_codes; mod error_codes;
mod fest_fax; mod fest_fax;
mod miiverse_mod_application; mod miiverse_mod_application;
mod too_fat;
use once_cell::sync::Lazy; use once_cell::sync::Lazy;
use regex::Regex; use regex::Regex;

View file

@ -1,5 +1,4 @@
use crate::cheeseburger::CheeseburgerHandler;
use serenity::all::{ActivityData, ActivityType, ChannelId, Colour, Command, CommandId, Context, CreateCommand, CreateEmbed, CreateEmbedAuthor, CreateInputText, CreateInteractionResponse, CreateInteractionResponseMessage, CreateMessage, CreateQuickModal, EventHandler, Guild, GuildId, InputTextStyle, Interaction, Message, Ready, Timestamp}; use serenity::all::{ActivityData, ActivityType, ChannelId, Colour, Command, CommandId, Context, CreateCommand, CreateEmbed, CreateEmbedAuthor, CreateInputText, CreateInteractionResponse, CreateInteractionResponseMessage, CreateMessage, CreateQuickModal, EventHandler, Guild, GuildId, InputTextStyle, Interaction, Message, Ready, Timestamp};
use serenity::async_trait; use serenity::async_trait;
use tokio::sync::OnceCell; use tokio::sync::OnceCell;

View file

@ -1,19 +0,0 @@
use std::time::Duration;
use serenity::all::{Context, EventHandler, Message};
use serenity::async_trait;
use tokio::time::sleep;
pub struct TooFatHandler;
#[async_trait]
impl EventHandler for TooFatHandler {
async fn message(&self, ctx: Context, msg: Message) {
if msg.content.contains("151-0204") {
tokio::spawn(async move {
sleep(Duration::from_secs(1)).await;
msg.reply(&ctx.http, "in other words your too fat").await.ok();
});
}
}
}