Slash Commands Global Permissions #3512
Unanswered
vertex-admin
asked this question in
API Feature Requests & Ideas
Replies: 1 comment 2 replies
-
i) Set DefaultPermission to false when creating your slash command This is not the only ways to prevent slash commands from being used in DMs. You can just check the raw interaction object to see if it contains a guild_id, if it doesn't, it probably got used in DMs. (some libraries also have methods to check if the command is used in a dm. DiscordJS has |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Description
We need a "GuildOnly" option for global slash commands, which would disable global slash commands from being used in DM channels.
Why This is Needed
Many developers want to be able to disable global slash commands in DM channels, but keep them open for @everyone in guilds. Currently, if you want achieve this, you have to:
i) Set DefaultPermission to false when creating your slash command
ii) Loop over all of your guilds and edit the command permissions to enable it for the @everyone role
There needs to be an easier way to do this, because you get ratelimited when doing the above. A "GuildOnly" option when creating a slash command would make life so much easier and decrease API traffic by tons from people who are trying to do this.
Beta Was this translation helpful? Give feedback.
All reactions