[英]Discord.py get message embed
How can I get the embed of a message to a variable with the ID of the message in discord.py?如何使用discord.py中的消息ID将消息嵌入到变量中? I get the message with
uzenet = await client.get_message(channel, id)
, but I don't know how to get it's embed.我通过
uzenet = await client.get_message(channel, id)
收到消息,但我不知道如何嵌入它。
To get the first Embed of your message, as you said that would be a dict(): embedFromMessage = uzenet.embeds[0]
要获得您的消息的第一个嵌入,正如您所说,这将是一个 dict():
embedFromMessage = uzenet.embeds[0]
To transfer the dict() into an discord.Embed object: embed = discord.Embed.from_data(embedFromMessage)
将 dict() 转换为 discord.Embed 对象:
embed = discord.Embed.from_data(embedFromMessage)
您可以使用uzenet.embeds
获取Embed
对象列表
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.