From 09113bf4fa8cb8a42adb72533c3c76279e090978 Mon Sep 17 00:00:00 2001 From: Jokler Date: Tue, 28 Nov 2017 03:12:48 +0100 Subject: 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 --- bin/main.rs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'bin') 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(); } -- cgit v1.2.3-70-g09d2