Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/324.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python 在嵌入到Discord.py中时将本地文件用作set_缩略图_Python_Image_Discord_Discord.py_Embed - Fatal编程技术网

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")