Setting the default permission for commands built using discord.js builders.
I'm trying to use
<SlashCommandBuilder>.setDefaultMemberPermissions('0')
to disallow members to use that command by default, but it's not working. Could it be because this command is registered on a guild instead of globally? I'm using @discordjs/[email protected]
5 Replies
i think '0' will disallow everyone to use command but any one with perms can use it
Oh, so what would be the correct value?
So the Discord developer docs are also incorrect? https://discord.com/developers/docs/interactions/application-commands#application-command-permissions-object-example-of-editing-permissions
Discord Developer Portal
Discord Developer Portal — API Docs for Bots and Developers
Integrate your service with Discord — whether it's a bot or a game or whatever your wildest imagination can come up with.
Oh I thought you meant this https://discord.js.org/#/docs/builders/main/class/ContextMenuCommandBuilder?scrollTo=setDefaultMemberPermissions
Discord.js
Discord.js is a powerful node.js module that allows you to interact with the Discord API very easily. It takes a much more object-oriented approach than most other JS Discord libraries, making your bot's code significantly tidier and easier to comprehend.
But yeah makes sense since it's probably based off the first one
Tried it, still doesn't work (
@everyone
can still use the command by default)
Well on boot my bot is registering every command again
Probably not the smartest way to go about it
But yeah technically a command with the same name already existed
I see, okay so kicking the bot and re-adding it, then booting it up should work?
Got it, trying