使用url Discord PY向字段添加图像



基本上我有这个代码:

for x in STITEMS:
counter+=1
embedVar.add_field(name=f"Starting item #{counter}",url=x['src'],inline=True)

我想添加一个图像到一个字段使用url,但它不工作

TypeError: add_field() got an unexpected keyword argument 'url'

关于如何使它工作有什么想法吗?这有可能吗,或者我应该把这些图像转换成表情符号并那样使用吗?

问题是add_field不接受参数'url'。您需要使用.set_image方法向嵌入中添加图像。在你的例子中,

embedVar.set_image(url = 'your URL here')

最新更新