I'm making a reaction roles channel where if you react with an emoji it gives you the corresponding role. I used this exact same code with my verification system and it worked perfectly. But for some reason when I react to the message with the corresponding emoji, I don't get the role, no tracebacks show up and I don't get a message in the console saying "gave a role to someone".
Code:
async def roles(ctx):
embed=discord.Embed(title="Reaction Roles", description="React with the corresponding emoji to get the role", color=0xff0000, timestamp=datetime.now())
embed.set_author(name="Official Gnag Discord", icon_url="https://upload.wikimedia.org/wikipedia/commons/thumb/2/2e/Exclamation_mark_red.png/50px-Exclamation_mark_red.png")
embed.add_field(name="⛓️", value="Role 1", inline=True)
embed.add_field(name="????", value="Role 2", inline=True)
embed.add_field(name="????", value="Role 3", inline=True)
embed.add_field(name="????️????", value="Role 4", inline=True)
embed.add_field(name="????", value="Role 5", inline=True)
embed.add_field(name="????", value="Role 6", inline=True)
embed.add_field(name="????", value="Role 7", inline=True)
embed.add_field(name="✔️", value="Role 8", inline=True)
embed.add_field(name="????", value="Role 9", inline=True)
embed.add_field(name="????", value="Role 10", inline=True)
embed.add_field(name="♂️", value="Role 11", inline=True)
embed.set_footer(text="Official Gnag Discord Bot Made By @Lukeee#6032")
msg = await ctx.send(embed=embed)
await msg.add_reaction('????')
await msg.add_reaction('✔️')
await msg.add_reaction('????')
await msg.add_reaction('????')
await msg.add_reaction('♂️')
await msg.add_reaction('⛓️')
await msg.add_reaction('????')
await msg.add_reaction('????')
await msg.add_reaction('????️????')
await msg.add_reaction('????')
await msg.add_reaction('????')
@bot.event
async def on_raw_reaction_add(payload):
ourMessageID = 819597141743763467
if ourMessageID == payload.message_id:
member = payload.member
guild = member.guild
emoji = payload.emoji.name
if emoji == '????':
mrole = discord.utils.get(guild.roles, name='Role 7')
await member.add_roles(mrole)
print ('gave a role to someone')