Created
July 8, 2017 13:20
-
-
Save jazzedge/daddffcb96a59ca04908c631e1b39ef7 to your computer and use it in GitHub Desktop.
Bot Recognizer
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Setup help system | |
bot.recognizer(new builder.RegExpRecognizer('HelpIntent', /^(help|options)/i)); | |
bot.dialog('helpDialog', function (session, args) { | |
switch (args.action) { | |
default: | |
// args.action is '*:/help' indicating the triggerAction() was matched | |
session.endDialog("You can say 'flip a coin' or 'roll dice'."); | |
break; | |
case 'flipCoinHelp': | |
session.endDialog("Say 'heads' or 'tails'."); | |
break; | |
case 'rollDiceHelp': | |
session.endDialog("Say the number of dice you'd like rolled."); | |
break; | |
} | |
}).triggerAction({ matches: 'HelpIntent' }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment