diff --git a/dodsorfas/Skypebot/app.js b/dodsorfas/Skypebot/app.js index 9430ed1..9eaac07 100644 --- a/dodsorfas/Skypebot/app.js +++ b/dodsorfas/Skypebot/app.js @@ -18,7 +18,22 @@ var bot = new builder.UniversalBot(connector); server.post('/api/messages', connector.listen()); // Bot Dialogs +var texts = {}; +texts.help = "Hey there! My available commands are:\n\n\ +about - Gives you information about the bot\n\n\ +ping - pong!\n\n\ +"; -bot.dialog('/', function(session) { - session.send("Hello World"); -}); \ No newline at end of file +bot.dialog('/', new builder.IntentDialog() + .matches(/^ping/i, function(session) { + session.send("pong"); + }) + .matches(/^about/i, function(session) { + session.send("I am a general purpose bot created by Daniel, "); + }) + .matches(/^help/i, function(session) { + session.send(texts.help); + }) + .onDefault(function(session) { + session.send("I didn't understand. Say 'help' to get a list of commands!"); + }));