【问题标题】:Discord.py Rewrite <discord.embeds.Embed object at 0x108778288>Discord.py 重写 <discord.embeds.Embed object at 0x108778288>
【发布时间】:2019-11-17 11:34:21
【问题描述】:

一年后我重新访问 discord.py,发现 async 显然不可用,现在我正在使用 rewrite 并且不知道我在做什么。我正在尝试发送一个简单的嵌入,但机器人却说:

'<discord.embeds.Embed object at 0x108778288>'

这是我的代码:

@bot.command(pass_context=True)
async def help(ctx):
    aiuto = discord.Embed(title="Help", description="being helpful")
    await ctx.send(aiuto)

【问题讨论】:

  • 出错了。机器人说

标签: python discord discord.py-rewrite


【解决方案1】:

答案吧: 等待 ctx.send(embed=aiuto)

【讨论】:

    【解决方案2】:

    您现在可以将embed kwarg 传递给消息,

    await ctx.send(embed = aiuto)
    

    另外,在 discord.py rewrite 中你不需要将pass_context 传递给bot.command@bot.command 也有效

    【讨论】:

      猜你喜欢
      • 2020-07-28
      • 1970-01-01
      • 2020-05-31
      • 2020-07-07
      • 2020-12-13
      • 2014-06-17
      • 2021-06-16
      • 2018-04-22
      • 2020-10-19
      相关资源
      最近更新 更多