How do I get nextcord to check if the user is banning another admin?

259 Views Asked by At

I'm making a discord bot with nextcord and I want to make the moderation commands check if the user is banning another administrator.

Kick command. My ban command is similar

@bot.command()
    @commands.has_permissions(administrator=True)
    async def kick(self, ctx, member: nextcord.Member, *, reason=None):
        if member == ctx.author:
            await ctx.send(f"You can't kick yourself {member.mention}")
            return

        if member == ctx.guild.owner:
            await ctx.send(f"You can't kick the owner! {ctx.author}")
            return

        await member.kick(reason=reason)

        if reason == None:
            ctx.send(f"{member.mention} has been banned!")
        else:
            ctx.send(f"{member.mention} has been banned for {reason}")

0

There are 0 best solutions below