rusty_rat/src/commands/fun/eightball.rs

43 lines
1.1 KiB
Rust

extern crate rand;
use rand::{seq::SliceRandom, thread_rng};
use serenity::prelude::*;
use serenity::{
framework::standard::{macros::command, Args, CommandResult},
model::channel::Message,
};
const EIGHTBALL_RESPONCES: [&'static str; 20] = [
"it is certain",
"it is decidedly so",
"without a doubt",
"yes definitely",
"you may rely on it",
"as I see it, yes",
"most likely",
"outlook good",
"yes",
"signs point to yes",
"reply hazy, try again",
"ask again later",
"better not tell you now",
"cannot predict now",
"concentrate and ask again",
"don't count on it",
"my reply is no",
"my sources say no",
"outlook not so good",
"very doubtful",
];
#[command("8ball")]
#[description = "asks the magic cheese ball you deepest desires"]
pub fn eightball(ctx: &mut Context, msg: &Message, _args: Args) -> CommandResult {
let mut rng = thread_rng();
if let Some(choice) = EIGHTBALL_RESPONCES.choose(&mut rng) {
msg.channel_id
.say(&ctx.http, format!("🧀The cheese says {}", choice))
.ok();
}
Ok(())
}