From d993d8fc478a50cf3acab2fb16853f7504d5ce09 Mon Sep 17 00:00:00 2001 From: ChrisChrome Date: Thu, 16 May 2024 21:21:55 -0600 Subject: [PATCH] Fix setupall again --- index.js | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/index.js b/index.js index ff1d8db..92ce934 100644 --- a/index.js +++ b/index.js @@ -948,8 +948,17 @@ discord.on("interactionCreate", async (interaction) => { - // get chunks from iem - const chunks = chunkArray(iem, Math.ceil(iem.length / 50)); + // New setup, we're pulling from wfos.json now + 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) => { const categoryName = `Rooms ${index + 1}`;