Modify hook handling
This commit is contained in:
parent
ee97d6f45e
commit
4382d91008
@ -181,9 +181,6 @@ class hook:
|
||||
self.__doc__ = self.func.__doc__
|
||||
return self
|
||||
|
||||
def caller(self, *args):
|
||||
return self.func(*args)
|
||||
|
||||
@staticmethod
|
||||
def unhook(hookid):
|
||||
for each in list(HOOKS):
|
||||
|
@ -94,7 +94,7 @@ def unhandled(cli, prefix, cmd, *args):
|
||||
if isinstance(arg, bytes): largs[i] = arg.decode('ascii')
|
||||
for fn in decorators.HOOKS.get(cmd, []):
|
||||
try:
|
||||
fn.caller(cli, prefix, *largs)
|
||||
fn.func(cli, prefix, *largs)
|
||||
except Exception as e:
|
||||
if botconfig.DEBUG_MODE:
|
||||
raise e
|
||||
|
Loading…
x
Reference in New Issue
Block a user