mirror of https://github.com/Mikaela/Limnoria.git
Fixed the user list problem.
This commit is contained in:
parent
60a0810b97
commit
e7aa2efcfd
|
@ -510,7 +510,8 @@ class IrcObjectProxy(RichReplyMethods):
|
|||
self.commandMethod = command
|
||||
try:
|
||||
cb.callCommand(command, self, self.msg, self.args)
|
||||
except (getopt.GetoptError, ArgumentError):
|
||||
except (getopt.GetoptError, ArgumentError), e:
|
||||
self.log.debug('ArgumentError: %s', utils.exnToString(e))
|
||||
self.reply(formatArgumentError(command, name=name))
|
||||
except CannotNest, e:
|
||||
if not isinstance(self.irc, irclib.Irc):
|
||||
|
@ -533,6 +534,7 @@ class IrcObjectProxy(RichReplyMethods):
|
|||
name = canonicalName(self.args[0])
|
||||
cbs = findCallbackForCommand(self, name)
|
||||
if len(cbs) == 0:
|
||||
# No callbacks have the command. So we do our invalidCommand stuff.
|
||||
for cb in self.irc.callbacks:
|
||||
if isinstance(cb, PrivmsgRegexp):
|
||||
for (r, m) in cb.res:
|
||||
|
@ -555,7 +557,10 @@ class IrcObjectProxy(RichReplyMethods):
|
|||
# Ok, no regexp-based things matched.
|
||||
self._callInvalidCommands()
|
||||
else:
|
||||
# At least one callback had the command.
|
||||
if len(cbs) > 1:
|
||||
# Let's first see if there are any callbacks with the same name
|
||||
# as the command; they get priority.
|
||||
for cb in cbs:
|
||||
if canonicalName(cb.name()) == name:
|
||||
del self.args[0]
|
||||
|
@ -836,6 +841,7 @@ class Privmsg(irclib.IrcCallback):
|
|||
given command, use this command to tell the bot which plugin's command
|
||||
to use.""" % (myName, myName, myName)
|
||||
def dispatcher(self, irc, msg, args):
|
||||
self.log.debug('Dispatcher called with args: %s.', args)
|
||||
def handleBadArgs():
|
||||
if self._original:
|
||||
self._original(irc, msg, args)
|
||||
|
@ -844,9 +850,7 @@ class Privmsg(irclib.IrcCallback):
|
|||
cb.help(irc, msg, [self.name()])
|
||||
if args:
|
||||
name = canonicalName(args[0])
|
||||
if name == canonicalName(self.name()):
|
||||
handleBadArgs()
|
||||
elif self.isCommand(name):
|
||||
if self.isCommand(name):
|
||||
cap = checkCommandCapability(msg, self, name)
|
||||
if cap:
|
||||
irc.errorNoCapability(cap)
|
||||
|
|
Loading…
Reference in New Issue