WIP: TextMods-Module #58
1 changed files with 70 additions and 0 deletions
|
@ -76,7 +76,77 @@ pub async fn init(mgr: Arc<ModulesManager>) {
|
|||
};
|
||||
shuffler.add_to_modmgr(Arc::clone(&mgr)).await;
|
||||
|
||||
|
||||
let the8ball: BotCommand = BotCommand {
|
||||
module:BotModule(String::from("8ball")),
|
||||
command:String::from("8ball"),
|
||||
alias: vec![String::from("8b")],
|
||||
exec_body: actions_util::asyncbox(the8ball),
|
||||
help:String::from("8ball Help"),
|
||||
required_roles:vec![
|
||||
BotAdmin,
|
||||
Broadcaster,
|
||||
Mod(OF_CMD_CHANNEL),
|
||||
VIP(OF_CMD_CHANNEL),
|
||||
Chatter
|
||||
]
|
||||
};
|
||||
the8ball.add_to_modmgr(Arc::clone(&mgr)).await;
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
///The 8 ball function
|
||||
/// it returns a answear to the user message based on random
|
||||
///
|
||||
async fn the8ball(params : ExecBodyParams)
|
||||
{
|
||||
|
||||
let mut vecanswears = Vec::new();
|
||||
vecanswears.push(String::from("It is certain"));
|
||||
vecanswears.push(String::from("It is decidedly so"));
|
||||
vecanswears.push(String::from("Without a doubt"));
|
||||
vecanswears.push(String::from("Yes definitely"));
|
||||
vecanswears.push(String::from("You may rely on it"));
|
||||
|
||||
vecanswears.push(String::from("As I see it, yes"));
|
||||
vecanswears.push(String::from("Most likely"));
|
||||
vecanswears.push(String::from("Outlook good"));
|
||||
vecanswears.push(String::from("Yes"));
|
||||
vecanswears.push(String::from("Signs point to yes"));
|
||||
|
||||
vecanswears.push(String::from("Reply hazy, try again"));
|
||||
vecanswears.push(String::from("Ask again later"));
|
||||
vecanswears.push(String::from("Better not tell you now"));
|
||||
vecanswears.push(String::from("Cannot predict now"));
|
||||
vecanswears.push(String::from("Concentrate and ask again"));
|
||||
|
||||
vecanswears.push(String::from("Don't count on it"));
|
||||
vecanswears.push(String::from("My reply is no"));
|
||||
vecanswears.push(String::from("My sources say no"));
|
||||
vecanswears.push(String::from("Outlook not so good"));
|
||||
vecanswears.push(String::from("Very doubtful"));
|
||||
|
||||
|
||||
let randchoice = thread_rng().gen_range(0..vecanswears.len());
|
||||
let ballmessage = &vecanswears[randchoice];
|
||||
|
||||
|
||||
|
||||
let bot = Arc::clone(¶ms.bot);
|
||||
let botlock = bot.read().await;
|
||||
botlock
|
||||
.botmgrs
|
||||
.chat
|
||||
.say_in_reply(
|
||||
Channel(params.clone().msg.channel_login().to_string()),
|
||||
ballmessage.clone(),
|
||||
params.clone()
|
||||
).await;
|
||||
}
|
||||
|
||||
|
||||
/// Shuffle Function
|
||||
///
|
||||
/// Grabs The user message and checks how many words it has
|
||||
|
|
Loading…
Reference in a new issue