【问题标题】:Discord.py - Return an embed from a functionDiscord.py - 从函数返回嵌入
【发布时间】:2021-04-17 09:02:23
【问题描述】:

当我从函数返回嵌入时,当我尝试从另一个函数(使用 await ctx.send(console_create())发送它时,它返回 <discord.embeds.Embed object at 0x00000250B37841F0>。 这是我的代码:

def console_create():
    embed=discord.Embed(title="```CONSOLE\n```", color=0xfd3030)
    embed.add_field(name="test", value="...")
    embed.set_footer(text="Ici s'affiche les messages d'erreurs...")
    return embed

我想我只是忘了在返回的行中添加一些明显的东西......

【问题讨论】:

    标签: discord.py


    【解决方案1】:
    await ctx.send(embed=console_create())
    

    多田。您只需要指定传递嵌入的位置

    【讨论】:

      猜你喜欢
      • 2021-02-22
      • 2021-04-01
      • 1970-01-01
      • 2015-07-20
      • 1970-01-01
      • 1970-01-01
      • 2011-03-31
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多