Giter Site home page Giter Site logo

facebook-chat-api's Introduction

Note: This repo is in maintenance mode. Bug fixes will be happily merged if they are submitted in simple or well-explained PRs (thank you to all the contributors over the years!), but new features will usually not be merged (because all features eventually break and increase the maintenance cost). I don't have enough time to better support this project and believe the approach is ok for one-off scripts or fun projects but fundamentally too unstable for any serious application. Any change by Facebook can break the api overnight and that's assuming the api can remain compliant enough not to get blocked. Unfortunately we will need to wait and hope that they decide to build a powerful enough bot system to support all these usecases.

Unofficial Facebook Chat API

npm version npm downloads code style: prettier

Facebook now has an official API for chat bots here.

This API is the only way to automate chat functionalities on a user account. We do this by emulating the browser. This means doing the exact same GET/POST requests and tricking Facebook into thinking we're accessing the website normally. Because we're doing it this way, this API won't work with an auth token but requires the credentials of a Facebook account.

Disclaimer: We are not responsible if your account gets banned for spammy activities such as sending lots of messages to people you don't know, sending messages very quickly, sending spammy looking URLs, logging in and out very quickly... Be responsible Facebook citizens.

See below for projects using this API.

See the full changelog for release details.

Install

If you just want to use facebook-chat-api, you should use this command:

npm install facebook-chat-api

It will download facebook-chat-api from NPM repositories

Bleeding edge

If you want to use bleeding edge (directly from github) to test new features or submit bug report, this is the command for you:

npm install Schmavery/facebook-chat-api

Testing your bots

If you want to test your bots without creating another account on Facebook, you can use Facebook Whitehat Accounts.

Example Usage

const login = require("facebook-chat-api");

// Create simple echo bot
login({email: "FB_EMAIL", password: "FB_PASSWORD"}, (err, api) => {
    if(err) return console.error(err);

    api.listen((err, message) => {
        api.sendMessage(message.body, message.threadID);
    });
});

Result:

screen shot 2016-11-04 at 14 36 00

Documentation

Main Functionality

Sending a message

api.sendMessage(message, threadID[, callback][, messageID])

Various types of message can be sent:

  • Regular: set field body to the desired message as a string.
  • Sticker: set a field sticker to the desired sticker ID.
  • File or image: Set field attachment to a readable stream or an array of readable streams.
  • URL: set a field url to the desired URL.
  • Emoji: set field emoji to the desired emoji as a string and set field emojiSize with size of the emoji (small, medium, large)

Note that a message can only be a regular message (which can be empty) and optionally one of the following: a sticker, an attachment or a url.

Tip: to find your own ID, you can look inside the cookies. The userID is under the name c_user.

Example (Basic Message)

const login = require("facebook-chat-api");

login({email: "FB_EMAIL", password: "FB_PASSWORD"}, (err, api) => {
    if(err) return console.error(err);

    var yourID = "000000000000000";
    var msg = "Hey!";
    api.sendMessage(msg, yourID);
});

Example (File upload)

const login = require("facebook-chat-api");

login({email: "FB_EMAIL", password: "FB_PASSWORD"}, (err, api) => {
    if(err) return console.error(err);

    // Note this example uploads an image called image.jpg
    var yourID = "000000000000000";
    var msg = {
        body: "Hey!",
        attachment: fs.createReadStream(__dirname + '/image.jpg')
    }
    api.sendMessage(msg, yourID);
});

Saving session.

To avoid logging in every time you should save AppState (cookies etc.) to a file, then you can use it without having password in your scripts.

Example

const fs = require("fs");
const login = require("facebook-chat-api");

var credentials = {email: "FB_EMAIL", password: "FB_PASSWORD"};

login(credentials, (err, api) => {
    if(err) return console.error(err);

    fs.writeFileSync('appstate.json', JSON.stringify(api.getAppState()));
});

Listening to a chat

api.listen(callback)

Listen watches for messages sent in a chat. By default this won't receive events (joining/leaving a chat, title change etc…) but it can be activated with api.setOptions({listenEvents: true}). This will by default ignore messages sent by the current account, you can enable listening to your own messages with api.setOptions({selfListen: true}).

Example

const fs = require("fs");
const login = require("facebook-chat-api");

