Auto-dispatch to dialog based on intent name.
This commit is contained in:
parent
3b6edd4f3a
commit
b7b62c0642
2 changed files with 8 additions and 4 deletions
|
@ -1,6 +1,7 @@
|
||||||
## Version 0.0.20
|
## Version 0.0.20
|
||||||
|
|
||||||
- NEW: Whatsapp directline client is now working in preview.
|
- NEW: Whatsapp directline client is now working in preview.
|
||||||
|
- NEW: Auto-dispatch to dialog based on intent name.
|
||||||
|
|
||||||
## Version 0.0.19
|
## Version 0.0.19
|
||||||
|
|
||||||
|
|
|
@ -104,10 +104,13 @@ export class GBConversationalService implements IGBConversationalService {
|
||||||
} else if (intent === "ShowSubjectMenu") {
|
} else if (intent === "ShowSubjectMenu") {
|
||||||
session.replaceDialog("/menu");
|
session.replaceDialog("/menu");
|
||||||
} else {
|
} else {
|
||||||
// TODO testar diálogos v2
|
try {
|
||||||
// inclui diálogo
|
session.replaceDialog("/" + intent);
|
||||||
session.sendTyping();
|
} catch (error) {
|
||||||
session.send("Desculpe-me, não encontrei nada a respeito...");
|
logger.trace("error: intent: [" + intent + "] error: [" + error + "]");
|
||||||
|
session.sendTyping();
|
||||||
|
session.send("Desculpe-me, não encontrei nada a respeito...");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
cb({ intent, entities }, null);
|
cb({ intent, entities }, null);
|
||||||
|
|
Loading…
Add table
Reference in a new issue