Python 在嵌入到Discord.py中时将本地文件用作set_缩略图
我想发布一个带有缩略图的嵌入,在我的电脑上有一个本地文件。 每当我尝试运行此代码时,图像都会发送到嵌入的外部Python 在嵌入到Discord.py中时将本地文件用作set_缩略图,python,image,discord,discord.py,embed,Python,Image,Discord,Discord.py,Embed,我想发布一个带有缩略图的嵌入,在我的电脑上有一个本地文件。 每当我尝试运行此代码时,图像都会发送到嵌入的外部 embedVar=discord.Embed(title=“title”, description=“desc.”, 颜色=0X19A6FF) file=discord.file(“file\u location/file.png”,filename=“image.png”) embedVar.set_缩略图(url=“attachment://file_location/file.pn
embedVar=discord.Embed(title=“title”,
description=“desc.”,
颜色=0X19A6FF)
file=discord.file(“file\u location/file.png”,filename=“image.png”)
embedVar.set_缩略图(url=“attachment://file_location/file.png")
wait message.channel.send(file=file,embed=embedVar)
构造函数中的文件名和URL中的文件名必须匹配。目前,您正在通过整个路径,它应该只是名称
embedVar.set\u缩略图(url=“attachment://image.png")