【问题标题】:Discord.py get message embedDiscord.py 获取消息嵌入
【发布时间】:2019-01-12 06:40:07
【问题描述】:

如何将消息嵌入到带有 discord.py 中消息 ID 的变量中? 我收到了uzenet = await client.get_message(channel, id) 的消息,但我不知道如何嵌入。

【问题讨论】:

    标签: python python-3.x discord discord.py


    【解决方案1】:

    如您所说,要获得您的消息的第一个嵌入,这将是一个 dict(): embedFromMessage = uzenet.embeds[0]

    要将 dict() 转换为 discord.Embed 对象: embed = discord.Embed.from_data(embedFromMessage)

    【讨论】:

    • 我知道这个答案已经很老了,但现在你不需要 from_data 或 from_dict 函数。 message.embeds[0] 是一个 discord.Embed 对象
    【解决方案2】:

    您可以使用uzenet.embeds 获取Embed 对象的列表

    【讨论】:

    • 谢谢,但它返回 dict 对象。
    • 或许可以试试uzenet.attachments?
    猜你喜欢
    • 2020-08-22
    • 1970-01-01
    • 2021-02-13
    • 2020-09-08
    • 2020-03-17
    • 1970-01-01
    • 2019-04-21
    • 1970-01-01
    • 2021-03-04
    相关资源
    最近更新 更多