bootbot
bootbot copied to clipboard
Integration into gcloud remote function
Hi Team,
I need a solution to work with FB messenger and deploy on firebase functions. It is possible to deploy express apps to functions like explained here: https://codeburst.io/express-js-on-cloud-functions-for-firebase-86ed26f9144c
I can not find a way to call the bot from within a cloud function.
any clue?
const functions = require("firebase-functions") const BootBot = require('bootbot');
const bot = new BootBot({ accessToken: '...', verifyToken: '...', appSecret: '...' });
bot.on('message', (payload, chat) => {
const text = payload.message.text;
chat.say(Echo: ${text}
);
});
-- > not working //bot._initWebhook(); // const api2 = functions.https.onRequest(bot.app); // module.exports = { // api2 // }
-- > working bot.start();