Skip to content

Commit

Permalink
Update README to latest changes
Browse files Browse the repository at this point in the history
  • Loading branch information
pcostantini committed May 16, 2017
1 parent 94f8957 commit 197a91f
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions Node/demo-ContosoFlowers/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -139,9 +139,15 @@ var EmailRegex = new RegExp(/[a-z0-9!#$%&'*+\/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+\/
var lib = new builder.Library('validators');

lib.dialog('email',
builder.DialogAction.validatedPrompt(builder.PromptType.text, function (response) {
return EmailRegex.test(response);
}));
new builder.IntentDialog()
.onBegin(function (session, args) {
session.dialogData.retryPrompt = args.retryPrompt;
session.send(args.prompt);
}).matches(EmailRegex, function (session) {
session.endDialogWithResult({ response: session.message.text });
}).onDefault(function (session) {
session.send(session.dialogData.retryPrompt);
}));

// Export createLibrary() function
module.exports.createLibrary = function () {
Expand Down

0 comments on commit 197a91f

Please sign in to comment.