Fix decorators
This commit is contained in:
parent
e259502ad4
commit
7c9b5ce51b
@ -181,7 +181,10 @@ class hook:
|
|||||||
HOOKS[name].append(self)
|
HOOKS[name].append(self)
|
||||||
|
|
||||||
def __call__(self, func):
|
def __call__(self, func):
|
||||||
self.func = func
|
if isinstance(func, hook):
|
||||||
|
self.func = func.func
|
||||||
|
else:
|
||||||
|
self.func = func
|
||||||
self.__doc__ = self.func.__doc__
|
self.__doc__ = self.func.__doc__
|
||||||
return self
|
return self
|
||||||
|
|
||||||
|
@ -101,6 +101,8 @@ def unhandled(cli, prefix, cmd, *args):
|
|||||||
notify_error(cli, botconfig.CHANNEL, log)
|
notify_error(cli, botconfig.CHANNEL, log)
|
||||||
|
|
||||||
def connect_callback(cli):
|
def connect_callback(cli):
|
||||||
|
@hook("endofmotd", hookid=294)
|
||||||
|
@hook("nomotd", hookid=294)
|
||||||
def prepare_stuff(cli, *args):
|
def prepare_stuff(cli, *args):
|
||||||
# just in case we haven't managed to successfully auth yet
|
# just in case we haven't managed to successfully auth yet
|
||||||
if not botconfig.SASL_AUTHENTICATION:
|
if not botconfig.SASL_AUTHENTICATION:
|
||||||
@ -126,9 +128,6 @@ def connect_callback(cli):
|
|||||||
|
|
||||||
wolfgame.connect_callback(cli)
|
wolfgame.connect_callback(cli)
|
||||||
|
|
||||||
hook("endofmotd", hookid=294)(prepare_stuff)
|
|
||||||
hook("nomotd", hookid=294)(prepare_stuff)
|
|
||||||
|
|
||||||
def mustregain(cli, *blah):
|
def mustregain(cli, *blah):
|
||||||
if not botconfig.PASS:
|
if not botconfig.PASS:
|
||||||
return
|
return
|
||||||
|
Loading…
Reference in New Issue
Block a user