Application Command Permission Update Event
I am trying to get the type of permission in the data of the event.
Example:
data.permissions.type
This is returning as undefined
when I update a app command's user/roles/channel permissions
If you are confused, look at the type / ApplicationCommandPermissionType
in the link below
https://old.discordjs.dev/#/docs/discord.js/main/typedef/ApplicationCommandPermissions4 Replies
• What's your exact discord.js
npm list discord.js
and node node -v
version?
• Post the full error stack trace, not just the top part!
• Show your code!
• Explain what exactly your issue is.
• Not a discord.js issue? Check out #useful-servers.
This is the code in the event file
Output
Number
is coming from the following
same problem occurs when using data.permissions.permission
when console.log(data.permissions)
output is [ { type: 1, permission: true, id: '1047775679573409812' } ]
data.permissions
returns an array of objects. You want to access the type
property of the first object in the array
ok, ill try this
this works thank you. I just can't seem to understand arrays, ill look into them
understood