Socket
Socket
Sign inDemoInstall

facebook-messenjs

Package Overview
Dependencies
125
Maintainers
1
Versions
17
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    facebook-messenjs

Facebook MessenJS is an API wrapper for Facebook Messenger inspired by [discord.js](https://discord.js.org/) that allows you to interact with [Facebook Messenger's API](https://developers.facebook.com/docs/messenger-platform/). The bot was programmed with


Version published
Weekly downloads
1
Maintainers
1
Created
Weekly downloads
 

Readme

Source

Facebook MessenJS

Facebook MessenJS is an API wrapper for Facebook Messenger inspired by discord.js that allows you to interact with Facebook Messenger's API. The bot was programmed with an object-oriented approach so that people can program their Facebook Messenger chatbots with ease.

Example Code

const Client = require('./structures/client/Client');
const TextQuickReply = require('./structures/message/quick/TextQuickReply');
const BaseAttachment = require('./structures/message/attachments/BaseAttachment');

const bot = new Client({
    pageToken: "PAGE_TOKEN_FROM_FACEBOOK",
    verifyToken: "VERIFY_TOKEN_FOR_BOT",
    appID: "APP_ID_FROM_FACEBOOK"
});

bot.on('webhookVerify', verification => {
    if (verification.success) {
        console.log("Webhook verified with Facebook successfully!");
    } else {
        console.log("Webhook verified with Facebook failed! ;-;");
    }
})

bot.on('messages', message => {
    message.sender.send("Hi!");
});

bot.listen(3456, () => {
    console.log(`Facebook Messenger chatbot listening at http://localhost:${bot.port}`);
});

Keywords

FAQs

Last updated on 13 Apr 2022

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc