Zaden
Zaden
DIdiscord.js - Imagine ❄
Created by Zaden on 1/5/2025 in #djs-questions
Adding permissions
why this code isn't working?
permissionOverwrites: [
{
id: interaction.guild?.roles.everyone.id,
deny: category.permissions.deny?.map(permission => PermissionFlagsBits[permission as keyof typeof PermissionFlagsBits]),
allow: category.permissions.allow?.map(permission => PermissionFlagsBits[permission as keyof typeof PermissionFlagsBits])
}
],
permissionOverwrites: [
{
id: interaction.guild?.roles.everyone.id,
deny: category.permissions.deny?.map(permission => PermissionFlagsBits[permission as keyof typeof PermissionFlagsBits]),
allow: category.permissions.allow?.map(permission => PermissionFlagsBits[permission as keyof typeof PermissionFlagsBits])
}
],
Error executing the build command: TypeError: Cannot read properties of undefined (reading 'map')
at createCategories (file:///C:/Users/thega/OneDrive/Desktop/Projects/axiom%20bot/dist/actions/guild.js:35:56)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async createServer (file:///C:/Users/thega/OneDrive/Desktop/Projects/axiom%20bot/dist/actions/guild.js:60:5)
at async Object.execute (file:///C:/Users/thega/OneDrive/Desktop/Projects/axiom%20bot/dist/commands/build.js:108:13)
at async Object.execute (file:///C:/Users/thega/OneDrive/Desktop/Projects/axiom%20bot/dist/util/registerEvents.js:28:17)
Error executing the build command: TypeError: Cannot read properties of undefined (reading 'map')
at createCategories (file:///C:/Users/thega/OneDrive/Desktop/Projects/axiom%20bot/dist/actions/guild.js:35:56)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async createServer (file:///C:/Users/thega/OneDrive/Desktop/Projects/axiom%20bot/dist/actions/guild.js:60:5)
at async Object.execute (file:///C:/Users/thega/OneDrive/Desktop/Projects/axiom%20bot/dist/commands/build.js:108:13)
at async Object.execute (file:///C:/Users/thega/OneDrive/Desktop/Projects/axiom%20bot/dist/util/registerEvents.js:28:17)
data being provided:
[ { allow: [ 'ViewChannel' ] } ]
[ { allow: [ 'ViewChannel' ] } ]
13 replies