// Simple echo bot. It will repeat everything that you say.
// Will stop when you say '/stop'
login({appState: JSON.parse(fs.readFileSync('appstate.json', 'utf8'))}, (err, api) => {
    if(err) return console.error(err);

    api.setOptions({listenEvents: true});

    var stopListening = api.listen((err, event) => {
        if(err) return console.error(err);

        api.markAsRead(event.threadID, (err) => {
            if(err) console.error(err);
        });

        switch(event.type) {
            case "message":
                if(event.body === '/stop') {
                    api.sendMessage("Goodbye…", event.threadID);
                    return stopListening();
                }
                api.sendMessage("TEST BOT: " + event.body, event.threadID);
                break;
            case "event":
                console.log(event);
                break;
        }
    });
});

FAQS

  1. How do I run tests?

For tests, create a test-config.json file that resembles example-config.json and put it in the test directory. From the root >directory, run npm test.

  1. Why doesn't sendMessage always work when I'm logged in as a page?

Pages can't start conversations with users directly; this is to prevent pages from spamming users.

  1. What do I do when login doesn't work?

First check that you can login to Facebook using the website. If login approvals are enabled, you might be logging in incorrectly. For how to handle login approvals, read our docs on login.

  1. How can I avoid logging in every time? Can I log into a previous session?

We support caching everything relevant for you to bypass login. api.getAppState() returns an object that you can save and pass into login as {appState: mySavedAppState} instead of the credentials object. If this fails, your session has expired.

  1. Do you support sending messages as a page?

