callbacks.py: Pass a reference to the plugin to pre-command callbacks.

This commit is contained in:
Valentin Lorentz 2013-11-26 16:57:33 +01:00
parent 6c9b03f70c
commit aea77d64e7

View File

@ -1239,7 +1239,7 @@ class Commands(BasePlugin):
def callCommand(self, command, irc, msg, *args, **kwargs): def callCommand(self, command, irc, msg, *args, **kwargs):
# We run all callbacks before checking if one of them returned True # We run all callbacks before checking if one of them returned True
if any(bool, list(cb(command, irc, msg, *args, **kwargs) if any(bool, list(cb(self, command, irc, msg, *args, **kwargs)
for cb in self.pre_command_callbacks)): for cb in self.pre_command_callbacks)):
return return
method = self.getCommandMethod(command) method = self.getCommandMethod(command)