Code Monkey home page Code Monkey logo

libfb-js's People

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

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

libfb-js's Issues

onFailed doesn't reconnect

if for some reason (internet connection down etc.) the connection fails there are no attempts to reconnect.

Deploying to heroku gives issues.

I am not sure if this is a place to ask this question.

The library works perfect in my local system but when I deploy it to Heroku I cannot get it to work. After the deployment, I have to verify my account on Facebook. I know that Heroku servers from Austin, USA are causing this problem (Location difference) but I was looking for something to bypass/workaround for this.

Has anyone faced this issue? And did anyone solved it?

Some help, please :)

How can I use the built-in custom errors?

I am rather new to NodeJS, so forgive me for any basic errors.

That said, I've been trying to see if a thrown error is of type AttachmentNotFoundError. However, I don't think this error type is actually exported anywhere, and thus any attempt to use instanceof AttachmentNotFoundError results in TypeError: Right-hand side of 'instanceof' is not an object or ReferenceError: AttachmentNotFoundError is not defined.

Is there any way I can import this from src/types/errors? Thanks!

Cannot read property 'customization_info' of undefined

In my local PoGo group we have 2 seperate raid messengers, therefore we also have 2 seperate discord channels. I got the first discord channel connected to its appropriate messenger, but when I try to connect the second discord/messenger, I get prompted with this error:

Cannot read property 'customization_info' of undefined
TypeError: Cannot read property 'customization_info' of undefined
    at FacebookApi.constructor.parseThread.thread [as parseThread] (C:\snapshot\miscord\node_modules\libfb\dist\FacebookApi.js:50:43)
    at FacebookApi.<anonymous> (C:\snapshot\miscord\node_modules\libfb\dist\FacebookApi.js:44:25)
    at Generator.next (<anonymous>)
    at fulfilled (C:\snapshot\miscord\node_modules\tslib\tslib.js:104:62)
    at process._tickCallback (internal/process/next_tick.js:68:7)

When I link the discord it says its successfull, it is only when I try to link the messenger I get this error.
After I get the error, the bot shuts down and I have to restart it.

Documentation

document our shitty messy reverse engineered code

Removing messages

EDIT: apparently it's not out for all users, so we would have to check if it's available

Messages sent through Lightspeed clients intermittently fail to parse

Related to this issue from Miscord - noting here as it seems to be handled within this codebase.

Lightspeed clients - iOS per the linked issue as well as facebook.com/messenger desktop browser site on my side at the least - appear to add some randomized gibberish in front of message data, causing message parsing to fail:

Error while parsing the following message: (�9hjaimLxSMet4EwK36vf9A�{"deltas":[{"deltaNewMessage":{"messageMetadata":{"threadKey":{"threadFbId":1503335003032641},"messageId":"mid.$gAAVXRnTVjEF_V0jSTF5JgOIPszg1","offlineThreadingId":6794103221279471669,"actorFbId":1636270833,"timestamp":1619840436812,"shouldBuzzDevice":true,"tags":["source:chat:light_speed","app_id:2220391788200892"],"threadReadStateEffect":2,"skipBumpThread":false,"cid":{"conversationFbid":1503335003032641}},"body":"test","attachments":[]}}],"firstDeltaSeqId":265093,"lastIssuedSeqId":265093,"queueEntityId":100034260730370} Error while parsing the following message: (�9hjaimLxSMet4EwK36vf9A�

This seems to be randomized such that it does not always insert problematic characters, as it does work fine more often than not in my experience.

Suggestion for a fix:
It seems that the actual data after after the gibberish string consistently starts with {"deltas": - as such I wonder if cutting out everything before {"deltas": would resolve the issue. In my head this would be something like:
ms = ((ms.indexOf('{"deltas"') > 0) ? ms.substr(ms.indexOf('{"deltas"')) : ms) right above here https://github.com/ChatPlug/libfb-js/blob/master/src/Client.ts#L312

Will test myself if I get a chance

Unhandled promise rejection

Code:

try {
    let client = new Client();
    client.login(req.body.email, req.body.password).then(() => {
        req.session.session = client.getSession();
        res.send('Logged in.');
    });
} catch (e) {
    res.send(e);
}

Error:

(node:3248) UnhandledPromiseRejectionWarning: Error: User must verify their account on www.facebook.com (405)
    at post.then.res (node_modules\libfb\dist\http\HttpApi.js:26:35)
    at process._tickCallback (internal/process/next_tick.js:68:7)
(node:3248) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:3248) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

Roadmap

1.0.0: Basic API

  • Send messages
  • Receive messages
  • Receive events
  • Get user info
  • Get thread info

1.1.0:

  • Get thread list

1.2.0:

  • Save session
  • Load session

App version no longer supported

Hello, i am using libfb 2.3.5 and having this issue when sending a message to messenger :

  DEBUG   18:40:09 messenger › sendMessage ›  Sending Messenger message
  TRACE   18:40:09 messenger › sendMessage › sent message info {
  TRACE   18:40:09 messenger › sendMessage › sent message info   msgid: 1650279543,
  TRACE   18:40:09 messenger › sendMessage › sent message info   succeeded: false,
  TRACE   18:40:09 messenger › sendMessage › sent message info   errno: 1545075,
  TRACE   18:40:09 messenger › sendMessage › sent message info   errStr: 'This app version no longer supports messaging. To continue to send and receive messages, please update your app to a newer version or use the mobile web version of Facebook.',
  TRACE   18:40:09 messenger › sendMessage › sent message info   isRetryable: false
  TRACE   18:40:09 messenger › sendMessage › sent message info }

I think that facebook updated something on their side, do we need to change something in the user agent ?

Thanks in advance,

Add reactions support

Is it possible to add reactions as a field for the Message object? Not sure what this would entail, but seems like an important feature of any Facebook Messenger message!

Export few classes

Message, EventTypes, FacebookApi and others should be exported, as it will provide typings for typescript users

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.