Yes, set the pageID option on login (this doesn't work if you set it using api.setOptions, it affects the login process).

login(credentials, {pageID: "000000000000000"}, (err, api) => {  }
  1. I'm getting some crazy weird syntax error like SyntaxError: Unexpected token [!!!

Please try to update your version of node.js before submitting an issue of this nature. We like to use new language features.

  1. I don't want all of these logging messages!

You can use api.setOptions to silence the logging. You get the api object from login (see example above). Do

api.setOptions({
    logLevel: "silent"
});

Projects using this API

  • Messer - Command-line messaging for Facebook Messenger
  • messen - Rapidly build Facebook Messenger apps in Node.js
  • Concierge - Concierge is a highly modular, easily extensible general purpose chat bot with a built in package manager
  • Marc Zuckerbot - Facebook chat bot
  • Marc Thuckerbot - Programmable lisp bot
  • MarkovsInequality - Extensible chat bot adding useful functions to Facebook Messenger
  • AllanBot - Extensive module that combines the facebook api with firebase to create numerous functions; no coding experience is required to implement this.
  • Larry Pudding Dog Bot - A facebook bot you can easily customize the response
  • fbash - Run commands on your computer's terminal over Facebook Messenger
  • Klink - This Chrome extension will 1-click share the link of your active tab over Facebook Messenger
  • Botyo - Modular bot designed for group chat rooms on Facebook
  • matrix-puppet-facebook - A facebook bridge for matrix
  • facebot - A facebook bridge for Slack.
  • Botium - The Selenium for Chatbots
  • Messenger-CLI - A command-line interface for sending and receiving messages through Facebook Messenger.
  • AssumeZero-Bot – A highly customizable Facebook Messenger bot for group chats.
  • Miscord - An easy-to-use Facebook bridge for Discord.
  • chat-bridge - A Messenger, Telegram and IRC chat bridge.
  • messenger-auto-reply - An auto-reply service for Messenger.
  • BotCore – A collection of tools for writing and managing Facebook Messenger bots.
  • mnotify – A command-line utility for sending alerts and notifications through Facebook Messenger.

facebook-chat-api's People

Contributors

abhisuri97 avatar allanwang avatar astrocb avatar bbatliner avatar blazeu avatar bsansouci avatar cadesalaberry avatar dentfuse avatar dependabot[bot] avatar diceroll123 avatar featherbear avatar forcemagic avatar gamelaster avatar hossammohsen7 avatar howardyclo avatar ivkos avatar kabirvirji avatar kamdz avatar kieferlam avatar larrylutw avatar mehcode avatar mjkaufer avatar randallkent avatar ravkr avatar schmavery avatar timsorbet avatar tomquirk avatar toohpick avatar weetbix avatar xuezhma 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  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

facebook-chat-api's Issues

Receiver name missing in response

If i ( say A) make a post to somebody else (say B), i am not getting the receiver's name in response. Is there any way to include the name of the receiver in response for the listen command

Chat events

Is it possible to extend the API to allow events to be listened for? By "events" I mean things like people joining/leaving a chat, chat title changing, etc.

Memory leak

I use the example code

var login = require("facebook-chat-api");

// Create simple echo bot
login("config.json", function(err, api) {
    if(err) return console.error(err);

    api.listen(function callback(err, message) {
        api.sendMessage(message.body, message.thread_id);
    });
});

And every time someone chat, memory goes up by 200Kb~1Mb

Stickers are received as empty messages

When sending a sticker, the following information is received by the bot;

{ type: 'message',
  sender_name: 'Jack Wilsdon',
  sender_id: MY_ID,
  participant_names: [ 'Jack' ],
  participant_ids: [ MY_ID ],
  body: '',
  thread_id: MY_ID,
  location: null }

Is there a way to detect a sticker and identify which sticker it is?

Can't get access token

Hi
I don't know why I can't get access token to use facebook api. Do have anything with api.getAccessToken()?

Attachments aren't properly implemented

We loop over attachments but breaks, so it takes the first one that matches. This is not only wrong because you can send multiple attachments, but also because we make a hard distinction between types of messages ("message", "sticker", "file", "photo" and "animated_image") and any of those can be sent in the same message.

I propose a pretty simple fix that keeps backward compatibility. We call the callback multiple times, with a "message" if there's one, and with each of the attachments independently.

Thoughts?

Login as Page

In the Facebook API there is a way to read Page messages (through Subscription to conversation) and reply, but it is very slow (delay of at least 5 sec).
Is there a way to use this API to connect as a Facebook page, get the messages for the Page and reply ?

Thanks

getting user access token

since the code logs in as the user provided i wondered if there is an option
to extract the access token from somewhere in index.js in order to work with facebook's graph api
in order to get list of friends, likes etc

Unable to login to facebook and wrong error message

I'm using your simple login example and I've got this message:

info Getting login form data 
info Logging in... 
ERR! TypeError: expecting an array, a promise or a thenable

    See http://goo.gl/s8MMhc

After some investigation I spotted that error occurs at index.js:45 (i'm not getting any location so my login credentials are wrong?)

But my credentials are ok so I rendered HTML body of response and I'm seeing an error message that says cookies aren't enabled on my browser. What now? Am I doing something wrongly?

response error

I am using a previous version of the library where all functions reside in index.js itself.
Right now , after the get request from https://0-edge-chat.facebook.com/pull , am getting the following response always. what can be done to get the actual response, when a chat is being sent to the logged in user.
'{"t":"refresh","reason":110,"seq":0}'

No option to suppress console.log?

In my application, i'd like to create my own messages to the console, and not be bogged down in a constant stream of "Got answer in 3125". To do this, i just deleted all of the damn console.log-s, but i feel like you should implement a logger. Thanks for this module by the way, works great.

can't send messages

i cant seem to be able to send messages to new people,
if i try to send to a friend who i already had a conversation with it works fine.
if i try to send to someone who i never had a conversation with i always get
{ error: 'Send message failed.' }

im using the sendMessage Method, here my code

var login = require("facebook-chat-api");

login("config.json", function(err, api) {
    if(err) return console.error(err);

    api.getUserId("Friend Name", function(err1, data) {
        if(err1) return console.error(err1);

        console.log(data);
        api.sendMessage("Test From Script", data.entries[0].uid, function(err2,data2){
            if(err2) return console.error(err2);
        });
    });
});

appreciate the help

Listen own message

Is it possible to add a function ( maybe just in api.listen ) to read user's own message ( send from web ) , this way , it's easier to make a chat assistant , thanks

Change group chat title

Is it possible to extend the API to change group chat titles?

Here's the message_batch form data sent when updating a group chat title:

message_batch[0][action_type]: ma-type:log-message
message_batch[0][author]: MY_ID
message_batch[0][author_email]:
message_batch[0][coordinates]:
message_batch[0][is_filtered_content]: false
message_batch[0][is_forward]: false
message_batch[0][is_spoof_warning]: false
message_batch[0][is_unread]: false
message_batch[0][log_message_data][name]: NEW_TITLE
message_batch[0][log_message_type]: log:thread-name
message_batch[0][manual_retry_cnt]: 0
message_batch[0][message_id]: MESSAGE_ID
message_batch[0][source]: source:chat:web
message_batch[0][source_tags][0]: source:chat
message_batch[0][status]: 0
message_batch[0][thread_fbid]: THREAD_FBID
message_batch[0][thread_id]:
message_batch[0][timestamp]: 1428791528745
message_batch[0][timestamp_absolute]: Today
message_batch[0][timestamp_relative]: 23:32
message_batch[0][timestamp_time_passed]: 0

The important line seems to be this:

message_batch[0][log_message_data][name]: NEW_TITLE

And here are the differences between message_batch[0] when sending a message and when changing chat title;

--- user_message
+++ title_change
-message_batch[0][action_type]: ma-type:user-generated-message
+message_batch[0][action_type]: ma-type:log-message
 message_batch[0][author]: MY_ID
 message_batch[0][author_email]:
-message_batch[0][body]: MSG_BODY
 message_batch[0][coordinates]:
-message_batch[0][force_sms]: true
-message_batch[0][has_attachment]: false
-message_batch[0][html_body]: false
 message_batch[0][is_filtered_content]: false
 message_batch[0][is_forward]: false
 message_batch[0][is_spoof_warning]: false
 message_batch[0][is_unread]: false
+message_batch[0][log_message_data][name]: NEW_TITLE
+message_batch[0][log_message_type]: log:thread-name
 message_batch[0][manual_retry_cnt]: 0
 message_batch[0][message_id]: MESSAGE_ID
-message_batch[0][source]: source:titan:web
+message_batch[0][source]: source:chat:web
+message_batch[0][source_tags][0]: source:chat
 message_batch[0][status]: 0
 message_batch[0][thread_fbid]: THREAD_FBID
 message_batch[0][thread_id]:
 message_batch[0][timestamp]: 1428791528745
 message_batch[0][timestamp_absolute]: Today
 message_batch[0][timestamp_relative]: 23:32
 message_batch[0][timestamp_time_passed]: 0
-message_batch[0][ui_push_phase]: V3

Login using an existing cookie

Instead of creating a new session, we should add an endpoint to the api to fetch the cookie, and also the ability to login with a cookie instead.

e.g. ..

login({ cookie: "...

From testing, I've created about 40 sessions! If you guys want I can implement this.

Now getting error on login (was working fine until now)

Hi,

My app was logging into facebook and getting + sending messages with no problem. Then I started intermittently getting the error below. Now I get it all the time.

info Logging in...
info Logged in
info Initial requests...
info Request to null_state
info Request to reconnect
info Request to pull 1
ERR! TypeError: Cannot read property 'sticky' of undefined
[TypeError: Cannot read property 'sticky' of undefined] '[facebook login name here]'

Appreciate your time :)

Two-factor authentication

Hi,

Is it possible to add Two-factor authentication compatibility ?
Or there is a technical issue to implement it ?

Thank again for this awesome api !

login issue

I have updated the library and was able to get messages yesterday. But today am not able to login. it says "Wrong username/password" . seems headers.location is missing. Can you pls check the issue

Refactor and modularize

The code is really difficult to understand and I guess to mantain for you.
My suggestion is to move pieces of the code in other files, creating sub-modules or "extensions" to the main file.

For example, when you create the api like this:

var api = {};
api.setOptions = function() { ... }
api.listen = function() { ... }

The file gets really long and it is hard to understand when a function starts and ends. If every function of that api object had a file, everything would be better.

File: extensions/listen.js

function listen() {
    ...
}
module.exports = listen;

And so on for every function. Then in index.js:

api.listen = require('./extensions/listen.js');
// and so on

I hope you'll consider the suggestion.

Thank you for the work, it is great but it needs to improve on this aspect.

getUserId Error

Hi,

Calling api.getUserId breaks the program. I tried calling the method itself manually and got an error, and calling api.sendDirectMessage, which uses api.getUserId, throws the same error.

The error is as follows

WARN Warning - sendDirectSticker and sendDirectMessage are deprecated. 
ERR! Error in getUserId TypeError: Cannot read property '0' of undefined
ERR! Error in getUserId     at /Users/matt/Projects/node_modules/facebook-chat-api/src/getUserId.js:21:25
ERR! Error in getUserId     at tryCatcher (/Users/matt/Projects/node_modules/facebook-chat-api/node_modules/bluebird/js/main/util.js:24:31)
ERR! Error in getUserId     at Promise._settlePromiseFromHandler (/Users/matt/Projects/node_modules/facebook-chat-api/node_modules/bluebird/js/main/promise.js:454:31)
ERR! Error in getUserId     at Promise._settlePromiseAt (/Users/matt/Projects/node_modules/facebook-chat-api/node_modules/bluebird/js/main/promise.js:530:18)
ERR! Error in getUserId     at Promise._settlePromises (/Users/matt/Projects/node_modules/facebook-chat-api/node_modules/bluebird/js/main/promise.js:646:14)
ERR! Error in getUserId     at Async._drainQueue (/Users/matt/Projects/node_modules/facebook-chat-api/node_modules/bluebird/js/main/async.js:182:16)
ERR! Error in getUserId     at Async._drainQueues (/Users/matt/Projects/node_modules/facebook-chat-api/node_modules/bluebird/js/main/async.js:192:10)
ERR! Error in getUserId     at Immediate.Async.drainQueues [as _onImmediate] (/Users/matt/Projects/node_modules/facebook-chat-api/node_modules/bluebird/js/main/async.js:15:14)
ERR! Error in getUserId     at processImmediate [as _immediateCallback] (timers.js:367:17)
ERR! Error in getUserId  [TypeError: Cannot read property '0' of undefined]
[TypeError: Cannot read property '0' of undefined]

echo example doesn't send messages

There is no error in log

info Getting login form data 
info Logging in... 
info Logged in 
info Initial requests... 
info Request to null_state 
info Request to reconnect 
info Request to pull 1 
info Request to pull 2 
info Request to sync 
info Request to thread_sync 
info Getting read access. 
info Getting write access. 
info Getting extended access. 
info Done loading. 
info Got answer in  5583
info Got answer in  2057

nodejs version: v0.10.25 and v0.12.0

Adding and removing people from group chats

Is it possible to extend the API to allow management of users in group chats? (adding and removing people).

Here's the message_batch for adding someone to the chat;

message_batch[0][action_type]:ma-type:log-message
message_batch[0][thread_id]:
message_batch[0][author]:fbid:MY_ID
message_batch[0][author_email]:
message_batch[0][coordinates]:
message_batch[0][timestamp]:1433779527722
message_batch[0][timestamp_absolute]:Today
message_batch[0][timestamp_relative]:17:05
message_batch[0][timestamp_time_passed]:0
message_batch[0][is_unread]:false
message_batch[0][is_forward]:false
message_batch[0][is_filtered_content]:false
message_batch[0][is_spoof_warning]:false
message_batch[0][source]:source:chat:web
message_batch[0][source_tags][0]:source:chat
message_batch[0][log_message_type]:log:subscribe
message_batch[0][log_message_data][added_participants][0]:fbid:ID_OF_USER_ADDED
message_batch[0][status]:0

Although I'm not sure if that's much help.

sendMessage with attachment will send unordered `__req`

If you look here you'll see that we call mergeWithDefaults (say __req is "a") and then call api.uploadAttachment. The latter will also call mergeWithDefaults here (say __req is "b" now) and will send first, after which "a" is sent, out of order.

This is a little annoying because it could be caused anywhere due to the nature of how we "cache" the form first, and then send the request (in two steps). I'd love to fix this everywhere, but I'm not too sure how.

Thanks to @JLarky for finding this.

Mismatched types pageID

When using the current dev branch, login in as page is broken due to the given ID internally turned into a string.
After editing the setOptions function, to not convert pageID into a string, receiving messages as page works.
This breaks preventing selfListen though as there it is expected to be a string in the comparison.

In short: somewhere along the line there is a type mismatch, that prevents pageID to be properly compared.

app id

We can see that an app_id is being used in this function graphAPIReadReq() in index.js. Can we change it and use our own app id? when i tried to change it, i am getting this error "Error retrieving access token, continuing..." . What should i do to change the app id?

Can't get userInfo of array UID

Hi
I use getFriendsList method to get list friend, It will return array UID. Then I use getUserInfo method to get user information of that array but it throw error: ERR! Error in getUserInfo TypeError: first argument must be a string or Buffer
Could you tell me how to fix it?

SendSticker not working

error:

{ __ar: 1,
  error: 1545012,
  errorSummary: 'Temporary Failure',
  errorDescription: 'There was a temporary error, please try again.',
  transientError: 1,
  payload: null,
  bootloadable: {},
  ixData: {},
  lid: '0' }

Creating a Group Chat

It seems we don't support creating a new group chat. It might be possible to do it with api.addUserToGroup, but it's still not clear what to set as the thread_id and what the id of the new group chat will be.

Plans for version 1.0 [WIP]

We've run into a couple situations where some refactoring would result in a more sensible app. Here's my WIP proposal (please feel free to contribute) for a version 1.0 that will include breaking changes.

Note: This isn't anything fancy, mostly just me putting most of the current issues into a list because it kind of needs to happen... please tell me if I forgot anything.

  • Handle message attachments properly #50 #52
  • Fix participants #31 #51
  • Misc other sendMessage problems #52 #49 (Thanks @JLarky)
  • A call to api.listen should return the stopListening function rather than passing it to the callback.
  • Handle listen being called multiple times.
  • Naming consistency:
    • Naming conventions are a little all over the place. This is mostly because Facebook... seems not to care about them. I don't see any real reason to Facebook's naming scheme closely. Examples of this can be seen in the objects returned by api.getUserInfo as well as the two following functions.
    • api.getThreadList : This returns a lot of potentially completely useless data, can we strip it down?
    • listen : The field names on message objects corresponding to attachments seem unnecessarily different. Is there any reason to specify sticker_url vs file_url vs hires_url. It seems like each non-text type could simply have a url field.
  • See if the login process can be streamlined.
  • Remove hacky access token support.
  • Create group chats #56
  • Update documentation to 1.0
  • Documentation naming consistency
  • Add getThreadHistory

Testing:

  • Basic functionality (Send/receive messages, stickers, basic events)
  • Extra functionality (getThreadList, getUserInfo, getFriendsList, getUserId)
  • Documentation of tests (Insofar as there are instructions on how to set up the config file.)
  • Extra: Pages

Extras:

  • Login approvals (2FA) #22
  • Login with cookie #46
  • Get online users #47
  • Logout

Note: There have been several undocumented functions in the api for a while now. Namely:

  • archiveThread
  • deleteThread
  • deleteMessage
  • getUrl
  • searchForThread
  • unarchiveThread

Just noting them here as it's easy to forget things that aren't in the README.

Error retrieving userId.

I'm always getting this error even if I enter from the browser and mark the login attempt as trust wordy.

[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.]

Bypass captcha with several accounts

Hi, I am Nicolas and I already sent you an email about that.
Briefly, I'm working on a bot which send messages to several people. Like your "Marc Zuckerbot" but sometimes captcha is needed (because recipients are not in my friend list), so I want to bypass the captcha.
For do that, I would like to use several Facebook accounts. The bot send messages with the first account and when it is blocked by captcha, it uses the second account, etc.
The problem is that the captcha is set up for all the accounts. Nevertheless cookies are reset during the log in. So I don't understand why captcha is omnipresent on every accounts. After that, I tried to use this accounts (send messages) with my web browser and captcha is not asked.
So I would like understand why there is a "different interpretation" between my bot and my web browser.
Thank you for your help !

Error on getting access token

Using version 0.1.9

node_modules/facebook-chat-api/index.js:787
tps://www.facebook.com/connect/login_success.html#access_token=")[1].split("&"
                                                                    ^
TypeError: Cannot read property 'split' of undefined
    at Request._callback (node_modules/facebook-chat-api/index.js:787:147)

Support upload

We don't yet support file upload. It would be nice to condense this into as few library functions as possible. My hunch is that it will be possible to have one api.sendAttachment function that will support both regular and animated images as well as standard file upload.

If anyone wants to take a stab at this, feel free 😄

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.