From 7ed10e3fbf77d220dd484e618cbe04bdcd2c9ad7 Mon Sep 17 00:00:00 2001 From: warddr Date: Wed, 27 Aug 2014 07:38:59 +0200 Subject: [PATCH] Make time units case insensitive this fixes #609 --- remind.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/remind.py b/remind.py index 93265c2342..e4bcd5abae 100644 --- a/remind.py +++ b/remind.py @@ -125,7 +125,7 @@ def monitor(bot): def remind(bot, trigger): """Gives you a reminder in the given amount of time.""" duration = 0 - message = filter(None, re.split('(\d+(?:\.\d+)? ?(?:' + periods + ')) ?', + message = filter(None, re.split('(\d+(?:\.\d+)? ?(?:(?i)' + periods + ')) ?', trigger.group(2))[1:]) reminder = '' stop = False @@ -133,7 +133,7 @@ def remind(bot, trigger): grp = re.match('(\d+(?:\.\d+)?) ?(.*) ?', piece) if grp and not stop: length = float(grp.group(1)) - factor = scaling.get(grp.group(2), 60) + factor = scaling.get(grp.group(2).lower(), 60) duration += length * factor else: reminder = reminder + piece