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

Commit be3fb6d

Browse files
Add an example of how to use fb insights api
1 parent 30481c2 commit be3fb6d

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

examples/facebook_bot.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -488,6 +488,11 @@ controller.hears(['send tagged message'], 'message_received', function (bot, mes
488488
bot.reply(message, taggedMessage);
489489
});
490490

491+
controller.hears(['insights'], 'message_received', function (bot, message) {
492+
controller.api.insights.get_insights(['page_messages_active_threads_unique', 'page_messages_blocked_conversations_unique'], null, null, function (err, body) {
493+
bot.reply(message, JSON.stringify(body.data));
494+
});
495+
});
491496

492497
function formatUptime(uptime) {
493498
var unit = 'second';

0 commit comments

Comments
 (0)