So I want the bot to auto assign roles when a user has reacted to a message with a specific emoji. But my code does not work. How can I fix this????
@client.event
async def on_raw_reaction_add(payload):
messgae_id = payload.message_id
if messgae_id == "759765065380659261":
user = payload.user_id
for roles in user.roles:
if roles in DefaultRoles:
return
if payload.emoji.name == "smiling_imp":
role = discord.utils.get(user.server.roles, name = "Demon")
await user.add_role(user, role)