We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b155447 commit 36fee5aCopy full SHA for 36fee5a
labs/07-nlp-with-luis/bot.js
@@ -43,13 +43,13 @@ class LuisBot {
43
44
// check if the entity found is the one we are looking for
45
// this is usually only necessary if there are more then one entity in an intent
46
- if(entities[0].type == "Product") {
+ if(entities.length > 0 && entities[0].type == "Product") {
47
// we found a product
48
var product = entities[0].entity;
49
await turnContext.sendActivity(`Your ordered ${ product }`);
50
} else {
51
// we found nothing
52
- await turnContext.sendActivity(`Your ordered nothing`);
+ await turnContext.sendActivity(`I do not know what you ordered.`);
53
}
54
55
0 commit comments