Skip to content
This repository has been archived by the owner on Jul 9, 2022. It is now read-only.

how to listen to Message Requests from non-friend accounts? #886

Open
rhenwinch opened this issue Aug 20, 2021 · 2 comments
Open

how to listen to Message Requests from non-friend accounts? #886

rhenwinch opened this issue Aug 20, 2021 · 2 comments

Comments

@rhenwinch
Copy link

How to listen to Message Requests from non-friend accounts? I thought it also listens to that

Also, I'm not sure how api.handleMessageRequest actually works bc u need a 'threadID' to accept/ignore a message request.

image

@rhenwinch
Copy link
Author

Copied from my Chatbot file, just modify and use it

api.getThreadList(10, null, ["PENDING"], function (err, list) {
if (err) {
log("[Facebook]", "Remove Pending Messages encountered an error (at getThreadList:PENDING):", err);
if (err.error == "Not logged in." && global.config.facebookAutoRestartLoggedOut) {
log("[Facebook]", "Detected not logged in. Throwing 7378278 to restarting...");
facebookloggedIn = false;
process.exit(7378278);
}
return null;
}
handleList(list, "PENDING");

    api.getThreadList(10, null, ["OTHER"], function (err, list) {
      if (err) {
        log(
          "[Facebook]", "Remove Pending Messages encountered an error (at getThreadList:OTHER):",
          err
        );
        if (err.error == "Not logged in." && global.config.facebookAutoRestartLoggedOut) {
          log("[Facebook]", "Detected not logged in. Throwing 7378278 to restarting...");
          facebookloggedIn = false;
          process.exit(7378278);
        }
        return null;
      }
      handleList(list, "OTHER");

      api.markAsReadAll(function (err) {
        if (err) {
          if (err.error == "Not logged in." && global.config.facebookAutoRestartLoggedOut) {
            log("[Facebook]", "Not logged in. Triggering restart...");
            process.exit(7378278);
          }
        }
      });
    });
  });

thanks, I just saw your comment rn. 1 last question, do u have a method to not get banned? like use an old account or smth?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants
@rhenwinch and others