Skip to content

Commit

Permalink
formatting!
Browse files Browse the repository at this point in the history
  • Loading branch information
Niceygy committed Nov 11, 2023
1 parent 018b6b0 commit 18af314
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/worker.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -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);

Expand Down

0 comments on commit 18af314

Please sign in to comment.