如何在嵌入消息中使用from_dict函数?

时间:2019-08-23 02:34:30

标签: python discord discord.py discord.py-rewrite

我想发出命令!say [json]发送嵌入消息。我在discordpy.readthedocs中找到了from_dict函数。

现在,我不知道如何使用它。希望对您有所帮助。

对不起,Google翻译:3

1 个答案:

答案 0 :(得分:0)

谈论this吗?

所以这是从字典中嵌入的,下面是一个示例:

@bot.command()
async def embed(ctx, *,title):
    e=discord.Embed.from_dict({
        "title":f"{title}",
        "description":"This is the embed description"
    })
    await ctx.send(embed=e)

查看该图片中的输出

here is the output