Reputation: 63
Trying to send a file message to bale.ai bot. Upload seems working correctly but when it reach send function the connection will be reseted. What is the problem?
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)
Upvotes: 2
Views: 57
Reputation: 345
fileId and accessHash must be string, replace this line
var file = new SDK.FileMessage(fileId.toString(), fileAccessHash.toString(), 'telename', stats.size, 'text/html', 'see')
with yours.
Upvotes: 4