I have a number of Slash and Context Menu commands that I would like to hide, unless the user holds certain permissions.
These permissions, I want to define by role (e.g, the 'Moderator' role).
The commands should only be visible for users who have that specific role.
I know that the commands can be maintained on a per guild status, in my instance, the bot only exists and only ever will exist in the context of a single guild - and the list of role IDs that need access are limited.
I know that changing the commands through the Integration tab in Discord - it is possible to effectively hide the commands from those who should not have access.
How can I do this at a code level, and by using a role?