Slash Command Permissions

How do I do role based permissions with slash commands?
20 Replies
d.js docs
d.js docs3y 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
noby3y 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
larkxOP3y ago
Will that hide the command for roles that can't use it?
noby
noby3y ago
No
Unknown User
Unknown User3y ago
Message Not Public
Sign In & Join Server To View
larkx
larkxOP3y ago
Not usefull, thats for permission based
Unknown User
Unknown User3y ago
Message Not Public
Sign In & Join Server To View
larkx
larkxOP3y 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 User3y ago
Message Not Public
Sign In & Join Server To View
larkx
larkxOP3y ago
Can I do the reverse of this and only allow 1 role to use it
Unknown User
Unknown User3y ago
Message Not Public
Sign In & Join Server To View
larkx
larkxOP3y ago
update: it says 401 unauthorized when trying to make the api call to add the perms
Unknown User
Unknown User3y ago
Message Not Public
Sign In & Join Server To View
larkx
larkxOP3y ago
is it not just my discord bot token?
Unknown User
Unknown User3y ago
Message Not Public
Sign In & Join Server To View
larkx
larkxOP3y ago
How do I do that?
d.js docs
d.js docs3y ago
guide OAuth2: Getting started with OAuth2 read more
Unknown User
Unknown User3y ago
Message Not Public
Sign In & Join Server To View
larkx
larkxOP3y ago
Oh So it's done through like a user? not the bot
Unknown User
Unknown User3y ago
Message Not Public
Sign In & Join Server To View
Want results from more Discord servers?
Add your server