[英]how i add a img that a user sent in a discord.py embed
我正在提出建議 discord 機器人,我想知道我是否可以添加用戶在 embed 上發布的圖像
就像是
embed.set_image(url=image_url)
image_url將是用戶添加到消息中的圖像。
您可以使用message.attachments
獲取郵件附件列表:
@bot.command()
async def send_image(ctx):
embed = discord.Embed(title="Your attached image")
if len(message.attachments):
embed.set_image(url=ctx.message.attachments[0].url)
await ctx.send(embed=embed)
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.