fix(core.gbapp): EXIT keyword.
This commit is contained in:
parent
4ab34f18ac
commit
3906c3de53
3 changed files with 12 additions and 0 deletions
|
@ -482,6 +482,9 @@ export class DialogClass {
|
||||||
public async isAffirmative(step, text) {
|
public async isAffirmative(step, text) {
|
||||||
return text.toLowerCase().match(Messages[step.context.activity.locale].affirmative_sentences);
|
return text.toLowerCase().match(Messages[step.context.activity.locale].affirmative_sentences);
|
||||||
}
|
}
|
||||||
|
public async exit(step) {
|
||||||
|
await step.endDialog();
|
||||||
|
}
|
||||||
|
|
||||||
public async getNow(step) {
|
public async getNow(step) {
|
||||||
const nowUTC = new Date();
|
const nowUTC = new Date();
|
||||||
|
|
|
@ -212,6 +212,10 @@ export class GBVMService extends GBService {
|
||||||
return `transfer (step)\n`;
|
return `transfer (step)\n`;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
code = code.replace(/(exit)/gi, () => {
|
||||||
|
return `exit (step)\n`;
|
||||||
|
});
|
||||||
|
|
||||||
code = code.replace(/(talk to)(\s)(.*)/gi, ($0, $1, $2, $3) => {
|
code = code.replace(/(talk to)(\s)(.*)/gi, ($0, $1, $2, $3) => {
|
||||||
return `sys().talkTo(${$3})\n`;
|
return `sys().talkTo(${$3})\n`;
|
||||||
});
|
});
|
||||||
|
@ -382,6 +386,9 @@ export class GBVMService extends GBService {
|
||||||
code = code.replace(/("[^"]*"|'[^']*')|\btransfer\b/gi, ($0, $1) => {
|
code = code.replace(/("[^"]*"|'[^']*')|\btransfer\b/gi, ($0, $1) => {
|
||||||
return $1 === undefined ? 'this.transfer' : $1;
|
return $1 === undefined ? 'this.transfer' : $1;
|
||||||
});
|
});
|
||||||
|
code = code.replace(/("[^"]*"|'[^']*')|\bexit\b/gi, ($0, $1) => {
|
||||||
|
return $1 === undefined ? 'this.exit' : $1;
|
||||||
|
});
|
||||||
|
|
||||||
// await insertion.
|
// await insertion.
|
||||||
|
|
||||||
|
|
|
@ -93,6 +93,8 @@ export class AskDialog extends IGBDialog {
|
||||||
text = Messages[locale].ask_first_time;
|
text = Messages[locale].ask_first_time;
|
||||||
} else if (step.options && step.options.isReturning) {
|
} else if (step.options && step.options.isReturning) {
|
||||||
text = Messages[locale].anything_else;
|
text = Messages[locale].anything_else;
|
||||||
|
} else if (step.options && step.options.emptyPrompt) {
|
||||||
|
text = "";
|
||||||
} else if (user.subjects.length > 0) {
|
} else if (user.subjects.length > 0) {
|
||||||
text = Messages[locale].which_question;
|
text = Messages[locale].which_question;
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Add table
Reference in a new issue