Made isCommand checking more flexible.

This commit is contained in:
Jeremy Fincher 2003-03-26 07:02:09 +00:00
parent 8ab1e9834a
commit 56a204b453

View File

@ -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: