bugfix support for years in .remind
This commit is contained in:
parent
fd04c0a547
commit
ac1ecdfc44
|
@ -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:])
|
||||
|
|
Loading…
Reference in New Issue
Block a user