bot icon indicating copy to clipboard operation
bot copied to clipboard

Mute/tempbans, etc. durations are 1 second off in bot's messages and DMs

Open AFK-debug-9 opened this issue 3 years ago • 9 comments

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 alt text

AFK-debug-9 avatar Apr 16 '22 18:04 AFK-debug-9

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

image

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).

wookie184 avatar Apr 22 '22 17:04 wookie184

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 😄

minalike avatar Apr 22 '22 17:04 minalike

Why not use discord provided timestamps with the end time?

onerandomusername avatar Apr 23 '22 01:04 onerandomusername

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: image

Could be just: image

minalike avatar Apr 23 '22 01:04 minalike

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.

mbaruh avatar Apr 23 '22 10:04 mbaruh

image

AFK-debug-9 avatar Apr 25 '22 11:04 AFK-debug-9

P.S.A I'm surprised this lasted more than 15 min

AFK-debug-9 avatar Apr 25 '22 11:04 AFK-debug-9

This is something I've noticed with discord relative timestamps in general. Even if you do time = 0 it will say Dec 31 1969.

greyblue9 avatar Apr 25 '22 12:04 greyblue9

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

AFK-debug-9 avatar Apr 25 '22 12:04 AFK-debug-9