Skip to content
This repository has been archived by the owner on Sep 20, 2024. It is now read-only.

Commit

Permalink
Add an example of how to use fb insights api
Browse files Browse the repository at this point in the history
  • Loading branch information
ouadie-lahdioui committed Dec 14, 2017
1 parent 30481c2 commit be3fb6d
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions examples/facebook_bot.js
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down

0 comments on commit be3fb6d

Please sign in to comment.