mjkaufer / messer Goto Github PK
View Code? Open in Web Editor NEW:speech_balloon: Command-line messaging for Facebook Messenger
Home Page: https://www.npmjs.com/package/messer
License: ISC License
:speech_balloon: Command-line messaging for Facebook Messenger
Home Page: https://www.npmjs.com/package/messer
License: ISC License
When you receive a message from someone mid-conversation with someone else, or mid-typing, it gets really confusing. May I suggest simply adding color to new message (and possibly other) statements?
This can be done simply like this (for cyan blue):
console.log('\x1b[36m%s\x1b[0m', 'I am cyan'); //cyan
I follow your steps but I keep getting :
Invalid command - check your syntax
Commands:
message "[user]" [message]
reply [message]
I user message and reply both the same. Although I am getting incoming messages.
Unhandled rejection TypeError: Cannot read property 'type' of null
at callback (/Users/me/.node/lib/node_modules/messer/index.js:31:17)
at /Users/me/.node/lib/node_modules/messer/node_modules/facebook-chat-api/src/listen.js:141:7
at tryCatcher (/Users/me/.node/lib/node_modules/messer/node_modules/facebook-chat-api/node_modules/bluebird/js/main/util.js:24:31)
at Promise._settlePromiseFromHandler (/Users/me/.node/lib/node_modules/messer/node_modules/facebook-chat-api/node_modules/bluebird/js/main/promise.js:454:31)
at Promise._settlePromiseAt (/Users/me/.node/lib/node_modules/messer/node_modules/facebook-chat-api/node_modules/bluebird/js/main/promise.js:530:18)
at Promise._settlePromises (/Users/me/.node/lib/node_modules/messer/node_modules/facebook-chat-api/node_modules/bluebird/js/main/promise.js:646:14)
at Async._drainQueue (/Users/me/.node/lib/node_modules/messer/node_modules/facebook-chat-api/node_modules/bluebird/js/main/async.js:182:16)
at Async._drainQueues (/Users/me/.node/lib/node_modules/messer/node_modules/facebook-chat-api/node_modules/bluebird/js/main/async.js:192:10)
at Immediate.Async.drainQueues [as _onImmediate] (/Users/me/.node/lib/node_modules/messer/node_modules/facebook-chat-api/node_modules/bluebird/js/main/async.js:15:14)
at processImmediate [as _immediateCallback] (timers.js:367:17)
Seems to be triggered after a certain amount of time. Maybe a memory leak?
This might not necessary but this operation is work in Facebook Messenger.
I can find myself(my Facebook account name is "Veck Hsiao") and send a message to myself. This seems not work in Messer.
> message "Veck Hsiao" OH!!!
User "Veck Hsiao" could not be found in your friends list!
I am running messer in a facebook chat group with 3 people. It worked fine until a few days ago. Then I started to get this error message when people send a message to the chat group:
> Error: parseAndCheckLogin got status code: 404. Bailing out of trying to parse response.
at c:\Users\mika\AppData\Roaming\npm\node_modules\facebook-chat-api\utils.js:843:42
at tryCatcher (c:\Users\mika\AppData\Roaming\npm\node_modules\bluebird\js\main\util.js:26:23)
at Function.Promise.attempt.Promise.try (c:\Users\mika\AppData\Roaming\npm\node_modules\bluebird\js\main\method.js:31:24)
at c:\Users\mika\AppData\Roaming\npm\node_modules\facebook-chat-api\utils.js:813:24
at tryCatcher (c:\Users\mika\AppData\Roaming\npm\node_modules\bluebird\js\main\util.js:26:23)
at Promise._settlePromiseFromHandler (c:\Users\mika\AppData\Roaming\npm\node_modules\bluebird\js\main\promise.js:510:31)
at Promise._settlePromiseAt (c:\Users\mika\AppData\Roaming\npm\node_modules\bluebird\js\main\promise.js:584:18)
at Promise._settlePromises (c:\Users\mika\AppData\Roaming\npm\node_modules\bluebird\js\main\promise.js:700:14)
at Async._drainQueue (c:\Users\mika\AppData\Roaming\npm\node_modules\bluebird\js\main\async.js:123:16)
at Async._drainQueues (c:\Users\mika\AppData\Roaming\npm\node_modules\bluebird\js\main\async.js:133:10)
at Immediate.Async.drainQueues [as _onImmediate] (c:\Users\mika\AppData\Roaming\npm\node_modules\bluebird\js\main\async.js:15:14)
at runCallback (timers.js:756:18)
at tryOnImmediate (timers.js:717:5)
at processImmediate [as _immediateCallback] (timers.js:697:5)
I tried to upgrade node.js from 9.3.0 to 9.4.0 and reinstalled messer and deleted the appstate.json file. The facebook user which logs into messer works fine from the browser.
I get random errors related to a bunch of things (network, auth, etc.) from the facebook-chat-api
. There should be custom logging set up for these so the stack trace doesn't blow out the terminal window.
Hi!
When I try to run messer, I have the following error.
I installed it via sudo npm install -g messer
vince@elementary-laptop:~/Downloads/messer$ messer
: No such file or directory
vince@elementary-laptop:~/Downloads/messer$ node -v
v6.2.0
vince@elementary-laptop:~/Downloads/messer$ npm -v
3.8.9
vince@elementary-laptop:~/Downloads/messer$ lsb_release -a
No LSB modules are available.
Distributor ID: elementary OS
Description: elementary OS Freya
Release: 0.3.2
Codename: freya
reply [message]
to reply to the last message received - a step towards being able to use group chats
Hullo, I installed NVM and updated Node to 4.2.2 because I saw a warning when I was installing that Messer expected it. Now I get this error when trying to message.
Logged in as [email protected]
> message "Friend name" hello
TypeError: api.sendDirectMessage is not a function
at REPLServer.repl.start.eval (/usr/local/lib/node_modules/messer/index.js:73:10)
at bound (domain.js:280:14)
at REPLServer.runBound [as eval] (domain.js:293:12)
at REPLServer.<anonymous> (repl.js:412:12)
at emitOne (events.js:77:13)
at REPLServer.emit (events.js:169:7)
at REPLServer.Interface._onLine (readline.js:210:10)
at REPLServer.Interface._line (readline.js:549:8)
at REPLServer.Interface._ttyWrite (readline.js:826:14)
at ReadStream.onkeypress (readline.js:105:10)
at emitTwo (events.js:87:13)
at ReadStream.emit (events.js:172:7)
at emitKeys (readline.js:1250:14)
at next (native)
at ReadStream.onData (readline.js:918:36)
at emitOne (events.js:77:13)
Hi there.
I would like to create a script that automatically sends a message without me having to run messer first. Is it already possible to do this in the current version of messer? I was thinking of something like: messer message "reciever" Hello World!
or similar. This command should then open messer, send the message and then close messer again.
Greetings Apop
Add a threads
command that lists threads I can interact with.
contacts
command should aggregate Facebook friends and message thread participants
I have a friend who doesn't use facebook anymore but keeps in touch with others on messenger. This person's name doesn't show up when i use the contacts
command.
Need to mark the message as 'seen' somehow (maybe on type?)
Might be time to move to ES6. Happy to do it if consensus is reached :)
After installing messer, I can't run the command "messer", I get the following error :
"env: node\r: No such file or directory"
I'm on OSX, am I the first to get this ? :/
Hi,
I have decided to have some kind of messenger on my iPad on 6.1.3
I have there node 0.6.14 and npm 1.1.12
I know that this is like stone age or something but is there an possiblity for Messer there?
When using the history command I get something like this...
> h "Anthony" 5
Error: parseAndCheckLogin got status code: 404. Bailing out of trying to parse response.
at /Users/matthewkaufer/GitHub/Messer/node_modules/facebook-chat-api/utils.js:843:42
at tryCatcher (/Users/matthewkaufer/GitHub/Messer/node_modules/bluebird/js/main/util.js:26:23)
at Function.Promise.attempt.Promise.try (/Users/matthewkaufer/GitHub/Messer/node_modules/bluebird/js/main/method.js:31:24)
at /Users/matthewkaufer/GitHub/Messer/node_modules/facebook-chat-api/utils.js:813:24
at bound (domain.js:280:14)
at runBound (domain.js:293:12)
at tryCatcher (/Users/matthewkaufer/GitHub/Messer/node_modules/bluebird/js/main/util.js:26:23)
at Promise._settlePromiseFromHandler (/Users/matthewkaufer/GitHub/Messer/node_modules/bluebird/js/main/promise.js:510:31)
at Promise._settlePromiseAt (/Users/matthewkaufer/GitHub/Messer/node_modules/bluebird/js/main/promise.js:584:18)
at Promise._settlePromises (/Users/matthewkaufer/GitHub/Messer/node_modules/bluebird/js/main/promise.js:700:14)
at Async._drainQueue (/Users/matthewkaufer/GitHub/Messer/node_modules/bluebird/js/main/async.js:123:16)
at Async._drainQueues (/Users/matthewkaufer/GitHub/Messer/node_modules/bluebird/js/main/async.js:133:10)
at Immediate.Async.drainQueues (/Users/matthewkaufer/GitHub/Messer/node_modules/bluebird/js/main/async.js:15:14)
at runCallback (timers.js:672:20)
at tryOnImmediate (timers.js:645:5)
at processImmediate [as _immediateCallback] (timers.js:617:5)
I'm pretty sure it's an issue with the facebook-chat-api dependency – I'm gonna leave an issue over there and see if they know what's up
Is there a way to invoke messer in a non-interactive mode? For example, I'd like to use it with Alfred app and call it like this:
messer m "Bob" hi
Our codebase is a single file! Let's modularize it. Open for discussion
Hello!
Everything working well but today i updated to 0.2.2, and connected well! But i get this error message everytime on every command :
$> m "pauline bln" test
TypeError: Cannot read property 'name' of undefined
at Messer.getThreadByName (/usr/lib/node_modules/messer/index.js:186:34)
at Promise (/usr/lib/node_modules/messer/src/command-handlers.js:83:29)
at new Promise ()
at Messer.message (/usr/lib/node_modules/messer/src/command-handlers.js:73:12)
at Messer.processCommand (/usr/lib/node_modules/messer/index.js:150:25)
at REPLServer.eval (/usr/lib/node_modules/messer/index.js:128:54)
at bound (domain.js:370:14)
at REPLServer.runBound [as eval] (domain.js:383:12)
at REPLServer.onLine (repl.js:497:10)
at REPLServer.emit (events.js:160:13)
at REPLServer.Interface._onLine (readline.js:287:10)
at REPLServer.Interface._line (readline.js:640:8)
at REPLServer.Interface._ttyWrite (readline.js:920:14)
at REPLServer.self._ttyWrite (repl.js:566:7)
at ReadStream.onkeypress (readline.js:165:10)
at ReadStream.emit (events.js:160:13)
$> m "pauline blna" test
User 'pauline blna' could not be found in your friends list!
$>
In fact, when a command is valide, messer show me this error.
Only the contact command works.
I think this is related to this issue : here.
Best regards :)
node v9.4.0
npm v5.6.0
Latest version of node (v6.9.1) allows for a completer
option in REPL. Would be nice to autocomplete commands (and possibly friends for messaging) in the future. I've started working on this in my fork, just depends on whether there's a consensus on upgrading versions.
I find myself wanting to see who I've most recently got a message from a lot.
Facebook chat API has a method getThreadList which will make implementation easy.
It should also tell me if the message is read or not
hi,
i've just installed messer globally via npm but when i try to launch it it crashes with this error:
[Wed19:Oct:16 11:13:49] phra@kali ~ $ messer
/usr/bin/env: ‘node\r’: No such file or directory
It would be nice if we could send images in chat by typing a path to an image file. It's possible with facebook-chat-api:
let msg = {
body: "",
attachment: fs.createReadStream(__dirname + '/image.jpg')
}
api.sendMessage(msg, yourID);
data for contacts
command is not representative of the user's actual friends. Names that appear upon calling this command may not be friends of the user; this is misleading.
The main reason this exists is to reduce calls to the API when sending messages (m "Elon Musk" suh dude). There should be 2 sources of "names" - a friends
array and an activeThreadNames
(or similar) array.
Just installed, first attempt to message.
Logged in as [email protected]
> message "Friend Full Name" hello world
TypeError: undefined is not a function
at REPLServer.repl.start.eval (/usr/local/lib/node_modules/messer/index.js:73:10)
at bound (domain.js:254:14)
at REPLServer.runBound [as eval] (domain.js:267:12)
at REPLServer.<anonymous> (repl.js:279:12)
at REPLServer.emit (events.js:107:17)
at REPLServer.Interface._onLine (readline.js:214:10)
at REPLServer.Interface._line (readline.js:553:8)
at REPLServer.Interface._ttyWrite (readline.js:830:14)
at ReadStream.onkeypress (readline.js:109:10)
at ReadStream.emit (events.js:110:17)
at readline.js:1175:14
at Array.forEach (native)
at emitKeys (readline.js:993:10)
at ReadStream.onData (readline.js:910:14)
at ReadStream.emit (events.js:107:17)
at readableAddChunk (_stream_readable.js:163:16)
Love the idea, let me know if I can help! Draw you a nice picture or something..
I would love for this to be capable of automatically responding to incoming messages.
It would be nice to support facebook's 2 factor authentification.
It currently results to this:
info login Logging in...
ERR! login Couldn't login. Facebook might have blocked this account. Please login with a browser or enable the option 'forceLogin' and try again.
For better UX, some colors should be incorporated in the REPL log. At a minimum, there should be different colors per chat for easier scanning. Perhaps also the ability to set color per chat, or even get the 'real' color (as it was set in the app or the website) if available.
Does this app support Facebook's 2FA?
I'm seeing the following:
$ messer config.json
info Logging in...
ERR! Error in login: login-approval
{ error: 'login-approval', continue: [Function: continue] }
When i received a "wave" from a new friend, he following error was presented.
[TypeError: Cannot read property 'fullName' of undefined]
I've gotten it before from thumbs up, I believe.
Is there any proxy setting to set up? I'm behind corporate firewall and I can't log in.
Add a command that will provide an "overview" of your Messenger state. Thinking default to top 5 chats, and show the 5 most recent messages of each chat.
I think we could simply extend the recent
command, and add a --history
option.
Tedious to achieve the same thing with the current mechanisms
Please add history of chats function. This client lacks it badly. I very much love the client. Hope you'll add history soon
Let's get a dank logo
When I got message send from others and it shows error message such like
TypeError: Cannot read property 'fullName' of undefined
at getThreadById.then (/Users/aries/.nvm/versions/node/v9.8.0/lib/node_modules/messer/src/event-handlers.js:53:27)
at <anonymous>
Is there a way to add insert to a DB in this code
when i run messer, i got the following bug
messer ~/.config/config.json
/usr/local/lib/node_modules/messer/src/command-handlers.js:125
)
^
SyntaxError: Unexpected token )
at Object.exports.runInThisContext (vm.js:76:16)
at Module._compile (module.js:513:28)
at Object.Module._extensions..js (module.js:550:10)
at Module.load (module.js:458:32)
at tryModuleLoad (module.js:417:12)
at Function.Module._load (module.js:409:3)
at Module.require (module.js:468:17)
at require (internal/module.js:20:19)
at Object. (/usr/local/lib/node_modules/messer/index.js:8:27)
at Module._compile (module.js:541:32)
at Object.Module._extensions..js (module.js:550:10)
at Module.load (module.js:458:32)
at tryModuleLoad (module.js:417:12)
at Function.Module._load (module.js:409:3)
at Module.runMain (module.js:575:10)
at run (bootstrap_node.js:352:7)
When two factor auth is enabled (code generator in app) the client becomes unusable with the following error.
messer ~/Desktop/config.json
info Getting login form data
info Logging in...
[Error: Error retrieving userId. This can be caused by a lot of things, including getting blocked by Facebook for logging in from an unknown location. Try logging in with a browser to verify.]
Unhandled rejection TypeError: expecting an array, a promise or a thenable
frostydog@Lenovopad:~$ messer ./Documents/messer/config.json
undefined:1
undefined
^SyntaxError: Unexpected token u in JSON at position 0
at JSON.parse ()
at ReadFileContext.fs.readFile [as callback] (/usr/local/lib/node_modules/messer/src/helpers.js:50:39)
at FSReqWrap.readFileAfterOpen [as oncomplete] (fs.js:437:13)
frostydog@Lenovopad:$ node -v
v9.2.0
frostydog@Lenovopad:$ npm -v
5.5.1
m "Mike Smith" hello TypeError: Cannot read property 'name' of undefined at Messer.getThreadByName (/usr/local/lib/node_modules/messer/index.js:186:33) at Promise (/usr/local/lib/node_modules/messer/src/command-handlers.js:83:29) at Promise (<anonymous>) at Messer.message (/usr/local/lib/node_modules/messer/src/command-handlers.js:73:12) at Messer.processCommand (/usr/local/lib/node_modules/messer/index.js:150:25) at REPLServer.eval (/usr/local/lib/node_modules/messer/index.js:128:54) at bound (domain.js:301:14) at REPLServer.runBound [as eval] (domain.js:314:12) at REPLServer.onLine (repl.js:433:10) at emitOne (events.js:115:13) at REPLServer.emit (events.js:210:7) at REPLServer.Interface._onLine (readline.js:278:10) at REPLServer.Interface._line (readline.js:625:8) at REPLServer.Interface._ttyWrite (readline.js:904:14) at REPLServer.self._ttyWrite (repl.js:502:7) at ReadStream.onkeypress (readline.js:157:10)
For some reason message or m isn't working for a friend named Mike Smith. What could be going on here? Did Facebook update something?
Hi
I installed this for the first time and tried to run it but get:
$ messer
/usr/lib/node_modules/messer/src/messer.js:60
)
^
SyntaxError: Unexpected token )
at createScript (vm.js:56:10)
at Object.runInThisContext (vm.js:97:10)
at Module._compile (module.js:549:28)
at Object.Module._extensions..js (module.js:586:10)
at Module.load (module.js:494:32)
at tryModuleLoad (module.js:453:12)
at Function.Module._load (module.js:445:3)
at Module.require (module.js:504:17)
at require (internal/module.js:20:19)
at Object.<anonymous> `(/usr/lib/node_modules/messer/index.js:2:16)
Thanks
Steve
Add support for messaging group chats!
(@ 3 rpm)
If I typed invalid command
info login Logging in...
info login Logged in
info login Request to reconnect
info login Request to pull 1
info login Request to pull 2
info login Request to thread_sync
info login Done logging in.
Logged in as [email protected]
Fetching user details...
Listening for incoming messages...
> exit
Invalid command - check your syntax
Invalid command - check your syntax
Invalid command - check your syntax
.exit
after message sent
> message "Shu-Cho Feng" Hello World!
Sent message to Shu-Cho Feng
Invalid command - check your syntax
message
I need to use ctrl + c
to continue operation.
It's about time for some code review! @mjkaufer @2016rshah @anyone else
I've put at least a little bit of thought as to better architecture for the project going forward but would definitely like some more opinions. Especially towards:
helpers
file should be part of the Messer prototypes (I'm starting to think yes)And test! The best way I've found is just to keep it running for a day and find little edge-cases.
It would be awesome if you guys could spare an hour or so to have a gloss. I haven't fleshed out docs/comments so if you've got any questions just comment here 🎉
Hey, when I try to use messer (clean install), it appears that I am unable to use/create a config.json file.
I just installed it with npm install -g messer
and then ran messer
and got this error
SyntaxError: Unexpected token u in JSON at position 0
at JSON.parse (<anonymous>)
at ReadFileContext.fs.readFile [as callback] (/usr/local/lib/node_modules/messer/src/helpers.js:50:39)
at FSReqWrap.readFileAfterOpen [as oncomplete] (fs.js:420:13)
and when I checked in the code, it appeared that it was unable to create a config.json file.
I don't know if it's an error on my part or the code has a problem.
Btw, I'm using node 8.9.2
and npm 5.6.0
.
Thanks!
I installed messer with sudo npm install -g messer
I logged in, using 2fa, and typed contacts
.
This gave me the error:
TypeError: Object.values is not a function at Promise (/usr/lib/node_modules/messer/src/command-handlers.js:119:34) at Messer.contacts (/usr/lib/node_modules/messer/src/command-handlers.js:118:12) at Messer.processCommand (/usr/lib/node_modules/messer/index.js:150:25) at REPLServer.eval (/usr/lib/node_modules/messer/index.js:128:54) at bound (domain.js:280:14) at REPLServer.runBound [as eval] (domain.js:293:12) at REPLServer.<anonymous> (repl.js:539:10) at emitOne (events.js:96:13) at REPLServer.emit (events.js:188:7) at REPLServer.Interface._onLine (readline.js:232:10) at REPLServer.Interface._line (readline.js:583:8) at REPLServer.Interface._ttyWrite (readline.js:860:14) at REPLServer.self._ttyWrite (repl.js:612:7) at ReadStream.onkeypress (readline.js:119:10) at emitTwo (events.js:106:13) at ReadStream.emit (events.js:191:7)
I then tried history "$NAME"
Error: parseAndCheckLogin got status code: 404. Bailing out of trying to parse response. at /usr/lib/node_modules/messer/node_modules/facebook-chat-api/utils.js:843:42 at tryCatcher (/usr/lib/node_modules/messer/node_modules/bluebird/js/main/util.js:26:23) at Function.Promise.attempt.Promise.try (/usr/lib/node_modules/messer/node_modules/bluebird/js/main/method.js:31:24) at /usr/lib/node_modules/messer/node_modules/facebook-chat-api/utils.js:813:24 at bound (domain.js:280:14) at runBound (domain.js:293:12) at tryCatcher (/usr/lib/node_modules/messer/node_modules/bluebird/js/main/util.js:26:23) at Promise._settlePromiseFromHandler (/usr/lib/node_modules/messer/node_modules/bluebird/js/main/promise.js:510:31) at Promise._settlePromiseAt (/usr/lib/node_modules/messer/node_modules/bluebird/js/main/promise.js:584:18) at Promise._settlePromises (/usr/lib/node_modules/messer/node_modules/bluebird/js/main/promise.js:700:14) at Async._drainQueue (/usr/lib/node_modules/messer/node_modules/bluebird/js/main/async.js:123:16) at Async._drainQueues (/usr/lib/node_modules/messer/node_modules/bluebird/js/main/async.js:133:10) at Immediate.Async.drainQueues (/usr/lib/node_modules/messer/node_modules/bluebird/js/main/async.js:15:14) at runCallback (timers.js:672:20) at tryOnImmediate (timers.js:645:5) at processImmediate [as _immediateCallback] (timers.js:617:5)
Do I have the wrong version of some library maybe?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.