繁体   English   中英

Discord.py 机器人不会对自己的消息做出反应。 我怎样才能做到这一点?

[英]Discord.py bot will not react to it's own message. How can i do this?

我试图让我的机器人用表情符号对其自己的嵌入做出反应,我已经写出了代码,但机器人不会对表情符号做出反应。 我怎样才能解决这个问题? 谢谢

@bot.command()
async def emoji(ctx):
  embed=discord.Embed(title="Test", description="Test", color=0x00FFFF)
  await ctx.send(embed=embed)
  msg = await bot.send_message(ctx.message.channel,embed=embed)
  await bot.add_reaction(msg, "😮")

您可以通过使用来实现这一点

await botMessage.add_reaction("😮")

例如。

@bot.command()
async def emoji(ctx):
  embed = discord.Embed(title = "Test", description = "Test", color = 0x00FFFF)
  msg = await ctx.send(embed = embed)
  await msg.add_reaction("😮")

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM