Schmavery/facebook-chat-api

Getting error while uploading attachment as a page

Open

#133 opened on 2016年1月6日

GitHub で見る
 (19 comments) (0 reactions) (0 assignees)JavaScript (1,879 stars) (555 forks)batch import
bugfacebook changehelp wanted

説明

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

コントリビューターガイド