Skip to content
This repository has been archived by the owner on Aug 1, 2021. It is now read-only.

Commit

Permalink
shared config (#67)
Browse files Browse the repository at this point in the history
* Add shared_config to BotConfig

* Allow plugins to overwrite shared_config
  • Loading branch information
enkoder authored and b1naryth1ef committed Dec 6, 2017
1 parent f4956aa commit 6f3345d
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions disco/bot/bot.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ class BotConfig(Config):
levels = {}
plugins = []
plugin_config = {}
shared_config = {}

commands_enabled = True
commands_require_mention = True
Expand Down Expand Up @@ -504,6 +505,9 @@ def load_plugin_config(self, cls):
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])

Expand Down

0 comments on commit 6f3345d

Please sign in to comment.