From ff3520f8fda400f3a57b22894a98e830a61c1695 Mon Sep 17 00:00:00 2001 From: Mallory Hancock Date: Mon, 30 Sep 2019 11:35:35 -0700 Subject: [PATCH] fix join command issue #41 --- pinhook/bot.py | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/pinhook/bot.py b/pinhook/bot.py index e54e001..14824e4 100644 --- a/pinhook/bot.py +++ b/pinhook/bot.py @@ -125,12 +125,17 @@ class Bot(irc.bot.SingleServerIRCBot): else: op = False if cmd == self.cmd_prefix + 'join' and op: - c.join(*arg.split()) - self.logger.info('joining {} per request of {}'.format(arg, nick)) - output = self.output_message('{}: joined {}'.format(nick, arg.split()[0])) + try: + c.join(*arg.split()) + self.logger.info('joining {} per request of {}'.format(arg, nick)) + output = self.output_message('{}: joined {}'.format(nick, arg.split()[0])) + except: + self.logger.exception('issue with join command: {}join #channel '.format(self.cmd_prefix)) elif cmd == self.cmd_prefix + 'quit' and op: self.logger.info('quitting per request of {}'.format(nick)) - c.quit("See y'all later!") + if not arg: + arg = "See y'all later!" + c.quit(arg) quit() elif cmd == self.cmd_prefix + 'help': self.call_help(nick, op)