discord-math / bot

BSD 3-Clause "New" or "Revised" License
11 stars 14 forks source link

Add support for ISO 8601 datetimes in bot commands #74

Open rattus-rattus-sapiens opened 1 month ago

rattus-rattus-sapiens commented 1 month ago

While bot commands currently accept an time interval (1d, 3M, etc"), it would be convenient if we could also specify datetimes. I propose datetimes be specified per ISO 8601, as the native datetime python module supports parsing these strings anyway.

The commands .poll from consensus.py and .remindme from reminders.py stand out to me as particular QoL improvements.

Potentially a good first issue for would-be contributors.

mniip commented 3 weeks ago

An old dream of mine was to somehow yank the date parser from the GNU coreutils date utility. Vis:

$ date --date 'next friday 3PM'
Fri Aug 23 03:00:00 PM CEST 2024

This proves to be challenging however because the parser is not a library, just a piece of C code.

rattus-rattus-sapiens commented 3 weeks ago

seems like https://dateparser.readthedocs.io/en/latest/ would do the trick?