Schmavery/facebook-chat-api

Getting error while uploading attachment as a page

Open

#133 ouverte le 6 janv. 2016

Voir sur GitHub
 (19 commentaires) (0 réactions) (0 assignés)JavaScript (555 forks)batch import
bugfacebook changehelp wanted

Métriques du dépôt

Stars
 (1 879 stars)
Métriques de merge PR
 (Aucune PR mergée en 30 j)

Description

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

Guide contributeur