There's no need to test all of the tokens we're looking at. If the first one

is a command, bail out.
This commit is contained in:
James Vega 2004-07-31 06:32:01 +00:00
parent c98ac36ccc
commit 0412055a85

View File

@ -265,11 +265,7 @@ class Infobot(callbacks.PrivmsgCommandAndRegexp):
if self.addressed:
try:
tokens = callbacks.tokenize(payload)
getCallback = callbacks.findCallbackForCommand
commands = filter(None,
map(lambda c, i=irc: getCallback(i, c),
tokens))
if commands:
if callbacks.findCallbackForCommand(irc, tokens[0]):
return
else:
payload += '?'