本文介紹了Discord.py 獲取消息嵌入的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!
問題描述
如何將消息嵌入到帶有 discord.py 中消息 ID 的變量中?我通過 uzenet = await client.get_message(channel, id)
收到消息,但我不知道如何嵌入.
How can I get the embed of a message to a variable with the ID of the message in discord.py?
I get the message with uzenet = await client.get_message(channel, id)
, but I don't know how to get it's embed.
推薦答案
要獲得您的消息的第一個嵌入,正如您所說,這將是一個 dict():embedFromMessage = uzenet.embeds[0]
To get the first Embed of your message, as you said that would be a dict():
embedFromMessage = uzenet.embeds[0]
要將 dict() 轉換為 discord.Embed 對象:embed = discord.Embed.from_data(embedFromMessage)
To transfer the dict() into an discord.Embed object:
embed = discord.Embed.from_data(embedFromMessage)
這篇關于Discord.py 獲取消息嵌入的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!
【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!