From dc6a908263fb8577c43cb382978519c0845f02f7 Mon Sep 17 00:00:00 2001 From: Edward Powell Date: Sun, 4 May 2014 13:54:52 -0400 Subject: [PATCH] [meetbot] Prevent errors on misused .comment Fixes #518 --- meetbot.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/meetbot.py b/meetbot.py index ddb4f9f5a5..8294b8deb5 100644 --- a/meetbot.py +++ b/meetbot.py @@ -376,10 +376,14 @@ def take_comment(bot, trigger): Used in private message only, as `.comment <#channel> ` https://github.com/embolalia/willie/wiki/Using-the-meetbot-module """ - target, message = trigger.group(2).split(None, 1) - target = Nick(target) if not trigger.sender.is_nick(): return + if not trigger.group(4): # <2 arguements were given + bot.say('Usage: .comment <#channel> ') + return + + target, message = trigger.group(2).split(None, 1) + target = Nick(target) if not ismeetingrunning(target): bot.say("There's not currently a meeting in that channel.") else: