From 8cb3d6c214564c90c2a7e99cfdc2e45aa8db143a Mon Sep 17 00:00:00 2001 From: Flyte Date: Sun, 12 Jan 2014 17:16:14 +0000 Subject: [PATCH] [tell] Fixes #418. Error when not enough args given --- tell.py | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/tell.py b/tell.py index 545d7db377..38f43039f8 100644 --- a/tell.py +++ b/tell.py @@ -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