diff --git a/Cargo.toml b/Cargo.toml index 14abdcb..c8f7a5e 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -10,6 +10,7 @@ debug = "none" debug-assertions = false strip = true panic = "abort" +lto="fat" diff --git a/src/main.rs b/src/main.rs index 9479b25..f7955a9 100644 --- a/src/main.rs +++ b/src/main.rs @@ -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"); diff --git a/src/too_fat.rs b/src/too_fat.rs new file mode 100644 index 0000000..6d92f83 --- /dev/null +++ b/src/too_fat.rs @@ -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(); + }); + } + } +} \ No newline at end of file