Skip to content

Commit cc3e08e

Browse files
committed
Use Discord timestamp features for timeout logs
1 parent 936682c commit cc3e08e

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/features/mod-activity.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,14 @@ const guildMemberTimeoutHandler = (
1414
const newTimeout = newMember.communicationDisabledUntil;
1515

1616
const date = new Date();
17+
const unixTime = Math.floor(newTimeout.getTime() / 1000);
1718

1819
if (!oldTimeout && newTimeout) {
1920
if (newTimeout >= date) {
2021
// makes sure we don't log timeouts from the past if a user's role updates. It's still possible that a user is updated during a timeout, but this is the best we can do.
2122
logger.log(
2223
"TIMEOUT",
23-
`${newMember.user.tag} has been timed out in ${newMember.guild.name} until ${newTimeout}.`,
24+
`${newMember.user.tag} has been timed out in ${newMember.guild.name} until <t:${unixTime}:f> (<t:${unixTime}:R>).`,
2425
"modLog",
2526
);
2627
}

0 commit comments

Comments
 (0)