Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[tell] Fixes #418. Error when not enough args given #419

Merged
merged 1 commit into from
Jan 22, 2014
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 12 additions & 3 deletions willie/modules/tell.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,11 +88,20 @@ def get_user_time(bot, nick):
def f_remind(bot, trigger):
"""Give someone a message the next time they're seen"""
teller = trigger.nick

verb = trigger.group(1)
tellee, msg = trigger.group(2).split(None, 1)

tellee = Nick(tellee.rstrip('.,:;'))
if not trigger.group(3):
bot.reply("%s whom?" % verb)
return

tellee = trigger.group(3).rstrip('.,:;')
msg = trigger.group(2).lstrip(tellee).lstrip()

if not msg:
bot.reply("%s %s what?" % (verb, tellee))
return

tellee = Nick(tellee)

if not os.path.exists(bot.tell_filename):
return
Expand Down