facebook-chat-api icon indicating copy to clipboard operation
facebook-chat-api copied to clipboard

Getting error in sendMessage

Open ahmelkady opened this issue 7 years ago • 8 comments

I am using the code that is provided in the example to of the echo bot

const login = require("facebook-chat-api");
 
// Create simple echo bot
login({email: "FB_EMAIL", password: "FB_PASSWORD"}, (err, api) => {
    if(err) return console.error(err);
 
    api.listen((err, message) => {
        api.sendMessage(message.body, message.threadID);
    });
});

However each time the code reaches the sendMessage part this happens in the console

ERR! getUserInfo { __ar: 1,
ERR! getUserInfo   error: 1357004,
ERR! getUserInfo   errorSummary: 'Sorry, something went wrong',
ERR! getUserInfo   errorDescription: 'Please try closing and re-opening your browser window.',
ERR! getUserInfo   payload: null,
ERR! getUserInfo   bootloadable: {},
ERR! getUserInfo   ixData: {},
ERR! getUserInfo   bxData: {},
ERR! getUserInfo   gkxData: {},
ERR! getUserInfo   qexData: {},
ERR! getUserInfo   lid: '6646712661497263896' }

I am not sure what to make of it, also I am using nodejs version 11.6.0

ahmelkady avatar Jan 15 '19 13:01 ahmelkady

That was the facebook side error. Try exit the code and run again.

BadAimWeeb avatar Feb 14 '19 13:02 BadAimWeeb

Getting the same error on an old project that used to work. No matter how many times I close and restart it, it never works

oxodao avatar Mar 20 '19 13:03 oxodao

That's Facebook doing, I don't think there's much to do since they started blocking accounts using this library. Just don't even bother, you can't solve it on your end.

23phy avatar Mar 21 '19 06:03 23phy

Damn. So we're forced to use their official API for bot conversations? It can't be used to listen to all message of a conversation AFAIK, doesn't it ?

oxodao avatar Mar 21 '19 07:03 oxodao

No it doesn't. It's used to make bot-like services.

23phy avatar Mar 21 '19 09:03 23phy

I have this issue as well :|

tekknolagi avatar May 21 '19 16:05 tekknolagi

Please read the answers posted before yours

oxodao avatar May 21 '19 16:05 oxodao

Mmh people seems to be able to use it, and the file handling the sendMessage function has been edited a month ago. Yet I still have the problem. The account still works since I can log into it...

oxodao avatar Oct 04 '19 17:10 oxodao