4 回答

TA貢獻1893條經(jīng)驗 獲得超10個贊
Messagable.send返回它發(fā)送的消息。因此,您可以使用該消息對象向其添加反應(yīng)。簡單地說,您必須使用變量來定義機器人發(fā)送的消息。
embed = discord.Embed(title="Bug report")
embed.add_field(name="Name", value="value")
msg = await adminBug.send(embed=embed)
您可以使用msg添加對該特定消息的反應(yīng)
await msg.add_reaction("??")
閱讀 discord.py 文檔以獲取詳細信息。
Message.add_reaction

TA貢獻1806條經(jīng)驗 獲得超8個贊
discord.py 文檔有一個關(guān)于添加反應(yīng)的常見問題解答帖子,它有多個示例和深入的描述,此外還Messageable.send
返回發(fā)送的消息,以便您可以使用Message.add_reaction
它。https://discordpy.readthedocs.io/en/neo-docs/faq.html#how-can-i-add-a-reaction-to-a-message

TA貢獻1869條經(jīng)驗 獲得超4個贊
您需要將嵌入保存為變量,這樣您就可以添加反應(yīng)。
message = await adminBug.send(embed=embed) # save embed as "message"
await message.add_reaction('xxx') # add reaction to "message"

TA貢獻1946條經(jīng)驗 獲得超4個贊
我不確定,因為我使用的是 nextcord(并且有效),但我認為這可行:
@bot.command
async def testembed(ctx):
embed = discord.Embed(title='Test !', description='This is a test embed !')
msg = await ctx.send("", embed=embed)
msg = msg.fetch() # Notice this line ! It's important !
await msg.add_reaction('emoji_id')
添加回答
舉報