aboutsummaryrefslogtreecommitdiffstats
path: root/bin/main.rs
diff options
context:
space:
mode:
authorJokler <jokler.contact@gmail.com>2017-11-28 03:12:48 +0100
committerJokler <jokler.contact@gmail.com>2017-11-28 03:25:45 +0100
commit09113bf4fa8cb8a42adb72533c3c76279e090978 (patch)
treecfb65ad986dac30cf80f88ac36165dba6eab322d /bin/main.rs
parent15e855ddecfdac31ddda26b12fcfd1a142a0ec21 (diff)
downloadfrippy-09113bf4fa8cb8a42adb72533c3c76279e090978.tar.gz
frippy-09113bf4fa8cb8a42adb72533c3c76279e090978.zip
Let users of the library define their own plugins
This means that: - run() is now part of a Bot struct - Plugins the bot should use have to be added before calling run() - The Plugin trait and all of the included plugins are now public
Diffstat (limited to 'bin/main.rs')
-rw-r--r--bin/main.rs10
1 files changed, 9 insertions, 1 deletions
diff --git a/bin/main.rs b/bin/main.rs
index 86910c0..f6a9418 100644
--- a/bin/main.rs
+++ b/bin/main.rs
@@ -4,6 +4,8 @@ extern crate time;
use log::{LogRecord, LogLevel, LogLevelFilter, LogMetadata};
+use frippy::plugins;
+
struct Logger;
impl log::Log for Logger {
@@ -43,5 +45,11 @@ fn main() {
})
.unwrap();
- frippy::run();
+ let mut bot = frippy::Bot::new();
+
+ bot.add_plugin(plugins::Help::new());
+ bot.add_plugin(plugins::Emoji::new());
+ bot.add_plugin(plugins::Currency::new());
+
+ bot.run();
}