Closed Dragon-ts closed 8 months ago
file:文件路径 url:网络图片 data:base64编码 需要先上传图片再进行发送操作。
上传范例:
async def upload_url_image_jpg(type,url):
name=randint(1000000000000000000000000,9999999999999999999999999)
print (name)
bot = get_bot()
if type == "url":
file_id = await bot.upload_file(type=type,name=f"{name}.jpg",url=url)
elif type == "path":
file_id = await bot.upload_file(type=type,name=f"{name}.jpg",path=url)
elif type == "data":
file_id = await bot.upload_file(type=type,name=f"{name}.jpg",data=url)
return file_id
@barryblueice 上传结果是None
简而言之,即type:image中的参数file_id应该是什么?如果本地的话是文件的绝对路径还是其他?如果url的话应该是什么样子的 感谢大家