feat(joke): add too fat error joke

This commit is contained in:
DJMrTV 2025-02-14 22:50:15 +01:00
commit 4ef46faae4
3 changed files with 22 additions and 0 deletions

View file

@ -10,6 +10,7 @@ debug = "none"
debug-assertions = false
strip = true
panic = "abort"
lto="fat"

View file

@ -2,6 +2,7 @@ mod error_codes;
mod cheeseburger;
mod ayy;
mod miiverse_mod_application;
mod too_fat;
use std::env;
use once_cell::sync::Lazy;
@ -26,6 +27,7 @@ async fn main() {
.event_handler(error_codes::ErrorCodeHandler)
.event_handler(ayy::AyyHandler)
.event_handler(cheeseburger::CheeseburgerHandler)
.event_handler(too_fat::TooFatHandler)
//.event_handler(miiverse_mod_application::MiiverseModApplicationHandler::default())
.await.expect("unable to create client");

19
src/too_fat.rs Normal file
View file

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