Made a few more commands

This commit is contained in:
Daniel Løvbrøtte Olsen 2016-08-13 14:35:16 +02:00 committed by GitHub
parent 92cf8e10f3
commit 248ee63072

View File

@ -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");
});
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!");
}));