mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-11-23 11:09:23 +01:00
Made isCommand checking more flexible.
This commit is contained in:
parent
8ab1e9834a
commit
56a204b453
@ -295,6 +295,7 @@ class Privmsg(irclib.IrcCallback):
|
|||||||
"""Base class for all Privmsg handlers."""
|
"""Base class for all Privmsg handlers."""
|
||||||
threaded = False
|
threaded = False
|
||||||
public = True
|
public = True
|
||||||
|
commandArgs = ['self', 'irc', 'msg', 'args']
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
self.rateLimiter = RateLimiter()
|
self.rateLimiter = RateLimiter()
|
||||||
if self.threaded:
|
if self.threaded:
|
||||||
@ -317,8 +318,7 @@ class Privmsg(irclib.IrcCallback):
|
|||||||
method = getattr(self, methodName)
|
method = getattr(self, methodName)
|
||||||
if inspect.ismethod(method):
|
if inspect.ismethod(method):
|
||||||
code = method.im_func.func_code
|
code = method.im_func.func_code
|
||||||
return inspect.getargs(code) == (['self','irc', 'msg', 'args'],
|
return inspect.getargs(code) == (self.commandArgs, None, None)
|
||||||
None, None)
|
|
||||||
else:
|
else:
|
||||||
return False
|
return False
|
||||||
else:
|
else:
|
||||||
|
Loading…
Reference in New Issue
Block a user