feat(bot): refactor a bit and start working on miiverse mod applications

This commit is contained in:
DJMrTV 2025-02-14 14:18:09 +01:00
commit 151a8285a6
6 changed files with 155 additions and 57 deletions

22
src/cheeseburger.rs Normal file
View file

@ -0,0 +1,22 @@
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();
}
}
}