3
0
mirror of https://github.com/jlu5/PyLink.git synced 2024-11-30 23:09:23 +01:00

Irc: log unrecognized commands to INFO too

This commit is contained in:
James Lu 2015-10-23 19:07:17 -07:00
parent 2bf9568fbb
commit e4cfd1e1e6

View File

@ -178,11 +178,13 @@ class Irc():
return return
def callCommand(self, source, text): def callCommand(self, source, text):
"""Calls a PyLink bot command."""
cmd_args = text.strip().split(' ') cmd_args = text.strip().split(' ')
cmd = cmd_args[0].lower() cmd = cmd_args[0].lower()
cmd_args = cmd_args[1:] cmd_args = cmd_args[1:]
if cmd not in world.commands: if cmd not in world.commands:
self.msg(self.called_by or source, 'Error: Unknown command %r.' % cmd) self.msg(self.called_by or source, 'Error: Unknown command %r.' % cmd)
log.info('(%s) Received unknown command %r from %s', self.name, cmd, utils.getHostmask(self, source))
return return
log.info('(%s) Calling command %r for %s', self.name, cmd, utils.getHostmask(self, source)) log.info('(%s) Calling command %r for %s', self.name, cmd, utils.getHostmask(self, source))
for func in world.commands[cmd]: for func in world.commands[cmd]: