Facebook Messenger Bot Message is not coming to server

135
June 09, 2019, at 01:40 AM

I have setup the Facebook Messenger by following correct steps. I could verify the webhook successfully as well as subscribed to the page. But when I am sending a message to the bot, its not coming to the server.

I noticed in the Facebook App settings, the graph API version is 3.3 I have other bot running successfully with v2.9

What can be done to make the bot running?

Webhook successfully registered:

const verifyWebhook = (req, res) => {
    let VERIFY_TOKEN = 'lumicentco';
    let mode = req.query['hub.mode'];
    let token = req.query['hub.verify_token'];
    let challenge = req.query['hub.challenge'];
    if (mode && token === VERIFY_TOKEN) {
        res.status(200).send(challenge);
    } else {
        res.sendStatus(403);
    }
};
module.exports = verifyWebhook;

Message-webhook.js

const processMessage = require('./process-message');
module.exports = (req, res) => {
  if (req.body.object === 'page') {
    req.body.entry.forEach(entry => {
      entry.messaging.forEach(event => {
        if (event.message && event.message.text) {
          processMessage(event);
        }
      });
    });
    res.status(200).end();
  }
};
Rent Charter Buses Company
READ ALSO
FacebookTokenError: This authorization code has been used passport-js

FacebookTokenError: This authorization code has been used passport-js

I have implemented log in with facebook using passportjs

116
Is there a way to refresh static files without server restart?

Is there a way to refresh static files without server restart?

My simple Nodejs app serves static files, e

92
Templating each array with Handlebars and Mongoose

Templating each array with Handlebars and Mongoose

I try to display results with Mongoose and Handlebars but I can'tIs this a problem withe the structure and the fact that the "results" arrays are strangely structured ? I want each object to be displayed in my page

132
MongoDB _id returns undefined on frontend (VueJS)

MongoDB _id returns undefined on frontend (VueJS)

I created a simple fullstack webapp using NodeJS & Express + MongoDB to build the backend API and VueJS for the frontend

115