2021-03-29

Discord Python Reaction Role

I want that my bot add the role "User" to a user who react with a heart. But it doesn't work.
My code:

@client.event
async def on_reaction_add(reaction, user):
    if reaction.emoji == "❤️":
        user = discord.utils.get(user.server.roles, name="User")
        await user.add_roles(user)

I hope you can help me :)



from Recent Questions - Stack Overflow https://ift.tt/31vc8zj
https://ift.tt/eA8V8J

No comments:

Post a Comment