python-discord / bot

The community bot for the Python Discord community
https://pythondiscord.com
MIT License
1.34k stars 664 forks source link

Allow passing end time to `!remind` #1924

Open TizzySaurus opened 2 years ago

TizzySaurus commented 2 years ago

This issue proposes allowing users to specify the end time of a reminder as the duration, instead of a relative time (e.g. !remind "01-11-2021 08:00" example instead of !remind 16h38M example).

This would mean the user doesn't have to do the maths of "how far away is the time I want", but would also mean we'd have to come up with some sort of parsing for the time, potentially with support for !remind 08:00 example (send reminder whenever the next occurrence of 8am is) and/or !remind "01-11-2021 08:00UTC+1" example (specifying timezone instead of defaulting to UTC).

Hashed0719 commented 2 years ago

Does this code runs on 3.10 version? Maybe it can be done with the new pattern matching feature.

bsoyka commented 2 years ago

@zeph-yrus9 The bot only runs on Python 3.9 right now, so unfortunately not.

TizzySaurus commented 2 years ago

Note: The DayDuration converter added in #2001 (specifically in commit f8ea3e8) may be of use here -- would need to be extended to support day/month/year though.

onerandomusername commented 2 years ago

I'd like to implement this.

EDIT: Just noticed that @TizzySaurus is assigned, so if you don't want to implement it (since it been a month), I can. :D

Hashed0719 commented 2 years ago

Module "re" in standard library may also be of help here.