From 2f0ebe55554e16763007a5065631355492764a4b Mon Sep 17 00:00:00 2001 From: Niceygy Date: Sat, 11 Nov 2023 15:23:59 +0000 Subject: [PATCH] Refactor message generation in worker.js --- src/worker.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/worker.js b/src/worker.js index 0f4df4d..94e1652 100644 --- a/src/worker.js +++ b/src/worker.js @@ -17,8 +17,7 @@ async function cron(env) { } repos.sort((a, b) => b.count - a.count); // Sort repos by count in descending order let currentDate = new Date(); - var message = "# Downloads as of " + currentDate.toUTCString() + "\n\n"; - var message =+ repos.map(repo => `Repo: ${repo.name}, Count: ${repo.count}\n`).join(""); + var message = "# Downloads as of " + currentDate.toUTCString() + "\n\n" + repos.map(repo => `Repo: ${repo.name}, Count: ${repo.count}\n`).join(""); console.log("Message generated. Sending to Discord..."); console.log(message);