plugin: clean
This commit is contained in:
parent
06dfb99635
commit
bc8cf0e465
|
@ -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"])
|
||||
|
|
Loading…
Reference in a new issue