Schmavery/facebook-chat-api

Getting error while uploading attachment as a page

Open

#133 创建于 2016年1月6日

在 GitHub 查看
 (19 评论) (0 反应) (0 负责人)JavaScript (555 fork)batch import
bugfacebook changehelp wanted

仓库指标

Star
 (1,879 star)
PR 合并指标
 (30 天内没有已合并 PR)

描述

Can't upload image by using

var msg = {
   attachment: fs.createReadStream(__dirname + '/kitty.jpg')
};

localAPI.sendMessage(msg, "0000000000", function callback(obj, other) {
});

Error message on

ERR! ERROR in sendMessage --> { error: 'JSON.parse error. Check the detail property on this error.', ERR! ERROR in sendMessage --> detail: [SyntaxError: Unexpected end of input], ERR! ERROR in sendMessage --> res: '' }

In sendMessage.js defaultFuncs .post("https://www.facebook.com/ajax/mercury/send_messages.php", ctx.jar, form) .then(utils.parseAndCheckLogin)

If I send message. It call utils.parseAndCheckLogin 1 time But when I upload an attachment. Error happen.

Thank you :D

贡献者指南