Managing command access depending on roles

Hello ! PaimonWave I would ask what's the best way to give (or not) access to a command, depending on a specific roles. I know this ins't very "many-server" friendly. But since my actual bot is just for a test server, this is ok ! Why do I want to do that ? Mainly to allow that for example when a user with an Intern role do !help this show only the commands they have acces as an Intern, and thus when another user with an Employee role do the same, !help will show all commands they have acces as an Employee (and also as an Inter since the employee is supposed to have more permissions). The only idea I can think of is to have either : A list for each role with special permissions containing all accessible commands. Or, for each command, a list of the IDs of the roles that have access to it What is the best solution and are there others ? By "best", I mean, something easily maintainable node version : 16.15.0
5 Replies
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
Parogo_72
Parogo_722y ago
Just use slashcommands, you can manage who can see each command Else, if you want to stick with message commands. Check message.member.roles.cache
Akihiro
AkihiroOP2y ago
Yeah, I don't like slash commands, I rather like the old way xD message.member.roles.cache Yeah, this will give me all roles of the given user but how do I handle permission management next ? <:AlbedoMath_Wilock:799116606168629248> Which method do I choose? Do I store for each command the list of roles that have access to it?
Parogo_72
Parogo_722y ago
The latter basically
Akihiro
AkihiroOP2y ago
<:KleeOK_GreenTea:782407596778061835> Alright thank you for your help ! I'll close the thread in about 30 minutes if someone want to add something
Want results from more Discord servers?
Add your server