summaryrefslogtreecommitdiffstats
path: root/bin
diff options
context:
space:
mode:
Diffstat (limited to 'bin')
-rw-r--r--bin/main.rs16
1 files changed, 16 insertions, 0 deletions
diff --git a/bin/main.rs b/bin/main.rs
index 08787ff..420e016 100644
--- a/bin/main.rs
+++ b/bin/main.rs
@@ -81,6 +81,14 @@ fn main() {
// Open a connection and add work for each config
for config in configs {
+
+ let mut disabled_plugins = None;
+ if let &Some(ref options) = &config.options {
+ if let Some(disabled) = options.get("disabled_plugins") {
+ disabled_plugins = Some(disabled.split(",").map(|p| p.trim()).collect::<Vec<_>>());
+ }
+ }
+
let mut bot = frippy::Bot::new();
bot.add_plugin(plugins::Help::new());
bot.add_plugin(plugins::Url::new(1024));
@@ -88,6 +96,14 @@ fn main() {
bot.add_plugin(plugins::Currency::new());
bot.add_plugin(plugins::KeepNick::new());
+ if let Some(disabled_plugins) = disabled_plugins {
+ for name in disabled_plugins {
+ if let None = bot.remove_plugin(name) {
+ error!("{:?} was not found - could not disable", name);
+ }
+ }
+ }
+
bot.connect(&mut reactor, &config);
}