Fix setupall again

This commit is contained in:
Christopher Cookman 2024-05-16 21:21:55 -06:00
parent cdb86c0ad0
commit d993d8fc47
Signed by: ChrisChrome
GPG key ID: A023A26E42C33A42

View file

@ -948,8 +948,17 @@ discord.on("interactionCreate", async (interaction) => {
// get chunks from iem // New setup, we're pulling from wfos.json now
const chunks = chunkArray(iem, Math.ceil(iem.length / 50)); const chunks = [];
const chunkSize = 50;
const total = iem.length;
// wfos is object "wfo": {"location": "Text Name", "room": "roomname"}
for (let i = 0; i < total; i += chunkSize) {
chunks.push(iem.slice(i, i + chunkSize));
console.log(iem.slice(i, i + chunkSize))
}
chunks.forEach((chunk, index) => { chunks.forEach((chunk, index) => {
const categoryName = `Rooms ${index + 1}`; const categoryName = `Rooms ${index + 1}`;