Giter Site home page Giter Site logo

fb-messenger-cli's People

Contributors

adrian-oaida avatar alex-rose avatar davepagurek avatar felleg avatar fsmonter avatar gusano avatar janfitz avatar jcschefer avatar jrbeaumont avatar kukoman avatar marcel-valdez avatar olivierpineau avatar sambergeron avatar sarangjo avatar specious avatar theanine avatar tomnieuwland avatar toraora avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

fb-messenger-cli's Issues

Permission error during the first run

To create the .kryptonite file, fs.js needed superuser permission, otherwise it fell with 'Permission denied' error. Might be a good idea to add a permission check, so it doesn't have to crash.

user.vanity undefined

Hi There,

An awesome app and thank you for your hard work.

I have an intermittent issue when sensing messages to users. I get an error from interactive around line 45 where you check for user.vanity ( if (group) { recipientUrl = id; } else { recipientUrl = user.vanity; } )
for some reason the user object is undefined, so to prevent crashing I had to do some further checks, but as I have no idea what FB "vanity" property is I don't want to mess around with it...

Unable to show group messages

An error occurs when you type /groups command:

C:\Users\chpecson\AppData\Roaming\npm\node_modules\fb-messenger-cli\scripts\listeners.js:19
for(var j = 0; j < thread.attachments.length; j++) {
^

TypeError: Cannot read property 'length' of undefined
at printThreadSnippet (C:\Users\chpecson\AppData\Roaming\npm\node_modules\fb-messenger-cli\scripts\listeners.js:19:40)
at C:\Users\chpecson\AppData\Roaming\npm\node_modules\fb-messenger-cli\scripts\listeners.js:56:9
at Request._callback (C:\Users\chpecson\AppData\Roaming\npm\node_modules\fb-messenger-cli\scripts\messenger.js:407:9)
at Request.self.callback (C:\Users\chpecson\AppData\Roaming\npm\node_modules\fb-messenger-cli\node_modules\request\request.js:186:22)
at emitTwo (events.js:106:13)
at Request.emit (events.js:191:7)
at Request. (C:\Users\chpecson\AppData\Roaming\npm\node_modules\fb-messenger-cli\node_modules\request\request.js:1081:10)
at emitOne (events.js:96:13)
at Request.emit (events.js:188:7)
at Gunzip. (C:\Users\chpecson\AppData\Roaming\npm\node_modules\fb-messenger-cli\node_modules\request\request.js:1001:12)

I hope this will error log will hep you in fixing the error.

Settings file not found

I reliably get this error every time I start the script:

{ Error: ENOENT: no such file or directory, open '.settings'
    at Error (native) errno: -2, code: 'ENOENT', syscall: 'open', path: '.settings' }
Warning : settings can't be read

It looks like it's trying to find a .settings file in the current directory, which (of course) is not necessarily there.

Heading customization

I have two questions:

  1. I see that the heading's color comes from the line console.log(head.bgBlack); in the heading.js file. Anyway this can be customized other than having to fork this repo?

  2. The heading is draw in the interactive.js file with the command:

  // Draw the header
  heading.writeHeader(this.currentConversationId);

If I try to move this line to the end of the function, I still get the header above the promp but below the messages. Is there a way to have the header appear on the bottom side instead of the top side?

Program crashes when doing two searches in a row

When I search by a name with upper case like /search Mike it went well but when I type a lower case word like /search mike the program crashes and return this error message:

/usr/local/lib/node_modules/fb-messenger-cli/scripts/search.js:23
    if(search.filtered[i].position == choice.toLowerCase().trim()){
                                            ^

TypeError: Cannot read property 'toLowerCase' of undefined
    at Search.selectConvo (/usr/local/lib/node_modules/fb-messenger-cli/scripts/search.js:23:45)
    at EventEmitter.Listeners.searchListener (/usr/local/lib/node_modules/fb-messenger-cli/scripts/listeners.js:111:21)
    at emitOne (events.js:96:13)
    at EventEmitter.emit (events.js:191:7)
    at ReadStream.InteractiveCli.handler (/usr/local/lib/node_modules/fb-messenger-cli/scripts/interactive.js:291:13)
    at emitOne (events.js:96:13)
    at ReadStream.emit (events.js:191:7)
    at readableAddChunk (_stream_readable.js:178:18)
    at ReadStream.Readable.push (_stream_readable.js:136:10)
    at TTY.onread (net.js:560:20)

Impossible to login

Hi,
Thanx for this app, but i would like to try it ;)
It is impossible to login, here is the output:

$ fb-messenger-cli
Can't find the .kryptonite file, we'll make a new one
Facebook credentials
prompt: email:  [email protected]
prompt: password:  
undefined:1
Blocked a frame with origin "https://www.facebook.com" from accessing a frame with origin https://www.messenger.com". Protocols, 
domains, and ports must match.
^

SyntaxError: Unexpected token B
    at Object.parse (native)
    at Socket.<anonymous> (/usr/local/lib/node_modules/fb-messenger-cli/scripts/login.js:36:28)
    at emitNone (events.js:72:20)
    at Socket.emit (events.js:166:7)
    at endReadableNT (_stream_readable.js:905:12)
    at nextTickCallbackWith2Args (node.js:441:9)
    at process._tickCallback (node.js:355:17)

Cannot read property 'length' of undefined in interactive.js

This is the error I got this morning while opening a conversation:

/usr/local/lib/node_modules/fb-messenger-cli/scripts/interactive.js:71
    for (var i = 0; i < message.attachments.length; i++) {
                                           ^

TypeError: Cannot read property 'length' of undefined
    at renderMessage (/usr/local/lib/node_modules/fb-messenger-cli/scripts/interactive.js:71:44)
    at printMessages (/usr/local/lib/node_modules/fb-messenger-cli/scripts/interactive.js:150:17)
    at messenger.getMessages (/usr/local/lib/node_modules/fb-messenger-cli/scripts/interactive.js:160:7)
    at Request._callback (/usr/local/lib/node_modules/fb-messenger-cli/scripts/messenger.js:260:9)
    at Request.self.callback (/usr/local/lib/node_modules/fb-messenger-cli/node_modules/request/request.js:188:22)
    at emitTwo (events.js:106:13)
    at Request.emit (events.js:194:7)
    at Request.<anonymous> (/usr/local/lib/node_modules/fb-messenger-cli/node_modules/request/request.js:1171:10)
    at emitOne (events.js:96:13)
    at Request.emit (events.js:191:7)

Since it worked fine earlier, I think the reason is because I sent a picture on Facebook. As a result, I'm not able to open any of the conversations. I tried sending a text message on Facebook in the conversation that had a picture (hoping that it would fix the issue), but this is still happening.

Login Issues, JSON Parse error: Unexpected EOF

Can't find the .kryptonite file, we'll make a new one
Facebook credentials
prompt: email:  ([email protected])
prompt: password:  
undefined:1
SyntaxError: JSON Parse error: Unexpected EOF
^

SyntaxError: Unexpected token S in JSON at position 0
    at Object.parse (native)
    at Socket.<anonymous> (/usr/local/lib/node_modules/fb-messenger-cli/scripts/login.js:36:28)
    at emitNone (events.js:91:20)
    at Socket.emit (events.js:185:7)
    at endReadableNT (_stream_readable.js:974:12)
    at _combinedTickCallback (internal/process/next_tick.js:74:11)
    at process._tickCallback (internal/process/next_tick.js:98:9)

Running openSUSE Tumbleweed, installed fb-messenger-cli with npm6.
I used the same login on the browser and it works fine. No special chars in my password or email.
I thought it was my ad-blocking DNS server that's causing issues, tried connecting via VPN from my VPS but didn't work still.

Feature Request: Notifications

I can think of 2 types of notifications:

  1. Pop-up
  2. Sound

They don't have to be decoupled, but the more options the better!

Feature Request: Marking new messages as read

This is an extremely cool command line tool! Thanks for making it.

There is one slight recommendation I have about it. At the top of your recent conversations list, there is a small highlight on the names of conversations for new updates to conversations that you currently don't have loaded out. However, even after I read these new messages, these highlights don't go away. Is there a way to currently address this issue?

Login error - unexpected token in login data

undefined:1
TypeError: undefined is not an object (evaluating 'x.length')
^

SyntaxError: Unexpected token T in JSON at position 0
at JSON.parse ()
at Socket. (C:\Users\Redel\AppData\Roaming\npm\node_modules\fb-messenger-cli\scripts\login.js:24:26)
at emitNone (events.js:91:20)
at Socket.emit (events.js:188:7)
at endReadableNT (_stream_readable.js:975:12)
at _combinedTickCallback (internal/process/next_tick.js:80:11)
at process._tickCallback (internal/process/next_tick.js:104:9)

Yesterday the app is working fine, I just encountered this issue today. I tried running uninstall --save and installing it back and I still receive the same error message.

Group message responses seem to not send?

I'm able to hit /groups from the main page, and then select a number of a group to enter. But once the messages are visible, trying to respond with any text, and then hitting [enter], results in

TypeError: Cannot read property 'vanity' of undefined
    at EventEmitter.Listeners.sendMessageListener (/usr/local/lib/node_modules/fb-messenger-cli/scripts/listeners.js:57:53)

Tried logging in, does not work? Is 2FA supported?

I tried logging and it keeps telling me my details are incorrect altough i checked them 4 times. I have 2FA on, would this work with it?

I'm asking because i checked the code and i can't see any handle for 2FA.

Thanks!

Node 6.5.0 with npm 3.10.3 on macOS 10.11.6

Unexpected identifier on first run

Hi there,

After installing I get the following error on the first run- any ideas?

/usr/local/lib/node_modules/fb-messenger-cli/scripts/login.js:30

          let trimmed = phantom.data.substring(phantom.data.indexOf('{'));
              ^^^^^^^
SyntaxError: Unexpected identifier
    at Module._compile (module.js:439:25)
    at Object.Module._extensions..js (module.js:474:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:312:12)
    at Module.require (module.js:364:17)
    at require (module.js:380:17)
    at /usr/local/lib/node_modules/fb-messenger-cli/cli.js:4:15
    at Object.<anonymous> (/usr/local/lib/node_modules/fb-messenger-cli/cli.js:100:2)
    at Module._compile (module.js:456:26)
    at Object.Module._extensions..js (module.js:474:10)

Many thanks!
M

Cannot Log In

I simply cannot log in, details are valid, checked and double checked, however it just says bad facebook login, also ctl+c results in an error TypeError: Cannot read property 'email' of undefined

Update endpoints to make use of new GraphQl calls

Since Friday, I stopped seeing any existing messages when I opened a conversation. Messages sent to me while the chat is open still appear, but the initial load of message history did not appear to be working. After digging a bit, I found that the JSON response received in Messenger.prototype.getLastMessage always has an empty array as the payload field. Looking at the network inspector on messenger.com, it appears that they instead hit messenger.com/api/graphqlbatch now with a query field looking something like this:

{"o0":{"doc_id":"1549485615075443","query_params":{"id":"694231732","message_limit":20,"load_messages":1,"load_read_receipts":false,"before":null}}}

Options

  • Select / enable-disable colors
  • Save cookie with custom password, FB password or no password
  • Timeout for refreshing the cookie

Length of attachements is undefined, after recent update

Hello again,

I did a fresh install of the app. After I log in and get the list of chats, I select the chat I want to go and I get this error:

/usr/local/lib/node_modules/fb-messenger-cli/scripts/interactive.js:71
    for (var i = 0; i < message.attachments.length; i++) {
                                           ^

TypeError: Cannot read property 'length' of undefined
    at renderMessage (/usr/local/lib/node_modules/fb-messenger-cli/scripts/interactive.js:71:44)
    at printMessages (/usr/local/lib/node_modules/fb-messenger-cli/scripts/interactive.js:150:17)
    at messenger.getMessages (/usr/local/lib/node_modules/fb-messenger-cli/scripts/interactive.js:160:7)
    at Request._callback (/usr/local/lib/node_modules/fb-messenger-cli/scripts/messenger.js:260:9)
    at Request.self.callback (/usr/local/lib/node_modules/fb-messenger-cli/node_modules/request/request.js:188:22)
    at emitTwo (events.js:125:13)
    at Request.emit (events.js:213:7)
    at Request.<anonymous> (/usr/local/lib/node_modules/fb-messenger-cli/node_modules/request/request.js:1171:10)
    at emitOne (events.js:115:13)
    at Request.emit (events.js:210:7)

It's werid cuz I didn't face it yesterday!

Overlap of itemized message

Hi, If I open some particular chat and I receive new message, text of my unfinished message is overlapped by the last one received. If it is resolvable, cool feature will be commited.

Error when receiving message

This error happens every time when someone sends me a message:

A Friend : blah blah last message before login
/usr/lib/node_modules/fb-messenger-cli/node_modules/node-notifier/lib/notify-send.js:77
return callback(err);
^
TypeError: callback is not a function
at /usr/lib/node_modules/fb-messenger-cli/node_modules/node-notifier/lib/notify-send.js:77:14
at F (/usr/lib/node_modules/fb-messenger-cli/node_modules/which/which.js:40:25)
at E (/usr/lib/node_modules/fb-messenger-cli/node_modules/which/which.js:43:29)
at /usr/lib/node_modules/fb-messenger-cli/node_modules/which/which.js:54:16
at FSReqWrap.oncomplete (fs.js:114:15)

User interface - Navigation

  • First login with username / password
  • Following login, unlock only with password
  • Landing page with conversation list
  • Select and open existing conversation
  • From a conversation, navigate back to home page
  • Search for friends, initiate conversation
  • Scroll messages in a conversation
  • Add support for group chat
  • Status bar and quick jump to conversation (i.e. CTRL + 1)

Threads not in chronological order in main menu

The threads in the main menu for messages are not always in chronological order. If I type /menu over and over again, without receiving new messages, the order shuffles around randomly.

'Bad Facebook Login'

I turned off FB two-factor authentication. Checked my email and password multiple times. I'm sure I typed it correctly. Still no luck logging in.

Using command line from: Bash on Ubuntu on Windows 10. Ubuntu 16.04.03

Cannot read property 'vanity' of undefined at InteractiveCli.initializeConversationViewFromFbid

Hi,
This happens with a particular contact I just added.
Tried to archive the first conversation and recreate it, didn't help.

Select conversation :
> 1
readline.js:982
            throw err;
            ^

TypeError: Cannot read property 'vanity' of undefined
    at InteractiveCli.initializeConversationViewFromFbid (/home/x/fbmc/scripts/interactive.js:115:63)
    at /home/x/fbmc/scripts/interactive.js:341:25
    at EventEmitter.Listeners.getMessagesListener (/home/x/fbmc/scripts/listeners.js:10:3)
    at emitThree (events.js:116:13)
    at EventEmitter.emit (events.js:194:7)
    at Interface.InteractiveCli.handler (/home/x/fbmc/scripts/interactive.js:340:19)
    at emitOne (events.js:96:13)
    at Interface.emit (events.js:188:7)
    at Interface._onLine (readline.js:233:10)
    at Interface._line (readline.js:585:8)

That might be hard to reproduce, though.
That happens when selecting the conversation from the menu, as well as when switching from another conversation.
(before you ask, yes, I pulled before opening the issue :) )

Thanks for your time, much appreciated !

Cannot login

Can't find the .kryptonite file, we'll make a new one
Facebook credentials
prompt: email:  (my mail)
prompt: password:  
undefined:1
TypeError: null is not an object (evaluating 'document.getElementById("email").value = user')
^

SyntaxError: Unexpected token T in JSON at position 0
    at JSON.parse (<anonymous>)
    at Socket.<anonymous> (/home/marcinc/.npm-global/lib/node_modules/fb-messenger-cli/scripts/login.js:36:28)
    at emitNone (events.js:91:20)
    at Socket.emit (events.js:185:7)
    at endReadableNT (_stream_readable.js:974:12)
    at _combinedTickCallback (internal/process/next_tick.js:74:11)

Cannot erase password at login

Impossible to erase the * of your password resulting in bad login credentials.

====================
Windows 10

Powershell
Major Minor Build Revision
5 1 14393 953

History lost when switching between chats

Let's take 2 scenarios:

  1. I run the script and go into any conversation. Any history will be lost and i get a blank screen.
  2. I am in a conversation, and I switch to another one, then I switch back to the first conversation. I would have lost all history again.

Any idea what's the reason for that?

Error occurs when opening a conversation with the last message being a "sticker"

It looks like this is due to the payload being nil:

/usr/lib/node_modules/fb-messenger-cli/scripts/interactive.js:69
  if (group) { recipientUrl = id; } else { recipientUrl = user.vanity; }
                                                              ^

TypeError: Cannot read property 'vanity' of undefined
    at InteractiveCli.initializeConversationViewFromFbid (/usr/lib/node_modules/fb-messenger-cli/scripts/interactive.js:69:63)
    at /usr/lib/node_modules/fb-messenger-cli/scripts/interactive.js:249:19
    at EventEmitter.Listeners.getMessagesListener (/usr/lib/node_modules/fb-messenger-cli/scripts/listeners.js:11:3)
    at emitThree (events.js:110:13)
    at EventEmitter.emit (events.js:188:7)
    at ReadStream.InteractiveCli.handler (/usr/lib/node_modules/fb-messenger-cli/scripts/interactive.js:248:13)
    at emitOne (events.js:90:13)
    at ReadStream.emit (events.js:182:7)
    at readableAddChunk (_stream_readable.js:153:18)
    at ReadStream.Readable.push (_stream_readable.js:111:10)

/groups command crash!

Hello.

Great program you have written. Thanks for that!

I'm wondering if the following is a known bug or perhaps just on my specific system.
I have disabled two-step-verification to make the program accept my login. I'm on Fedora 25 with python3 and pip3 updated.

Whenever I give the /groups (or /group) command I get a crash and the following is printed:

/usr/lib/node_modules/fb-messenger-cli/scripts/listeners.js:19
  for(var j = 0; j < thread.attachments.length; j++) {
                                   ^
TypeError: Cannot read property 'length' of undefined
    at printThreadSnippet (/usr/lib/node_modules/fb-messenger-cli/scripts/listeners.js:19:40)
    at /usr/lib/node_modules/fb-messenger-cli/scripts/listeners.js:56:9
    at Request._callback (/usr/lib/node_modules/fb-messenger-cli/scripts/messenger.js:407:9)
    at Request.self.callback (/usr/lib/node_modules/fb-messenger-    cli/node_modules/request/request.js:186:22)
    at emitTwo (events.js:106:13)
    at Request.emit (events.js:191:7)
    at Request.<anonymous> (/usr/lib/node_modules/fb-messenger-    cli/node_modules/request/request.js:1081:10)
    at emitOne (events.js:96:13)
    at Request.emit (events.js:188:7)
    at Gunzip.<anonymous> (/usr/lib/node_modules/fb-messenger-   cli/node_modules/request/request.js:1001:12)

Feature Request: Display group messages in top bar

For me will be more comfortable if top bar with names of friends could contains also group messages mixed with conversations with single friends. Ideally sorted by delivery time. Because now I can't recieve notification on new group message. What do you think?

new message doesn't appear sometimes

I caught at least one instance where I had this and another facebook client up at the same time, and the message appeared on the other one but not this one. I didn't see the new message until I exited and reentered the conversation. Perhaps we should make the client automatically check for new messages every few seconds?

Cannot read property 'length' of undefined in listeners.js

Hi,

This is what I have when logging in with a fresh clone of the repo :

Password: **************
Warning: Errors caught in return data
Warning : settings not found, lets try to create default
Launching app...
Settings have been saved
> 
/home/pierre/fb-messenger-cli/scripts/listeners.js:33
    for (var i = 0; i < threads.length; ++i) {
                               ^

TypeError: Cannot read property 'length' of undefined
    at /home/pierre/fb-messenger-cli/scripts/listeners.js:33:32
    at Request._callback (/home/pierre/fb-messenger-cli/scripts/messenger.js:318:9)
    at Request.self.callback (/home/pierre/node_modules/request/request.js:188:22)
    at emitTwo (events.js:106:13)
    at Request.emit (events.js:191:7)
    at Request.<anonymous> (/home/pierre/node_modules/request/request.js:1171:10)
    at emitOne (events.js:96:13)
    at Request.emit (events.js:188:7)
    at Gunzip.<anonymous> (/home/pierre/node_modules/request/request.js:1091:12)
    at Gunzip.g (events.js:292:16)

Was working fine last week.
Thanks for your help ;)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.