From d248923f1d961809b787bb93074f23dc5d724527 Mon Sep 17 00:00:00 2001 From: Wizzard Date: Mon, 5 Feb 2024 17:09:55 -0500 Subject: [PATCH] Add timestamp --- main.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/main.js b/main.js index c585b62..fd0430f 100644 --- a/main.js +++ b/main.js @@ -16,8 +16,11 @@ client.on('messageCreate', async message => { if (message.channel.id === SOURCE_CHANNEL_ID) { if (message.author.id === client.user.id) return; - // Add the new message to the queue - messageQueue.push(`<@${message.author.id}> / **${message.author.tag}**: ${message.content}`); + const timestamp = new Date(message.createdTimestamp).toISOString(); + + const formattedMessage = `<@${message.author.id}> / **${message.author.tag}**: ${message.content} \`${timestamp}\``; + + messageQueue.push(formattedMessage); } });