python discord get user reaction to a bot message code example
Example 1: discord bot python on reaction
@client.event
async def on_reaction_add(reaction, user):
# Steals your reaction by removing the original and adding it's own
if not user.bot and reaction.message.content == "try me":
await reaction.remove(user)
await reaction.message.add_reaction(reaction.emoji)
Example 2: python discord action when someone reacts to message
@bot.event
async def on_reaction_add(reaction, user):
embed = reaction.embeds[0]
emoji = reaction.emoji
if user.bot:
return
if emoji == "emoji 1":
fixed_channel = bot.get_channel(channel_id)
await fixed_channel.send(embed=embed)
elif emoji == "emoji 2":
#do stuff
elif emoji == "emoji 3":
#do stuff
else:
return