bot
bot copied to clipboard
Mute/tempbans, etc. durations are 1 second off in bot's messages and DMs
Issue
Every mute, temp-ban or anything that has a time (when displayed) always 1 second off.
Example
@ERROR was muted for 2 days (1 day, 23 hours).
The (1 day, 23 hours) isn't required

I'm not sure exactly what message you're referring to there. The general form for !mute, !ban, etc is
Applied <action> to <user> until <end timestamp> (<time remaining>)
e.g

This issue still applies though. A fix for this would be to use the total duration instead of the time remaining (given they should be the same when creating an infraction).
Even if it's technically inaccurate, I would much prefer that the bot displays the rounded duration (i.e., the duration that the moderator used in the infraction itself).
The OP may possibly be referring to the message from the bot as well.
EDIT: Actually as you say, we can use the total duration. So it's not even accurate of me to say that the rounded duration is inaccurate 😄
Why not use discord provided timestamps with the end time?
We already use them for <end timestamp>, so you mean for <time remaining> as well?
I feel that's less useful. In the beginning it will say "in 1 day" and then as time goes by it will say "in X hours" and then as more time goes on it will say "X [units] ago."
I like the duration being just normal static text, I just wish it reflected the actual duration written in the infraction by the moderator (or the bot), rather than a calculation of how much time is remaining (I assume that's what it currently is).
As for the message sent by DM to the user, we do have a relative timestamp for expiry, but we also have the "time remaining" underneath, which is perhaps redundant.
Currently:

Could be just:

To give some context, the duration in parentheses is calculated after the infraction is added to the database. In a very rare case we had some latency and a 10 minute mute was applied 6 minutes after it was added to the database. In that case we were told the mute will last 4 minutes, which is correct.
That said, it doesn't seem like a very compelling reason to keep this behavior. I'm ok with just using the supplied duration as-is, or maybe we could add a check to make sure the delta is no greater than a few seconds to account for edge cases.

P.S.A I'm surprised this lasted more than 15 min
This is something I've noticed with discord relative timestamps in general. Even if you do time = 0 it will say Dec 31 1969.
This is something I've noticed with discord relative timestamps in general. Even if you do time = 0 it will say Dec 31 1969.
time += 1