簡體   English   中英

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

[英]How to use the from_dict function in Embed messages?

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

現在,我不知道如何使用它。 希望對您有所幫助。

對不起,Google翻譯:3

談論這個

因此,這是從字典中嵌入的,下面是一個示例:

@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)

查看該圖像中的輸出

這是輸出

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM