I just created a custom help commands, but i don't understand how can i display the required permissions to run the command and the command cooldown, Tried using this but doesn't work
async def cmdhelp(self, ctx, command):
params = []
for key, value in command.params.items():
if key not in ("self", "ctx"):
params.append(f"[{key}]" if "NoneType" in str(value) else f"<{key}>")
params = " ".join(params)
embed = discord.Embed(title=f"Help for {command}",
colour=ctx.author.colour)
embed.add_field(name="Description:", value=command.help, inline=False)
embed.add_field(name="Usage:", value=f"`{command} {params}`", inline=False)
if not command.aliases:
embed.add_field(name="Aliases:", value="None", inline=False)
else:
embed.add_field(name="Aliases:", value=", ".join(command.aliases))
embed.add_field(name="Permission Required:", value=f"{command.check}")
embed.add_field(name="Cooldown:", value=command.cooldown)
await ctx.send(embed=embed)
I tried to use commands.has_permissions()
It gives me this <function check.<locals>.decorator at 0x04FDADA8>
So I tried to do this code but it doesn't work
if commands.has_permissions() == "<function check.<locals>.decorator at 0x04FDABF8>":
embed.add_field(name="Permission Required:", value=f"None", inline=False)
else:
embed.add_field(name="Permission Required:", value=f"Unban", inline=False)
await ctx.send(embed=embed)