Browse Source

shared config (#67)

* Add shared_config to BotConfig

* Allow plugins to overwrite shared_config
pull/70/head
Kodie Goodwin 7 years ago
committed by Andrei Zbikowski
parent
commit
6f3345d7c7
  1. 4
      disco/bot/bot.py

4
disco/bot/bot.py

@ -76,6 +76,7 @@ class BotConfig(Config):
levels = {} levels = {}
plugins = [] plugins = []
plugin_config = {} plugin_config = {}
shared_config = {}
commands_enabled = True commands_enabled = True
commands_require_mention = True commands_require_mention = True
@ -504,6 +505,9 @@ class Bot(LoggingClass):
self.config.plugin_config_dir, name) + '.' + self.config.plugin_config_format self.config.plugin_config_dir, name) + '.' + self.config.plugin_config_format
data = {} data = {}
if self.config.shared_config:
data.update(self.config.shared)
if name in self.config.plugin_config: if name in self.config.plugin_config:
data.update(self.config.plugin_config[name]) data.update(self.config.plugin_config[name])

Loading…
Cancel
Save