I really hate to ask for help, but I've tried searching for answers in here and on Google and couldn't find anything. So I'm making a button that gives you a role when you click it, and it does, but I also want it to remove the role if you already have the role (so basically have the bot check if that user has the role and remove it if they do when they interact with the button). I’ve tried interaction.used.remove_roles but didn’t really know what to do to check if they have the role. So if anyone can help, I would appreciate it very much.
@discord.ui.button(custom_id="male", style=discord.ButtonStyle.gray, emoji='')
async def male(self, button, interaction):
if interaction.channel.id == 1027780758699511908:
guild = bot.get_guild(1027417323331649556)
Male = guild.get_role(1028387057829163141)
await interaction.user.add_roles(Male)
#remove role part
await interaction.user.remove_roles(Male)
embed = discord.Embed(description="You have been given the **Male** role.", color=0x2f3136)
await interaction.response.send_message(embed=embed, ephemeral=True)

