mirror of
https://github.com/jlu5/PyLink.git
synced 2024-12-25 04:02:45 +01:00
Let's use consistent "Unknown command" errors, right?
This commit is contained in:
parent
d059bd4ff1
commit
bc7765b241
@ -27,7 +27,7 @@ def handle_commands(irc, source, command, args):
|
||||
try:
|
||||
func = utils.bot_commands[cmd]
|
||||
except KeyError:
|
||||
utils.msg(irc, source, 'Unknown command %r.' % cmd)
|
||||
utils.msg(irc, source, 'Error: Unknown command %r.' % cmd)
|
||||
return
|
||||
try:
|
||||
log.info('(%s) Calling command %r for %s', irc.name, cmd, utils.getHostmask(irc, source))
|
||||
|
@ -27,7 +27,7 @@ def identify(irc, source, args):
|
||||
try:
|
||||
username, password = args[0], args[1]
|
||||
except IndexError:
|
||||
utils.msg(irc, source, 'Error: not enough arguments.')
|
||||
utils.msg(irc, source, 'Error: Not enough arguments.')
|
||||
return
|
||||
# Usernames are case-insensitive, passwords are NOT.
|
||||
if username.lower() == conf['login']['user'].lower() and password == conf['login']['password']:
|
||||
@ -35,7 +35,7 @@ def identify(irc, source, args):
|
||||
irc.users[source].identified = realuser
|
||||
utils.msg(irc, source, 'Successfully logged in as %s.' % realuser)
|
||||
log.info("(%s) Successful login to %r by %s.",
|
||||
irc.name, username, utils.getHostmask(irc, source))
|
||||
irc.name, username, utils.getHostmask(irc, source))
|
||||
else:
|
||||
utils.msg(irc, source, 'Incorrect credentials.')
|
||||
u = irc.users[source]
|
||||
@ -65,7 +65,7 @@ def help(irc, source, args):
|
||||
try:
|
||||
func = utils.bot_commands[command]
|
||||
except KeyError:
|
||||
utils.msg(irc, source, 'Error: no such command %r.' % command)
|
||||
utils.msg(irc, source, 'Error: Unknown command %r.' % command)
|
||||
return
|
||||
else:
|
||||
doc = func.__doc__
|
||||
|
Loading…
Reference in New Issue
Block a user