【问题标题】:Discord.py bot will not react to it's own message. How can i do this?Discord.py 机器人不会对自己的消息做出反应。我怎样才能做到这一点?
【发布时间】:2021-08-04 03:04:54
【问题描述】:

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

@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, "????")

【问题讨论】:

    标签: python discord discord.py


    【解决方案1】:

    您可以通过使用来实现此目的

    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("?")
    

    【讨论】:

      猜你喜欢
      • 2021-08-29
      • 1970-01-01
      • 2020-11-07
      • 1970-01-01
      • 2022-11-09
      • 2020-07-29
      • 2018-12-15
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多