From 6f3345d7c7183b5707b65ead8342b0756e1dfe4b Mon Sep 17 00:00:00 2001 From: Kodie Goodwin Date: Tue, 5 Dec 2017 18:03:47 -0800 Subject: [PATCH] shared config (#67) * Add shared_config to BotConfig * Allow plugins to overwrite shared_config --- disco/bot/bot.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/disco/bot/bot.py b/disco/bot/bot.py index 5419c4d..f90b882 100644 --- a/disco/bot/bot.py +++ b/disco/bot/bot.py @@ -76,6 +76,7 @@ class BotConfig(Config): levels = {} plugins = [] plugin_config = {} + shared_config = {} commands_enabled = True commands_require_mention = True @@ -504,6 +505,9 @@ class Bot(LoggingClass): self.config.plugin_config_dir, name) + '.' + self.config.plugin_config_format data = {} + if self.config.shared_config: + data.update(self.config.shared) + if name in self.config.plugin_config: data.update(self.config.plugin_config[name])