From daab101a666ceef664a097c17e7a7142a60a4e58 Mon Sep 17 00:00:00 2001 From: dece Date: Fri, 9 Oct 2020 13:30:52 +0200 Subject: [PATCH] plugin: minor fixes --- edmond/plugin.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/edmond/plugin.py b/edmond/plugin.py index 1934825..346c296 100644 --- a/edmond/plugin.py +++ b/edmond/plugin.py @@ -23,7 +23,7 @@ class Plugin: def get_config(self): """Return the plugin section from the bot config, plus common values.""" plugins_configs = self.bot.config["plugins"] - config = plugins_configs["common"] + config = plugins_configs["common"].copy() config.update(plugins_configs.get(self.name, {})) return config @@ -34,7 +34,7 @@ class Plugin: if key not in self.config: self.bot.log_w(f"Missing '{key}' in {self.name} configuration.") missing = True - return missing + return not missing def get_runtime_value(self, key, ns=None): """Get a value from the plugin runtime dict.""" @@ -56,6 +56,7 @@ class Plugin: for q in self.config.get("questions", []): if question.startswith(q): self.question = Question(q, question[len(q):].strip()) + self.bot.log_d(f"Answering question from plugin {self.name}.") return True return False @@ -65,6 +66,7 @@ class Plugin: commands = self.config.get("commands", []) if command and any(c == command.ident for c in commands): self.command = command + self.bot.log_d(f"Processing command from plugin {self.name}.") return True return False