new(kb.gbapp): Whenever the bot is called with no text, start will be called.

This commit is contained in:
Rodrigo Rodriguez 2021-01-24 08:33:10 -03:00
parent e8fc5dff63
commit d3f0ef4de0

View file

@ -153,9 +153,19 @@ export class AskDialog extends IGBDialog {
let text = step.options.query;
text = text.replace(/<([^>]+?)([^>]*?)>(.*?)<\/\1>/gi, '');
// When no text is typed, the start dialog is invoked again
// when people type just the @botName in MSTEAMS for example.
if (!text) {
throw new Error(`/answer being called with no args query text.`);
const startDialog =
min.core.getParam(min.instance, 'Start Dialog', null);
await GBVMService.callVM(startDialog.toLowerCase(), min, step, this.deployer);
return step.endDialog();
}
const locale = step.context.activity.locale;
// Stops any content on projector.