Skip to content

Are you able to restrict the visibility of slash / application commands based on permission level within the bot itself? #9859

Answered by Zalk0
Immortql asked this question in Q&A
Discussion options

You must be logged in to vote

Hey,
I think you're looking for this https://discordpy.readthedocs.io/en/stable/interactions/api.html?highlight=default_permissions#discord.app_commands.default_permissions

@app_commands.default_permissions(ban_members=True)

This decorator changes the default permission needed for seeing/using the command Discord side whereas has_permissions does a check on the bot side to be sure the user running the command has the permissions.

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@Immortql
Comment options

Answer selected by Immortql
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants