X-Git-Url: http://git.kaliko.me/?p=sid.git;a=blobdiff_plain;f=sid%2Fsid.py;h=53fd5696976f4a60d2d01ec7ec75dfaeb4066aaf;hp=726f7fa9888fac496725022596f23fb0463f31aa;hb=40a4cb2e7caa70e009736ead303ce016ddac3a71;hpb=ee38f3ae1e801fd160978b2c5804d4cc056683f6 diff --git a/sid/sid.py b/sid/sid.py index 726f7fa..53fd569 100644 --- a/sid/sid.py +++ b/sid/sid.py @@ -103,14 +103,12 @@ class MUCBot(sleekxmpp.ClientXMPP): if args: self.log.debug('arg: {0}'.format(args)) try: - reply = self.commands[cmd](msg, args) + self.commands[cmd](msg, args) except Exception as err: reply = ''.join(traceback.format_exc()) self.log.exception('An error occurred processing: {0}: {1}'.format(body, reply)) - self.log.info(self.log.level) - if self.log.level >= 20 or not reply: - return - self.send_message(mto=msg['from'].bare, mbody=reply, mtype='groupchat') + if self.log.level < 20 and reply: + self.send_message(mto=msg['from'].bare, mbody=reply, mtype='groupchat') def start(self, event): """ @@ -182,4 +180,4 @@ class MUCBot(sleekxmpp.ClientXMPP): text = self.commands[args[0]].__doc__.strip() or 'undocumented' else: text = 'That command is not defined.' - return text + self.send_message(mto=message['from'].bare, mbody=text, mtype='groupchat')