bugfix support for years in .remind

This commit is contained in:
iou1name 2020-03-27 13:14:24 -04:00
parent fd04c0a547
commit ac1ecdfc44

View File

@ -60,6 +60,9 @@ def remind(bot, trigger):
if not reg:
return bot.reply("I didn't understand that.")
args = {shorthand[g[-1]]: int(g[:-1]) for g in reg.groups() if g}
if args.get('years'):
args['days'] = args['years']*365 + args.get('days', 0) # screw leap years
del args['years']
delta = timedelta(**args)
dt = datetime.now() + delta
reminder = ' '.join(trigger.args[2:])