diff options
| author | 2019-01-30 11:23:17 +0000 | |
|---|---|---|
| committer | 2019-01-30 11:23:17 +0000 | |
| commit | 64d12e3415cd87a5a190142759372c5a045a505c (patch) | |
| tree | ae557bce36c87366d2a1b9b3255d6aa2682a8f5f | |
| parent | Check all hooks for a command and pick the first applicable one, to allow for (diff) | |
| signature | ||
Get all hooks when checking command hooks, not just the first (commands.py)
| -rw-r--r-- | modules/commands.py | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/modules/commands.py b/modules/commands.py index db65250f..f98f4a52 100644 --- a/modules/commands.py +++ b/modules/commands.py @@ -103,9 +103,9 @@ class Module(ModuleManager.BaseModule): def has_command(self, command): return command.lower() in self.events.on("received").on( "command").get_children() - def get_hook(self, command): + def get_hooks(self, command): return self.events.on("received.command").on(command - ).get_hooks()[0] + ).get_hooks() def is_highlight(self, server, s): if s and s[-1] in [":", ","]: @@ -142,12 +142,11 @@ class Module(ModuleManager.BaseModule): hook = None target = None - for potential_hook in self.get_hook(command): - hook = self.get_hook(command) + for potential_hook in self.get_hooks(command): alias_of = self._get_alias_of(hook) if alias_of: if self.has_command(alias_of): - hook = self.get_hook(alias_of) + hook = self.get_hooks(alias_of)[0] else: raise ValueError( "'%s' is an alias of unknown command '%s'" |
