Durations

Durations are used in commands such as remindme to specify a distance of time from now. For example, a message like this: pl.remindme 1h 5m 3s 100ms, do something would remind you to do something after 1 hour, 5 minutes and 3.1 seconds have passed (the bot wouldn't show the .1 part though).

Duration specification

To specify a duration, you must follow some simple rules in order for it to be understood correctly. Those rules are the following:

  • You can use those abbreviations to specify time, but nothing else:

    • Weeks: w, wk, week, weeks

    • Days: d, day, days

    • Hours: h, hr, hour, hours

    • Minutes: m, min, mins, minute, minutes

    • Seconds: s, sec, secs, second, seconds

    • Milliseconds: ms, millisecond, milliseconds

  • You can add as many spaces as you want (and commas), but nothing else and not between letters of a word.

  • You can add the same unit more than once and not add the units in order, and it'll be valid.

  • You can add a - in front of a number to make it negative.

Following those rules, we get that:

  • 1w 3d 5h 7m 9s 11000ms is a valid string

  • 1y 3e 5g 7f 9x 11000t isn't