Schmavery/facebook-chat-api

Getting error while uploading attachment as a page

Open

#133 aperta il 6 gen 2016

Vedi su GitHub
 (19 commenti) (0 reazioni) (0 assegnatari)JavaScript (555 fork)batch import
bugfacebook changehelp wanted

Metriche repository

Star
 (1879 star)
Metriche merge PR
 (Nessuna PR mergiata in 30 g)

Descrizione

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

Guida contributor