When you declare a command, you know how there are those @commands.has_permissions()
things right? I'm trying to make a command that shows the checks for a command, but I'm not sure how to continue. Here is my code so far:
@commands.command(aliases=['sp'])
async def showperms(self, ctx, *, command_name):
"""Shows the permissions needed for a command"""
com = self.bot.get_command(command_name)
print(com.checks)
When I do this for a command, I get this output:
[<function bot_has_permissions.<locals>.predicate at 0x7fd64b5ff940>, <function has_permissions.<locals>.predicate at 0x7fd64b5ff550>]
I believe it uses Discord's permission integers, but pretty much no one knows how to use those. I'm not sure how I can 'translate' this into something I can send, such as manage_messages
or administrator.
The command I used to test has these checks btw:
@commands.has_permissions(manage_channels=True)
@commands.bot_has_permissions(manage_channels=True)
Thanks!!