···88 throw new Error("SHEET_ENDPOINT environment variable is not set");
99}
10101111-const response = await fetch(endpoint);
1212-const { data } = await response.json();
1313-1411// @ts-ignore Deno.cron is unstable, run with --unstable-cron flag
1512Deno.cron("QOTD", Deno.env.get("CRON_STRING"), async () => {
1613 // Open KV and get last index
···2219 );
2320 const result = await kv.get<number>(["lastIndex"]);
2421 let index = result.value ?? 0;
2222+2323+ const response = await fetch(endpoint);
2424+ const { data } = await response.json();
25252626 await sendDiscordNotification(data[index].question);
2727 console.log(`Cron: posted question of index ${index} to Discord.`);