From bc8cf0e465c475d5783edad13ecbd749979a2836 Mon Sep 17 00:00:00 2001 From: dece Date: Thu, 5 Nov 2020 22:45:33 +0100 Subject: [PATCH] plugin: clean --- edmond/plugin.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/edmond/plugin.py b/edmond/plugin.py index 8507e83..14e5420 100644 --- a/edmond/plugin.py +++ b/edmond/plugin.py @@ -125,9 +125,9 @@ class Plugin: someone saying a bot's name. In other cases, return None. Note that you do not need to use this method for command/question - plugins, the following methods already check for this and do more - precise parsing of the message. This is rather for plugins reacting to a - message addressed to the bot that are neither commands or questions. + plugins, the next methods already check for this and do more precise + parsing of the message. This is rather for plugins reacting to a message + addressed to the bot that are neither commands or questions. """ first_word_and_rest = message.split(maxsplit=1) num_parts = len(first_word_and_rest) @@ -253,6 +253,11 @@ class Plugin: content = " ".join(words[2:-1]) return Command(ident, content, raw) + def __save_command(self, command): + """Save command in instance for further processing by the plugin.""" + self.command = command + self.bot.log_d(f"Processing command from plugin {self.name}: {command}") + def __respects_handling_conditions(self, exclude_conditions=None): """Check if question conditions are valid.""" conditions = self.config.get("handling_conditions", {}) @@ -268,11 +273,6 @@ class Plugin: return False return True - def __save_command(self, command): - """Save command in instance for further processing by the plugin.""" - self.command = command - self.bot.log_d(f"Processing command from plugin {self.name}: {command}") - def signal_failure(self, target): """Signal a plugin failure to target.""" self.bot.say(target, self.bot.config["error_message"])