Add random response module

This commit is contained in:
Adrian Malacoda 2017-02-16 02:00:38 -06:00
parent 2c87c586e2
commit 26e56ebee9
3 changed files with 6 additions and 0 deletions

View File

@ -1,6 +1,7 @@
extern crate toml;
extern crate crossbeam;
extern crate discord;
extern crate rand;
use std::collections::BTreeMap;
use toml::Table;
@ -16,6 +17,8 @@ use std::sync::Arc;
use std::sync::mpsc;
use std::sync::mpsc::Sender;
mod helpers;
pub struct Tenquestionmarks {
modules: BTreeMap<String, Box<Module>>
}

View File

@ -9,6 +9,7 @@ use modules::discord::DiscordModule;
use modules::lua::LuaModule;
use modules::stdin::StdinModule;
use modules::echo::EchoModule;
use modules::random::RandomModule;
pub struct ModuleLoader {
types: BTreeMap<&'static str, fn(&Table) -> Box<Module>>
@ -21,6 +22,7 @@ impl ModuleLoader {
types.insert("lua", LuaModule::new as fn(&Table) -> Box<Module>);
types.insert("stdin", StdinModule::new as fn(&Table) -> Box<Module>);
types.insert("echo", EchoModule::new as fn(&Table) -> Box<Module>);
types.insert("random", RandomModule::new as fn(&Table) -> Box<Module>);
ModuleLoader {
types: types
}

View File

@ -2,6 +2,7 @@ pub mod lua;
pub mod discord;
pub mod stdin;
pub mod echo;
pub mod random;
pub mod loader;