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' ] } ]
10 Replies
d.js toolkit
d.js toolkit3d ago
- What's your exact discord.js npm list discord.js and node node -v version? - Not a discord.js issue? Check out #other-js-ts. - Consider reading #how-to-get-help to improve your question! - Explain what exactly your issue is. - Post the full error stack trace, not just the top part! - Show your code! - Issue solved? Press the button!
Zaden
ZadenOP3d ago
i guess, i have to wait a week before getting any res here
treble/luna
treble/luna3d ago
we are all volunteers be glad you get help at all log category
Zaden
ZadenOP3d ago
i left the workspace, talking on mobile but still i tried that. category has the permissions thing
treble/luna
treble/luna3d ago
the error seems to disagree
Zaden
ZadenOP3d ago
i think, I'll be able to provide more information tomorrow. Thank you.
Unknown User
Unknown User3d ago
Message Not Public
Sign In & Join Server To View
Zaden
ZadenOP3d ago
what do you mean by first question?
Unknown User
Unknown User3d ago
Message Not Public
Sign In & Join Server To View

Did you find this page helpful?