i'm working on a bot for my discord channel and i'm learning python while doing it and i want to give role when a user adds reaction the code i came up with is this
@client.event
async def on_reaction_add(reaction, user):
ChID = '487165969903517696'
if reaction.message != ChID:
return;
if user.reaction.emoji == "????":
CSGO = discord.utils.get(user.server.roles, name="CSGO_P")
await client.add_roles(user, CSGO)
but it doesn't work what i basically want is there is a message that i sent in a channel with this Channel ID: 487165969903517696 and then my bot sends a embed message with "role=emoji" content. like CSGO=:runner: and then adds those reaction emojis to its message (embed) now i want to say if a user clicks one of those emojis the bot must give him/her a role like CSGO_P
By The Way i came up with an on_message event at first and it was working fine but i thought it's more User Friendly if they add reaction instead of typing for example !CSGO and i've just started python ( 2days ago )