Skip to content

Commit

Permalink
extras.py: Set minimum time for a reminder
Browse files Browse the repository at this point in the history
  • Loading branch information
FrozenChen committed Sep 3, 2021
1 parent 13a31f5 commit 86597f8
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions cogs/extras.py
Original file line number Diff line number Diff line change
Expand Up @@ -281,6 +281,8 @@ async def remindme(self, ctx, remind_in: str, *, reminder: str):
"""Sends a reminder after a set time, just for you.\n\nTime format: #d#h#m#s."""
if (seconds := parse_time(remind_in)) == -1:
return await ctx.send("💢 I don't understand your time format.")
if seconds < 30:
return await ctx.send("You can't set a reminder for less than 30 seconds in the future.")
timestamp = datetime.datetime.now()
delta = datetime.timedelta(seconds=seconds)
reminder_time = timestamp + delta
Expand Down

0 comments on commit 86597f8

Please sign in to comment.