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

Commit

Permalink
Add some exampls of how using tags
Browse files Browse the repository at this point in the history
  • Loading branch information
ouadie-lahdioui committed Aug 17, 2017
1 parent aaecd39 commit 054603f
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions examples/facebook_bot.js
Original file line number Diff line number Diff line change
Expand Up @@ -470,6 +470,22 @@ controller.on('message_received', function(bot, message) {
return false;
});

controller.hears(['tags'], 'message_received', function (bot, message) {
controller.api.tags.get_all(function (tags) {
for (var i = 0; i < tags.data.length; i++) {
bot.reply(message, tags.data[i].tag + ': ' + tags.data[i].description);
}
});
});

controller.hears(['send tagged message'], 'message_received', function (bot, message) {
var taggedMessage = {
"text": "Hello Botkit !",
"tag": "RESERVATION_UPDATE"
};
bot.reply(message, taggedMessage);
});


function formatUptime(uptime) {
var unit = 'second';
Expand Down

0 comments on commit 054603f

Please sign in to comment.