Md Shahriyar Alam
If you have created a slash command now you want to make it restricted to specific channel, role or permission. You can do that using the built in permission management provided by custom slash commands bot
To manage permission of a command, first go to commands page and edit the command you want to manage permission.
Then in the command you will be able to see
Hooks. Hooks are made for a lot of cool stuff, but we can manage permission from here
All the codes specified below will be used in pre hook
You can require one or more permissions to be needed to run a command, For that you have to use the
require_permission Programmed variable
In the code above we have required the
administrator permission to must have in order to run the command you are editing.
You can also require multiple permissions
And all the possible permissions that are available
To lock a command on a specific channel you can use the
banned_channels. Allowed channel will allow a command on a specific channel. And banned channel will ban a command on a specific channel and allow on other channels
allowed_channels(channel_id, channel_id2) banned_channels(channel_id, channel_id2)
Use whatever suits your command's use case. You can put as many channel id you want to allow or ban.
You can use the
banned_roles in the same way as channels, just put the role ids.
you can find role id and channel id on the sidebar if you are using desktop and on the bottom if you are using phone
If you still need any kind of help, have a suggestion for us or having a question in mind? Feel free to reach us out.Join support server