bot icon indicating copy to clipboard operation
bot copied to clipboard

Infraction display durations off-by-one

Open ionite34 opened this issue 3 years ago • 1 comments

Description

Infraction messages (such as temp-mute) currently display a time that is almost always 1 least-significant unit less than the requested time.

Examples

1 hour -> 59 minutes 59 seconds

Example

1 day -> 23 hours 59 minutes

Example_2

Possible solutions

Option 1. Keep track of the original requested time duration as part of the infractions data, and return a readable-duration parsed from the original requested time, instead of the delta between the current time. The delta is still used to generate the discord timestamp.

Option 2. Implement rounding changes at the conversion point, and round time durations up.

Alternative formatting proposals

1 - Move duration to front

📨 👌 applied mute to @Example for 1 day until June 10, 2022 8:00 AM.

2 - Move duration to front, add relative discord timestamp to end.

📨 👌 applied mute to @Example for 1 day until June 10, 2022 8:00 AM (in 1 day).

3 - Remove duration, replace with relative discord timestamp.

📨 👌 applied mute to @Example until June 10, 2022 8:00 AM (in 1 day).

ionite34 avatar Jul 13 '22 05:07 ionite34

Related to: https://github.com/python-discord/bot/issues/2130

To echo @mbaruh in the other issue, I'm also in favor of removing the redundancy here. It would simplify the overall process to use the discord timestamp. There might be an edge case for having duration (in N hours/days) for visual cues on the rare cases !mute ... 15M becomes !mute ... 15m. Beyond that, the timestamp rendered in Discord serves the purpose well.

Preocts avatar Jul 14 '22 00:07 Preocts