Any way to check if the bot has sufficient perms to execute a command with SlashCommandBuilder()?
setDefaultMemberPermissions() exists but it only checks the executing user's perms. I also want to add perm checks for my bot.
15 Replies
- 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!wdym?
discord doesnt know what your command does
but I can pass the flags, no?
so also doesnt know which permissions it needs
no
you can set member permissions yes
Not possible
you have to do checks when the command is ran
im curious why such a simple method does not exist on the builder
because discord doesnt provide it
what do you mean?
exactly what i said
it's in
interaction.guild.members.me.permissions
yes indeed. a slash command builder is in no way related to that
a slash command builder creates data to send to discord
bot permissions arent part of that data
it does not have to be in the slash command data that we send to Discord. it's a check that the lib can do when the command is executed, no?
no
thats up to you to do
djs is an api wrapper
not a framework
I see. thanks