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

Comments

Popular posts from this blog

Today Walkin 14th-Sept

Hibernate Search - Elasticsearch with JSON manipulation

Spring Elasticsearch Operations