{"id":20249145,"url":"https://github.com/aneeshd16/fb-chatbot","last_synced_at":"2026-06-09T05:32:00.616Z","repository":{"id":57233614,"uuid":"57589930","full_name":"aneeshd16/fb-chatbot","owner":"aneeshd16","description":null,"archived":false,"fork":false,"pushed_at":"2019-01-13T10:41:56.000Z","size":15,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-09-26T04:51:31.736Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/aneeshd16.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-05-01T08:00:30.000Z","updated_at":"2019-01-13T10:41:57.000Z","dependencies_parsed_at":"2022-08-31T14:11:37.705Z","dependency_job_id":null,"html_url":"https://github.com/aneeshd16/fb-chatbot","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/aneeshd16/fb-chatbot","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aneeshd16%2Ffb-chatbot","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aneeshd16%2Ffb-chatbot/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aneeshd16%2Ffb-chatbot/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aneeshd16%2Ffb-chatbot/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/aneeshd16","download_url":"https://codeload.github.com/aneeshd16/fb-chatbot/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aneeshd16%2Ffb-chatbot/sbom","scorecard":{"id":195534,"data":{"date":"2025-08-11","repo":{"name":"github.com/aneeshd16/fb-chatbot","commit":"0c05bd79c754986a94b09317d387e9b8c5bbd38f"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":1.3,"checks":[{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Code-Review","score":0,"reason":"Found 0/10 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"SAST","score":0,"reason":"no SAST tool detected","details":["Warn: no pull requests merged into dev branch"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"License","score":0,"reason":"license file not detected","details":["Warn: project does not have a license file"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"Vulnerabilities","score":0,"reason":"10 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GHSA-v88g-cgmw-v5xw","Warn: Project is vulnerable to: GHSA-fjxv-7rqg-78g4","Warn: Project is vulnerable to: GHSA-896r-f27r-55mw","Warn: Project is vulnerable to: GHSA-jf85-cpcp-j695","Warn: Project is vulnerable to: GHSA-p6mc-m468-83gw","Warn: Project is vulnerable to: GHSA-29mw-wpgm-hmr9","Warn: Project is vulnerable to: GHSA-35jh-r3h4-6jhm","Warn: Project is vulnerable to: GHSA-hrpp-h998-j3pp","Warn: Project is vulnerable to: GHSA-p8p7-x288-28g6","Warn: Project is vulnerable to: GHSA-72xf-g2v4-qvf3"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-16T21:45:51.390Z","repository_id":57233614,"created_at":"2025-08-16T21:45:51.390Z","updated_at":"2025-08-16T21:45:51.390Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34093774,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-09T02:00:06.510Z","response_time":63,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-14T09:52:24.856Z","updated_at":"2026-06-09T05:32:00.598Z","avatar_url":"https://github.com/aneeshd16.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# fb-chatbot\r\nNPM module that helps you build a chatbot.\r\n\r\n### Getting Started\r\n1. Follow step 1 from the [Messenger Quickstart](https://developers.facebook.com/docs/messenger-platform/quickstart).\r\n2. Create a black NodeJS app. Add the following code. (Make sure you enter a sane `verify_token`)\r\n  ```\r\n  var fbChatBot = require('fb-chatbot');\r\n  \r\n  var bot = new fbChatBot('/webhook/', 3000, '\u003crandom verify_token\u003e', '', true);\r\n  \r\n  bot.subscribe(function(error, response, body) {\r\n  \tconsole.log(error);\r\n  \tconsole.log(body);\r\n  });\r\n  \r\n  bot.on('message', function(message) {\r\n  \tconsole.log(message);\r\n  });\r\n  ```\r\n3. Deploy on a HTTPS server. [ngrok](https://ngrok.com/) works great for testing, but you can deploy it pretty much anywhere.\r\n4. [Setup your webhook](https://developers.facebook.com/docs/messenger-platform/quickstart#setup_webhook) in your fb developer console on the \"Messenger\" tab. While setting up, enter the correct url and the `verify_token` from your code. When you click on \"Verify and Save\", it should give a success indicator. If not, check that your server is running, and is deployed via HTTPS, and the URL and `verify_token` are correct.\r\n5. Generate a page access token from your developer console on the \"Messenger\" tab. Copy this token. Modify your code to add in this token:\r\n  ```\r\n  var fbChatBot = require('fb-chatbot');\r\n  \r\n  var bot = new fbChatBot('/webhook/', 3000, '\u003crandom verify_token\u003e', '\u003cpage access_token\u003e', true);\r\n  \r\n  bot.subscribe(function(error, response, body) {\r\n  \tconsole.log(error);\r\n  \tconsole.log(body);\r\n  });\r\n  \r\n  bot.on('message', function(message) {\r\n  \tconsole.log(message);\r\n  });\r\n  ```\r\n  Redeploy your server. You do not need to manually subscribe your app.\r\n6. You can now start receiving messages. Send a message to your page, and the message object should appear in your console.\r\n7. Reply to messages. Modify your code to this to reply a standard phrase on every message.\r\n  ```\r\n  var fbChatBot = require('fb-chatbot');\r\n  \r\n  var bot = new fbChatBot('/webhook/', 3000, '\u003crandom verify_token\u003e', '\u003cpage access_token\u003e', true);\r\n  \r\n  bot.subscribe(function(error, response, body) {\r\n  \tconsole.log(error);\r\n  \tconsole.log(body);\r\n  });\r\n  \r\n  bot.on('message', function(message) {\r\n  \tbot.sendTextMessage(message.sender, 'Hello! You are chatting with a bot', function(error, response, body) {\r\n\t\t  console.log(error);\r\n\t\t  console.log(body);\r\n\t  });\r\n  });\r\n  ```\r\n\r\n## How to use\r\n### 1. Initialize\r\n  \r\n  ```\r\n  var fbChatBot = require('fb-chatbot');\r\n  //var bot = new fbChatBot('\u003cwebhook url\u003e', \u003cserver port\u003e, \u003cfb webhook verify token\u003e, \u003cfb page access token\u003e , true); \r\n  var bot = new fbChatBot('/webhook/', 3000, process.env.FB_WEBHOOK_VERIFY_TOKEN, process.env.FB_ACCESS_TOKEN, true); \r\n  ```\r\n### 2. Receive messages\r\nYou can receive messages by listening to specific events:\r\nAny type of message received\r\n\r\n```\r\nbot.on('message', function(message) {\r\n\tconsole.log(message);\r\n});\r\n```\r\n\r\nAny type of message received from specific user\r\n\r\n```\r\n    bot.on('[senderid]-\u003emessage', function(message) {\r\n  \t  console.log(message);\r\n    });\r\n```\r\n    \r\nExample:\r\n\r\n```\r\n    bot.on('111122223333-\u003emessage', function(message) {\r\n  \t  console.log(message);\r\n    });\r\n```\r\n    \r\nAny type of message received for specific page\r\n\r\n```\r\n    bot.on('message-\u003e[page_id]', function(message) {\r\n  \t  console.log(message);\r\n    });\r\n```\r\n\r\nExample:\r\n\r\n```\r\n    bot.on('message-\u003e111122223333', function(message) {\r\n  \t  console.log(message);\r\n    });\r\n```\r\n    \r\nText Message received\r\n\r\n```\r\n    bot.on('text', function(message) {\r\n      console.log(message);\r\n    });\r\n```\r\n  \r\nText message received from specific user\r\n\r\n ```\r\n    bot.on('[senderid]-\u003etext', function(message) {\r\n      console.log(message);\r\n    });\r\n```\r\n    \r\nExample:\r\n\r\n```\r\n    bot.on('111122223333-\u003etext', function(message) {\r\n      console.log(message);\r\n    });\r\n```\r\n    \r\nText message received for specific page\r\n\r\n```\r\n    bot.on('text-\u003e[page_id]', function(message) {\r\n      console.log(message);\r\n    });\r\n```\r\n    \r\nExample:\r\n\r\n```\r\n    bot.on('text-\u003e111122223333', function(message) {\r\n      console.log(message);\r\n    });\r\n```\r\n    \r\nAttachment received\r\n\r\n```\r\n    bot.on('attachment', function(message) {\r\n      console.log(message);\r\n    });\r\n```\r\n  \r\nAttachment received from specific user\r\n\r\n```\r\n    bot.on('[senderid]-\u003eattachment', function(message) {\r\n      console.log(message);\r\n    });\r\n```\r\n    \r\nExample:\r\n\r\n```\r\n    bot.on('111122223333-\u003eattachment', function(message) {\r\n      console.log(message);\r\n    });\r\n```\r\n    \r\nAttachment received for specific page\r\n\r\n```\r\n    bot.on('attachment-\u003e[page_id]', function(message) {\r\n      console.log(message);\r\n    });\r\n```\r\n    \r\nExample:\r\n\r\n```\r\n    bot.on('attachment-\u003e111122223333', function(message) {\r\n      console.log(message);\r\n    });\r\n```\r\n\r\n### 3. Send messages\r\n\r\nMessages are sent using the Facebook Graph API.\r\n```\r\nbot.sendTextMessage(\u003csender\u003e, \u003ctext\u003e)\r\n.then(function(response) {\r\n\t\t\r\n});\r\n```\r\nExample:\r\n```\r\nbot.on('text', function (event) {\r\n  console.log('Text received:' + event.data + ' from:' + event.sender);\r\n  bot.sendTextMessage(event.sender, \"Hello you said \" + event.data)\r\n    .then(function(response) {\r\n\r\n    })\r\n    .catch(function(err) {\r\n\r\n    })\r\n});\r\n```\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faneeshd16%2Ffb-chatbot","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faneeshd16%2Ffb-chatbot","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faneeshd16%2Ffb-chatbot/lists"}