Closed vijayrajasekaran closed 6 years ago
Take a look at the discussion here https://github.com/Charca/bootbot/issues/94
I will try to get that implemented ASAP. It shouldn't be very much work.
Pretty much, you would create your bot and never bot.start()
it. You could use the bot.handleFacebookMessage(msg)
method to process and respond with the messages you receive on your sails.js controller (or whatever it's called).
I highly recommend also processing the message with your own verifySignatureRequest
function or you could be vulnerable to hacks/timing attacks. Here's bootbot's implementation (could be copy pasted even) https://github.com/Charca/bootbot/blob/master/lib/BootBot.js#L457-L473.
Thank you so much. I will wait for this to get implemented as using bot.hear and chat.say is simple and easy. :)
It works fine. 👍
/* Receive Data from FB Messenger */
const data = req.body;
bot.on('message', (payload, chat) => {
const text = payload.message.text;
chat.say(`The user said: ${text}`);
return res.ok();
});
bot.handleFacebookData(data);
Hello,
I would like to use BootBot with Sails.js since it comes with lot of features. I have the server configured with routes, webhook. I would like to use BootBot without it starting another server with bot.start();
Thanks.