Slash Command Permissions

How do I do role based permissions with slash commands?
20 Replies
d.js docs
d.js docs2y ago
• 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.
Noby
Noby2y ago
You can filter through it on interactionCreate event You can give commands a permissions: […] property like that and then check for command.permissions and filter like that
larkx
larkx2y ago
Will that hide the command for roles that can't use it?
Noby
Noby2y ago
No
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
larkx
larkx2y ago
Not usefull, thats for permission based
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
larkx
larkx2y ago
I swear you used to be able to do user / role and it would grey out the command for those without the role I'll do that
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
larkx
larkx2y ago
Can I do the reverse of this and only allow 1 role to use it
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
larkx
larkx2y ago
update: it says 401 unauthorized when trying to make the api call to add the perms
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
larkx
larkx2y ago
is it not just my discord bot token?
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
larkx
larkx2y ago
How do I do that?
d.js docs
d.js docs2y ago
guide OAuth2: Getting started with OAuth2 read more
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
larkx
larkx2y ago
Oh So it's done through like a user? not the bot
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View