Is there a way to allow certain roles to view commands? Discord.py

Viewed 67

When you creating help command, using discord.py is there any way to allow certain roles to view certain Categories ?

Or do you have to create seperate help command ?

In case the explenation does not satisify Here is an example.

Users with the member role can only view commands which is for members, but a higher role such as moderators can view member's commands and moderator commands.

1 Answers

The only way is you have to create a custom help command and create two embeds where one has commands can be viewed by everyone and other has commands viewed by admins and create an if statement and check whether the user has admin perm by using

if ctx.author.guild_permissions.administrator:
   await ctx.send(embed=mod_view_embed)
else:
   await ctx.send(embed=everyone_view_embed)
Related