From 4e1d52178ff3fbc51e50f468060362b95d72fc02 Mon Sep 17 00:00:00 2001 From: ChrisChrome Date: Thu, 16 May 2024 21:08:44 -0600 Subject: [PATCH] Use WFOs for setupall --- testing/debug.js => debug.js | 4 ++-- index.js | 18 ++++++++++++++---- 2 files changed, 16 insertions(+), 6 deletions(-) rename testing/debug.js => debug.js (72%) diff --git a/testing/debug.js b/debug.js similarity index 72% rename from testing/debug.js rename to debug.js index 5df9b2f..7c7340b 100644 --- a/testing/debug.js +++ b/debug.js @@ -1,8 +1,8 @@ const Discord = require('discord.js'); const client = new Discord.Client({intents: ["Guilds"]}) -const config = require('../config.json'); +const config = require('./config.json'); -categories = ["1237806700879417416", "1237806701722337451", "1237806702473121853", "1237806703010123857"] +categories = ["1237807432311373895", "1237807432709963807", "1237807433678590023", "1237807434425434164"] client.once('ready', () => { console.log('Ready!'); diff --git a/index.js b/index.js index d742277..a96eb3f 100644 --- a/index.js +++ b/index.js @@ -946,12 +946,22 @@ discord.on("interactionCreate", async (interaction) => { // Create channels for all rooms const chunks = []; const chunkSize = 50; - const totalRooms = iem.length; - for (let i = 0; i < totalRooms; i += chunkSize) { - chunks.push(iem.slice(i, i + chunkSize)); + // const totalRooms = iem.length; + // for (let i = 0; i < totalRooms; i += chunkSize) { + // chunks.push(iem.slice(i, i + chunkSize)); + // } + + // New setup, we're pulling from wfos.json now + const wfoChunks = []; + const wfoChunkSize = 50; + const totalWFOs = wfos.length; + for (let i = 0; i < totalWFOs; i += wfoChunkSize) { + wfoChunks.push(wfos.slice(i, i + wfoChunkSize)); } - chunks.forEach((chunk, index) => { + + + wfoChunks.forEach((chunk, index) => { const categoryName = `Rooms ${index + 1}`; interaction.guild.channels.create({ name: categoryName,