I've started to create a bot for my discord, trying to add a role after a user's reaction, but I still have a 403 forbidden (error code 50013): Missing permission when I've already put in the right permissions (8) to the bot.
@client.event
async def on_raw_reaction_add(payload):
message_id = payload.message_id
if message_id == 706945439945195551:
guild_id = payload.guild_id
guild = discord.utils.find(lambda g : g.id == guild_id, client.guilds)
if payload.emoji.name == 'montmo':
role = discord.utils.get(guild.roles, name='membre')
Traceback (most recent call last):
File "D:\ProgramData\Python\lib\site-packages\discord\client.py", line 312, in _run_event
await coro(*args, **kwargs)
File "c:/Users/bntth/Documents/Python/Projets/Bot discord/bot_elogic.py", line 47, in on_raw_reaction_add
await member.add_roles(role)
File "D:\ProgramData\Python\lib\site-packages\discord\member.py", line 641, in add_roles
await req(guild_id, user_id, role.id, reason=reason)
File "D:\ProgramData\Python\lib\site-packages\discord\http.py", line 221, in request
raise Forbidden(r, data)
discord.errors.Forbidden: 403 Forbidden (error code: 50013): Missing Permissions
Do you have any idea what might be causing this mistake? Did I forget something in the configuration or the code? Thank you in advance for your help