Use WFOs for setupall

This commit is contained in:
Christopher Cookman 2024-05-16 21:08:44 -06:00
parent 403ee86e4d
commit 4e1d52178f
Signed by: ChrisChrome
GPG key ID: A023A26E42C33A42
2 changed files with 16 additions and 6 deletions

View file

@ -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!');

View file

@ -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,