I've been working on coding my own discord bot in python and I've been trying to implement reacting to specific messages in a certain way will you give you a certain role. I figured out how to get this to work custom discord emojis, but I'm struggling to get it to work with native discord emojis. I know I that i should try be using the emoji's unicode somehow but i just can't figure it out
#roles for hemisphere and native fruit
#first part - emoji id, second part - role id
#CUSTOM EMOJIS
hemisphere = {693662576936222811:[693663054788821092],
693662585953714256:[693663114914168913]
}
#NATIVE DISCORD EMOJIS
native_fruit = {693711698082660427:[693711520953270293],
693711724024430633:[693711530197516289],
693711811312353330:[693711572312391721],
693711739744813056:[693711538623742042],
693711786582474752:[693711553257799720]
}
hemisphere_id=693914783979667506
native_fruit_id=693914786773205103
#add roles
@bot.event
async def on_raw_reaction_add(reaction):
if reaction.user_id==bot.user.id:
return
if not ((reaction.emoji.id in hemisphere) or (reaction.emoji.id in native_fruit)):
return
guild = await bot.fetch_guild(reaction.guild_id)
user = await guild.fetch_member(reaction.user_id)
#CUSTOM EMOJIS
if reaction.message_id == hemisphere_id:
emojiid = hemisphere.get(reaction.emoji.id)
id =emojiid[0]
await user.add_roles(guild.get_role(id))
#NATIVE DISCORD EMOJIS
elif reaction.message_id == native_fruit_id:
emojiid = native_fruit.get(reaction.emoji.id)
id = emojiid[0]
await user.add_roles(guild.get_role(id))
else:
return
I'm new to python in general so I'm having trouble figuring out how to move forward