From be3fb6d51c36e732e13b215c986f8d24687b9c03 Mon Sep 17 00:00:00 2001 From: Ouadie Lahdioui Date: Fri, 15 Dec 2017 00:57:23 +0100 Subject: [PATCH] Add an example of how to use fb insights api --- examples/facebook_bot.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/examples/facebook_bot.js b/examples/facebook_bot.js index 8dc81db1b..917b14d29 100755 --- a/examples/facebook_bot.js +++ b/examples/facebook_bot.js @@ -488,6 +488,11 @@ controller.hears(['send tagged message'], 'message_received', function (bot, mes bot.reply(message, taggedMessage); }); +controller.hears(['insights'], 'message_received', function (bot, message) { + controller.api.insights.get_insights(['page_messages_active_threads_unique', 'page_messages_blocked_conversations_unique'], null, null, function (err, body) { + bot.reply(message, JSON.stringify(body.data)); + }); +}); function formatUptime(uptime) { var unit = 'second';