#slash command permission

1 messages · Page 1 of 1 (latest)

keen forge
#

How can I require give role permission for a slash command?

twilit brook
#

I don't believe that its built into Discord directly

#

However you can run your own checks inside of the command callback and use await ctx.respond to tell users if they are lacking the roles

cunning slate
#

In discord.
server settings -> integrations -> "your bot" -> the command you want to limit -> set everyone to false and add the other role to true

twilit brook
#

Oh yeah I forgot about that

keen tree
#

@commands.guild_only()

frozen vector
#

i'm talking to be only appear in guilds meanwhile in dms it doesn't appear

mellow pond
#

use decorator
@commands.has_permissions(manage_roles=True) before defing slash comand