Note: This document refers to a feature that was removed after Graph API v2.10.
Part 1: Goto your Facebook app (https://developers.facebook.com/apps)
Request permission for following manage_pages,publish_pages,read_page_mailboxes,pages_messaging,pages_messaging_subscriptions
Part 2: update your facebook messenger code as following:(https://github.com/fbsamples/messenger-platform-samples)
Important note before copying the code: Don’t private reply to all the comments. Make sure you add some filters else be ready to receive a warning from FB (May suspend your app as well!!!)
app.post('/webhook', function (req, res) {var data = req.body;// Make sure this is a page subscriptionif (data.object == 'page') {// Iterate over each entrydata.entry.forEach(function(pageEntry) {//Newsfeed changes webhook request
if(pageEntry.hasOwnProperty('changes')){pageEntry.changes.forEach(function(changes){if(changes.field=="feed" && changes.value.item=="comment" && changes.value.verb=="add"){var messageData = {message: "hello"};
NOTE: Please check below if you are looking out for an open source FB/Twitter Chatbot connector.
iconicbot/iconic-narada_Open Source Webhook Boilerplate for Social Media/Messaging Platforms(Facebook, Facebook Messenger, Twitter, Twitter…_github.com