【问题标题】:Can't send FileMessage to bale bot无法将 FileMessage 发送到打包机器人
【发布时间】:2018-11-05 09:43:58
【问题描述】:

尝试向 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)

【问题讨论】:

    标签: bots bale-messenger


    【解决方案1】:

    fileId 和 accessHash 必须是字符串,替换这一行

    var file = new SDK.FileMessage(fileId.toString(), fileAccessHash.toString(), 'telename', stats.size, 'text/html', 'see')
    

    和你的。

    【讨论】:

      猜你喜欢
      • 2020-08-25
      • 2023-01-13
      • 1970-01-01
      • 2017-09-02
      • 1970-01-01
      • 2021-09-10
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多