Command-line Messaging for Facebook Messenger
npm install -g messer
- Enter your details
For a list of commands, jump to the Commands Reference
Start Messer and wait for "Enter Code" prompt
Enter a 2FA code generated from your 2FA app
If at this point the login fails, go to Facebook and check for an "Unrecognised browser" notification
Approve the browser/device (i.e. approve Messer)
Retry from Step 1
After you've successfully logged in, an
appstate.json file is created which should allow you to skip this process every time you log in. If you wish to "start over", just delete that file.
This should™ work! Please let us know if it doesn't: we've had a number of issues with it in the past.
Sends a message to a given user
(message | m) "<user>" <message>
message "Matthew" hello world!
m "Matthew" hello world!
When sending a message, Messer picks the closest match to what you type in as
user. For this reason, you should probably use last names if you want to avoid accidentally texting someone.
Replys to the last message you recevied i.e. Sends a message to the user of the most recently received message.
(reply | r) <message>
r "hey yo this is my reply"
Note: this will only work if you have received at least one message through Messer.
Lists all of your Facebook friends
Displays the last n messages in the conversation with a given user. The number of messages to retrieve are optional (default is 5).
(history | h] "<user>" [<numMessages>]
history "Matthew" 10
Displays the n most recent conversations. The number of threads is optional (default is 5).
history "Matthew" 10
Clears the number of unread messages in the window title. Since we cannot listen on focus events, it has to be done manually.
(clear | c)
Logs you out
Messer can be run in non-interactive mode with command line arguments to execute a single command.
Login will be prompted if this is the first time logging in.
messer --command='m "John Smith" Hey, John'
messer --command='r Hey, John'
Messages from group chats appear like
(My cool friends) John Smith - hey guys!!$$@@
Send a message to a group by using the
message command. The
name is the name of the group chat! Reply works as normal
Take a look in Issues for things to contribute to. Only PR's that reference an issue will be considered. If you have a feature idea, submit an issue so it can be discussed!
Before you submit your PR, ask yourself...
Does this PR resolve a particular issue? (if not, then why is this PR necessary)?
Have I written tests? (where appropriate)
Have I made sure the tests pass?