From c3bf7891e9862fd605e2b55c73c6883eb8b821c0 Mon Sep 17 00:00:00 2001 From: Yuzu Date: Wed, 29 Jun 2022 21:00:58 +0700 Subject: [PATCH] Fixed NaN date --- src/discord/UserInfo.ts | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/src/discord/UserInfo.ts b/src/discord/UserInfo.ts index 535ba66..8dd4ade 100644 --- a/src/discord/UserInfo.ts +++ b/src/discord/UserInfo.ts @@ -106,15 +106,25 @@ const EMBEDS = { title = `📺 ${locale.__('userinfo.watching_x', { NAME: activity.name })}`; break; case ActivityType.Competing: - title = `'🌠 ${locale.__('userinfo.competing_x', { NAME: activity.name })}`; + title = `🌠 ${locale.__('userinfo.competing_x', { NAME: activity.name })}`; break; } + const startTime = activity.timestamps?.start; + const endTime = activity.timestamps?.end; embed.addFields({ name: `${title}`, value: `${activity.details === null ? '' : activity.details} - ${activity.state === null ? '' : activity.state} - Since - \u200b`, + ${activity.state === null ? '' : activity.state} + ${ + startTime + ? `Since ` + : '' + }${ + endTime + ? `\nEnd ` + : '' + } + \u200b`, inline: false }); }