尝试向bale.ai bot发送文件消息。上传似乎工作正常,但当它到达发送功能时,连接将被重置。有什么问题?
let ddd = fs.readFileSync(__dirname + '/a.html')
bot.UploadFile(ddd,'file').then(response => {
let fileId = response.fileId
let fileAccessHash = response.accessHash
let fileٰVersion = response.version
const stats = fs.statSync(__dirname + '/a.html')
var file = new SDK.FileMessage(fileId, fileAccessHash, 'telename', stats.size, 'text/html', 'see')
bot.send(file, responder.peer)
答案 0 :(得分:4)
fileId和accessHash必须是字符串,替换此行
var file = new SDK.FileMessage(fileId.toString(), fileAccessHash.toString(), 'telename', stats.size, 'text/html', 'see')
和你一起。