command.permissions.has() always returns true

When using slashCommand.permissions.has({ permissionId: interaction.user.id }), it seems to always return true. Even though the user doesn't have access to that specific command.
4 Replies
d.js toolkit
d.js toolkit13mo 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! - Marked as resolved by OP
d.js docs
d.js docs13mo ago
interface PermissionResolvable Data that can be resolved to give a permission number. This can be: (more...)
xx_lavaboy_xx123
xx_lavaboy_xx12313mo ago
oh wait ignroe that
SirNuny
SirNunyOP13mo ago
await client.guilds.cache.get(guildId).commands.fetch().then(commands => {
commands.forEach(slashCommand => {
...
await client.guilds.cache.get(guildId).commands.fetch().then(commands => {
commands.forEach(slashCommand => {
...
You're right, when using await it doesn't return true anymore. But now it returns false at every command. Should the permissionId be the ID of a role which has permissions to the command? Oh yeah I'm just checking whether the user has permissions to that specific command I was trying to use this in a help command, so the user only gets to see commands he/she can use Well that's propably going to take too much time to process, so I'll try it another way. Thank you for the help
Want results from more Discord servers?
Add your server