E
E
EcoTry2022-01-20 18:06:32
Python
EcoTry, 2022-01-20 18:06:32

Doesn't issue a member, and doesn't issue a role for it. What to do?

async def on_raw_reaction_add(payload):
    message_id = payload.message_id
    if message_id == 933717065385279529:
        guild_id = payload.guild_id
        guild = discord.utils.find(lambda g: g.id == guild_id, client.guilds)

        if payload.emoji.name == '':
            role = discord.utils.get(guild.roles, name="Counter Strike")
            print("cs")
        elif payload.emoji.name == '':
            role = discord.utils.get(guild.roles, id="933728711025500170")
        elif payload.emoji.name == '':
            role = discord.utils.get(guild.roles, id="933728711025500170")
        elif payload.emoji.name == '':
            role = discord.utils.get(guild.roles, id="933728711025500170")
        elif payload.emoji.name == '':
            role = discord.utils.get(guild.roles, id="933728711025500170")
        elif payload.emoji.name == '':
            role = discord.utils.get(guild.roles, id="933728711025500170")
        elif payload.emoji.name == '':
            role = discord.utils.get(guild.roles, id="933728711025500170")
        elif payload.emoji.name == '':
            role = discord.utils.get(guild.roles, id="933728711025500170")
        elif payload.emoji.name == '':
            role = discord.utils.get(guild.roles, id="933728711025500170")
        elif payload.emoji.name == '':
            role = discord.utils.get(guild.roles, id="933728711025500170")
        else:
            role = discord.utils.get(guild.role, name=payload.emoji.name)

        if role is not None:


            member = discord.utils.find(lambda m : m.id == payload.user_id, guild.members)


            if member is not None:
                await member.add_roles(role)
                print("done")
            else:
                print("Member not found")
        else:
            print("Role not found")

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question