1 回答
TA贡献1784条经验 获得超9个赞
您必须使用on_raw_reaction_add()
, 它返回一个RawReactionActionEvent
对象。您将能够获得message_id
并用于fetch_message
最终获得嵌入:
@bot.event
async def on_raw_reaction_add(payload):
channel = bot.get_channel(payload.channel_id)
msg = await channel.fetch_message(payload.message_id)
embed = msg.embeds[0]
emoji = payload.emoji
if user.bot:
return
if emoji == "emoji 1":
fixed = bot.get_channel(733722567449509958)
await fixed.send(embed=embed)
elif emoji == "emoji 2":
notBug = bot.get_channel(733722584801083502)
await notBug.send(embed=embed)
elif emoji == "emoji 3":
notFixed = bot.get_channel(733722600706146324)
await notFixed.send(embed=embed)
else:
return
注意:payload.emoji
返回 a discord.PartialEmoji
,将其与原始 unicode 进行比较可能不再有效。
添加回答
举报