mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-11-27 05:09:23 +01:00
Made it handle improper arguments correctly; I never noticed that it wasn't doing it already.
This commit is contained in:
parent
c9546934d5
commit
28d81d656d
@ -300,9 +300,10 @@ class IrcObjectProxy:
|
||||
self.reply(self.msg, '[%s]' % ' '.join(self.args))
|
||||
except ArgumentError:
|
||||
if hasattr(command, '__doc__'):
|
||||
self.reply(self.msg, command.__doc__.splitlines()[0])
|
||||
s = '%s %s' % (name, command.__doc__.splitlines()[0])
|
||||
else:
|
||||
self.reply(self.msg, 'Invalid arguments.')
|
||||
s = 'Invalid arguments for %s.' % name
|
||||
self.reply(self.msg, s)
|
||||
except (SyntaxError, Error), e:
|
||||
self.reply(self.msg, debug.exnToString(e))
|
||||
except Exception, e:
|
||||
@ -365,7 +366,12 @@ class CommandThread(threading.Thread):
|
||||
debug.msg('%s took %s seconds.' % \
|
||||
(self.commandName, elapsed), 'verbose')
|
||||
except ArgumentError:
|
||||
self.irc.reply(self.msg, self.command.__doc__.splitlines()[0])
|
||||
if hasattr(self.command, '__doc__'):
|
||||
help = self.command.__doc__.splitlines()[0]
|
||||
s = '%s %s' % (self.commandName, help)
|
||||
else:
|
||||
s = 'Invalid arguments for %s.' % self.commandName
|
||||
self.irc.reply(self.msg, s)
|
||||
except (SyntaxError, Error), e:
|
||||
self.irc.reply(self.msg, debug.exnToString(e))
|
||||
except Exception, e:
|
||||
|
Loading…
Reference in New Issue
Block a user