feat(joke): add too fat error joke
This commit is contained in:
parent
69e5db888f
commit
4ef46faae4
3 changed files with 22 additions and 0 deletions
|
|
@ -10,6 +10,7 @@ debug = "none"
|
||||||
debug-assertions = false
|
debug-assertions = false
|
||||||
strip = true
|
strip = true
|
||||||
panic = "abort"
|
panic = "abort"
|
||||||
|
lto="fat"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -2,6 +2,7 @@ mod error_codes;
|
||||||
mod cheeseburger;
|
mod cheeseburger;
|
||||||
mod ayy;
|
mod ayy;
|
||||||
mod miiverse_mod_application;
|
mod miiverse_mod_application;
|
||||||
|
mod too_fat;
|
||||||
|
|
||||||
use std::env;
|
use std::env;
|
||||||
use once_cell::sync::Lazy;
|
use once_cell::sync::Lazy;
|
||||||
|
|
@ -26,6 +27,7 @@ async fn main() {
|
||||||
.event_handler(error_codes::ErrorCodeHandler)
|
.event_handler(error_codes::ErrorCodeHandler)
|
||||||
.event_handler(ayy::AyyHandler)
|
.event_handler(ayy::AyyHandler)
|
||||||
.event_handler(cheeseburger::CheeseburgerHandler)
|
.event_handler(cheeseburger::CheeseburgerHandler)
|
||||||
|
.event_handler(too_fat::TooFatHandler)
|
||||||
//.event_handler(miiverse_mod_application::MiiverseModApplicationHandler::default())
|
//.event_handler(miiverse_mod_application::MiiverseModApplicationHandler::default())
|
||||||
.await.expect("unable to create client");
|
.await.expect("unable to create client");
|
||||||
|
|
||||||
|
|
|
||||||
19
src/too_fat.rs
Normal file
19
src/too_fat.rs
Normal 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();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue