簡體   English   中英

有沒有辦法嵌入這個 discord 消息 discord 機器人 python

[英]Is there a way to embed this discord message discord bot python

我一直在努力嵌入這條消息,它目前從 python 項目的路徑中獲取圖像並發送它們,但我想像這樣嵌入它們:

標題是圖像:描述是享受! 並且彩色側欄為紅色

圖像示例

當前代碼:


@client.command()
async def image(channel):
    file = random.choice(files)
    await channel.send(file=discord.File(file))

在簡單地詢問要做什么之前,您需要閱讀有關嵌入的更多信息。

@client.command()
async def image(channel):
    file = random.choice(files)
    embed = discord.Embed(title="", description="Enjoy!", color=discord.Color.red())
    embed.set_image(url=file)
    await channel.send(embed=embed)

暫無
暫無

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

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