diff options
author | 2019-09-23 23:19:05 +0200 | |
---|---|---|
committer | 2019-09-23 23:19:05 +0200 | |
commit | 3691657184304e2b1e5e06aea75cf9bbaf858bc6 (patch) | |
tree | c4abf2e5895f1a9f6b8facf4f4ea2a634818f0db | |
parent | Allow whitespace in duration strings and update tests (diff) |
Restructure Duration converter docstring
In this commit, I've restructured the Duration converter's docstring
to a more readable format: a bullet point list.
-rw-r--r-- | bot/converters.py | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/bot/converters.py b/bot/converters.py index db3e2a426..339da7b60 100644 --- a/bot/converters.py +++ b/bot/converters.py @@ -195,10 +195,16 @@ class Duration(Converter): """ Converts a `duration` string to a datetime object that's `duration` in the future. - The converter supports years (symbols: `years`, `year, `Y`, `y`), months (`months`, `month`, - `m`), weeks (`weeks`, `week`, `W`, `w`), days (`days`, `day`, `D`, `d`), hours (`hours`, - `hour`, `H`, `h`), minutes (`minutes`, `minute`, `M`), and seconds (`seconds`, `second`, - `S`, `s`), The units must be provided in descending order of magnitude. + The converter supports the following symbols for each unit of time: + - years: `Y`, `y`, `year`, `years` + - months: `m`, `month`, `months` + - weeks: `w`, `W`, `week`, `weeks` + - days: `d`, `D`, `day`, `days` + - hours: `H`, `h`, `hour`, `hours` + - minutes: `M`, `minute`, `minutes` + - seconds: `S`, `s`, `second`, `seconds` + + The units need to be provided in descending order of magnitude. """ match = self.duration_parser.fullmatch(duration) if not match: |