Skip to content

Commit 37ee5aa

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

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
@@ -17,10 +17,11 @@ const guildMemberTimeoutHandler = (
1717

1818
if (!oldTimeout && newTimeout) {
1919
if (newTimeout >= date) {
20+
const unixTime = Math.floor(newTimeout.getTime() / 1000);
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)