this is a snippet of code from an antispam bot, I want the bot to detect if the user has already been unmuted and for some reason it does not detect that the user has the role "muted", it only detects the role @everyone. Does anyone know why?
async def unmute(ctx, member: discord.Member):
mutedRole = discord.utils.get(ctx.guild.roles, name = "Muted")
embedUnmuted = discord.Embed(title =":white_check_mark: Unmute", description = f"{member.mention} is not muted",color = discord.Color.green())
print(member.roles)
if mutedRole in member.roles:
await member.remove_roles(mutedRole)
await ctx.send(embed=embedUnmuted)
else:
print("The user was already unmuted")