如何在此命令中添加角色层次结构

How to add role hierarchy in this command

所以基本上我想在此命令中添加角色层次结构我正在使用 discord.py 2.0 我检查了文档但我无法弄清楚如何做到这一点,请帮助我我知道这是一个愚蠢的问题

@app_commands.command(name="ban", description="Ban A User")
    @app_commands.checks.has_permissions(ban_members=True)
    async def MC(self, interaction: discord.Interaction, user: discord.Member, reason: str) -> None:
        await interaction.response.defer(ephemeral=False, thinking=True)

        if reason == None:
            embed = discord.Embed(color=0x55a7f7, timestamp=datetime.datetime.utcnow())
            embed.set_footer(text="If you think this is unfair Join Our Ban appeal Server", icon_url=f"{interaction.user.avatar}")
            embed.add_field(name='Banned', value= f"{user} was Banned \n Reason :- **Not Provided** ") 
            await user.send(embed=embed)
            await user.ban()
            await interaction.followup.send(embed=embed)

存在用于检查角色层次结构的比较。成员排名靠前,支持根据在公会中的指数进行比较。

if interaction.user.top_role <= user.top_role:
    # the person issuing the command is less than or equal to the person getting banned
    await interaction.followup.send('Hey, you are not allowed to do this.')
# ban them