Schmavery / facebook-chat-api

Unofficial Facebook Chat API for Nodejs
MIT License
1.93k stars 596 forks source link

App passwords #730

Open sermijn opened 5 years ago

sermijn commented 5 years ago

Does anyone has an example how to work with app passwords?

bAndie91 commented 5 years ago

i'm afraid it's not viable, because fb-chat-api does not work as an app (in facebook's sense), but as your browser opening and viewing the messenger page. so if you can not login into messenger with an app-specific password, then fb-chat-api neither can use it. that's my thought. i tried it. i'd like to have it work and to solve the issue that fb notoriously locks me out (suspectedly due to fb-chat-api).

BadAimWeeb commented 5 years ago

i'm afraid it's not viable, because fb-chat-api does not work as an app (in facebook's sense), but as your browser opening and viewing the messenger page. so if you can not login into messenger with an app-specific password, then fb-chat-api neither can use it. that's my thought. i tried it. i'd like to have it work and to solve the issue that fb notoriously locks me out (suspectedly due to fb-chat-api).

You can try add markAsRead and sendTypingIndicator so your bot will look more like a normal browser. Also please change the user agent.

Schmavery commented 5 years ago

@lequanglam is there a reason you think the default user agent should be changed?

BadAimWeeb commented 5 years ago

@Schmavery oh, because default user agent in this module is public, and Facebook can search for user agent look like default user agent then banning all accounts. I changed the user agent, mark message as read every time the code received a message, use appState, and it works fine for about 1 month now.