let pages = {}
let commandSections = await fs.readdirSync("./commands")
let pageNum = 1
await commandSections.forEach(async e => {
let sectionCommands = await fs.readdirSync(`./commands/${e}`)
let pageInfo = ''
await sectionCommands.forEach(async element => {
let desc = await client.commands.get(element.split(".")[0]).description
pageInfo += `${element.split(".")[0]} - ${desc}\n`
})
pages[pageNum] = {"name": e, "value": pageInfo}
pageNum++
})
^^ my code is up there, and as you can see there, i define pages as a dictionary. i then proceed to have a few forEach loops (to loop through the commands of a discord bot), which add key/value pairs to the dictionary. the problem is, whenever i try to access the dictionary, it returns as an empty dictionary ({}). when i console.log "pages" inside the forEach loop though, it returns as the proper thing. any ideas?