Liryna / FacebookBot

A Facebook bot for Telegram
MIT License
50 stars 24 forks source link

{ error: 'Wrong username/password.' } #1

Closed jdckl closed 8 years ago

jdckl commented 9 years ago

When starting the .js the process fails on

info Getting login form data info Logging in... { error: 'Wrong username/password.' } Unhandled rejection TypeError: expecting an array, a promise or a thenable

See http://goo.gl/s8MMhc

at apiRejection (/Users/violet/Documents/FacebookBot/node_modules/facebook-chat-api/node_modules/bluebird/js/main/promise.js:10:27)
at PromiseArray.init [as _init] (/Users/violet/Documents/FacebookBot/node_modules/facebook-chat-api/node_modules/bluebird/js/main/promise_array.js:60:31)
at new PromiseArray (/Users/violet/Documents/FacebookBot/node_modules/facebook-chat-api/node_modules/bluebird/js/main/promise_array.js:24:10)
at Function.Promise.all (/Users/violet/Documents/FacebookBot/node_modules/facebook-chat-api/node_modules/bluebird/js/main/promise.js:173:12)
at /Users/violet/Documents/FacebookBot/node_modules/facebook-chat-api/index.js:233:21
at tryCatcher (/Users/violet/Documents/FacebookBot/node_modules/facebook-chat-api/node_modules/bluebird/js/main/util.js:26:23)
at ReductionPromiseArray._promiseFulfilled (/Users/violet/Documents/FacebookBot/node_modules/facebook-chat-api/node_modules/bluebird/js/main/reduce.js:109:18)
at Promise._settlePromiseAt (/Users/violet/Documents/FacebookBot/node_modules/facebook-chat-api/node_modules/bluebird/js/main/promise.js:586:26)
at Promise._settlePromises (/Users/violet/Documents/FacebookBot/node_modules/facebook-chat-api/node_modules/bluebird/js/main/promise.js:697:14)
at Async._drainQueue (/Users/violet/Documents/FacebookBot/node_modules/facebook-chat-api/node_modules/bluebird/js/main/async.js:123:16)
at Async._drainQueues (/Users/violet/Documents/FacebookBot/node_modules/facebook-chat-api/node_modules/bluebird/js/main/async.js:133:10)
at Immediate.Async.drainQueues [as _onImmediate] (/Users/violet/Documents/FacebookBot/node_modules/facebook-chat-api/node_modules/bluebird/js/main/async.js:15:14)
at processImmediate [as _immediateCallback] (timers.js:367:17)

My creds in the config.json are definitely right. Pity :-/ Really looked forward to trying this out.

Liryna commented 9 years ago

Hi @violetzie ,

I am currently not using anymore so it is a little outdate :(. The dependencies are probably no longer working with FB changes.

Could you try to update facebook-chat-api to 1.0.1 and node-telegram-bot to 0.1.4 ?

azizimusa commented 8 years ago

This is because, you need to handle correctly how it pull data from config.json. But for a quick fix, why don't you use this :

login({email: "FB_EMAIL", password: "FB_PASSWORD"}, function callback (err, api) {

instead of

login("config.json", function(err, api) {

andddd...you need to update forwardmsg variable.

From this

var forwardmsg = message.sender_name + ": " + message.body;

to this

var forwardmsg = message.senderName + ": " + message.body;

to be able to see sender name and message.

Liryna commented 8 years ago

@azizimusa , with this changes you have been able to make FacebookBot work with the last dependancy ?

azizimusa commented 8 years ago

It work before, but now it won't. Don't know why.

Update : yes it is working on latest dependancy. Only that, after too many login, FB seem blocking my login request, thus returning an error. after 5-6 Hours, I try again, it can login and used like normal.

Liryna commented 8 years ago

It seems that even with the changes, I am no longer able to send messages. The logic has probably changed.

Schmavery commented 8 years ago

@azizimusa @Liryna There were a number of breaking changes in v1.0 of the facebook-chat-api in order to gain some more consistency (and do a better job of abstracting away facebook's own internal inconsistencies). If you need any help updating the bot to the latest version, let me know and I might be able to help.
@azizimusa, if you're doing many logins, you might be able to use the new support for persisting your session cookies between logins. Edit: I see you were the one that opened an issue about this on our repo, I hope you're able to get that cleared up.

Liryna commented 8 years ago

@Schmavery , thank you for you help but I had not time to do it. But with @icecube45 pull request #3 this has been made. Thanks all of you !

icecube45 commented 8 years ago

Created pull request #4 to re impliment the config