From 8db1f656913fc3eb260e24ac7ad9ef386de02e92 Mon Sep 17 00:00:00 2001 From: Bsian Date: Tue, 29 Oct 2019 17:43:26 +0000 Subject: [PATCH] Fix invalid date showing --- src/class/Util.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/class/Util.ts b/src/class/Util.ts index dae9f58..a86d9e5 100644 --- a/src/class/Util.ts +++ b/src/class/Util.ts @@ -199,7 +199,7 @@ export default class Util { .setFooter(this.client.user.username, this.client.user.avatarURL) .setTimestamp(); if (reason) embed.addField('Reason', reason || 'Not specified'); - if (type === 2) embed.addField('Lock Expiration', `${moment(date).format('dddd, MMMM Do YYYY, h:mm:ss A')}`); + if (type === 2) embed.addField('Lock Expiration', `${date ? moment(date).format('dddd, MMMM Do YYYY, h:mm:ss A') : 'Indefinitely'}`); // @ts-ignore this.client.createMessage('580950455581147146', { embed }); this.client.getDMChannel(userID).then((channel) => channel.createMessage({ embed })).catch();