Skip to content

Commit

Permalink
[meetbot] Prevent errors on misused .comment
Browse files Browse the repository at this point in the history
  • Loading branch information
embolalia committed May 4, 2014
1 parent 237ef8e commit dc6a908
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions meetbot.py
Original file line number Diff line number Diff line change
Expand Up @@ -376,10 +376,14 @@ def take_comment(bot, trigger):
Used in private message only, as `.comment <#channel> <comment to add>`
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> <comment to add>')
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:
Expand Down

0 comments on commit dc6a908

Please sign in to comment.