From 18af3143fa7bc940f77b705e2a0ea20c3104f1a7 Mon Sep 17 00:00:00 2001 From: Niceygy Date: Sat, 11 Nov 2023 15:22:03 +0000 Subject: [PATCH] formatting! --- src/worker.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/worker.js b/src/worker.js index e6a4d15..0f4df4d 100644 --- a/src/worker.js +++ b/src/worker.js @@ -3,6 +3,7 @@ async function cron(env) { const KV = env.KV; const webhookURL = env.url; var repos = []; + const list = await KV.list(); console.log("Key list aquired"); for (const { name, expiration } of list.keys) { @@ -15,7 +16,9 @@ async function cron(env) { } } repos.sort((a, b) => b.count - a.count); // Sort repos by count in descending order - var message = repos.map(repo => `Repo: ${repo.name}, Count: ${repo.count}\n`).join(""); + 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(""); console.log("Message generated. Sending to Discord..."); console.log(message);