3
0
mirror of https://github.com/jlu5/PyLink.git synced 2024-12-26 04:32:51 +01:00

Let's use consistent "Unknown command" errors, right?

This commit is contained in:
James Lu 2015-08-25 20:51:13 -07:00
parent d059bd4ff1
commit bc7765b241
2 changed files with 4 additions and 4 deletions

View File

@ -27,7 +27,7 @@ def handle_commands(irc, source, command, args):
try: try:
func = utils.bot_commands[cmd] func = utils.bot_commands[cmd]
except KeyError: except KeyError:
utils.msg(irc, source, 'Unknown command %r.' % cmd) utils.msg(irc, source, 'Error: Unknown command %r.' % cmd)
return return
try: try:
log.info('(%s) Calling command %r for %s', irc.name, cmd, utils.getHostmask(irc, source)) log.info('(%s) Calling command %r for %s', irc.name, cmd, utils.getHostmask(irc, source))

View File

@ -27,7 +27,7 @@ def identify(irc, source, args):
try: try:
username, password = args[0], args[1] username, password = args[0], args[1]
except IndexError: except IndexError:
utils.msg(irc, source, 'Error: not enough arguments.') utils.msg(irc, source, 'Error: Not enough arguments.')
return return
# Usernames are case-insensitive, passwords are NOT. # Usernames are case-insensitive, passwords are NOT.
if username.lower() == conf['login']['user'].lower() and password == conf['login']['password']: if username.lower() == conf['login']['user'].lower() and password == conf['login']['password']:
@ -65,7 +65,7 @@ def help(irc, source, args):
try: try:
func = utils.bot_commands[command] func = utils.bot_commands[command]
except KeyError: except KeyError:
utils.msg(irc, source, 'Error: no such command %r.' % command) utils.msg(irc, source, 'Error: Unknown command %r.' % command)
return return
else: else:
doc = func.__doc__ doc = func.__doc__