[Python] How can i check if a user has a specific role

Discussão em 'Python' iniciado por Stack, Junho 17, 2025.

  1. Stack

    Stack Membro Participativo

    role7 = discord.utils.get(guild.roles, name="Moderator")

    if role7 in user.roles:
    await ctx.send(...)
    else:
    await ctx.send(...)


    I have this Code and i cant figure out how to check if a user has a role. I looked up on the Internet but it isnt working. i also tried Member.roles. Can someone help me?

    Continue reading...

Compartilhe esta Página