new(core.gbapp): New keywords USERNAME MOBILE.

This commit is contained in:
Rodrigo Rodriguez 2020-07-07 10:15:39 -03:00
parent 9759797036
commit 92439d6bf6
2 changed files with 20 additions and 1 deletions

View file

@ -356,6 +356,23 @@ export class DialogClass {
return step.context.activity.from.id;
}
public async getUserName(step) {
return step.context.activity.from.name;
}
public async getUserMobile(step) {
if (isNaN(step.context.activity.from.id))
{
return ('No mobile available.');
}
else
{
return (step.context.activity.from.id);
}
}
public async askEmail(step) {
return await step.beginDialog('/gbasic-email');
}

View file

@ -157,7 +157,8 @@ export class GBVMService extends GBService {
from = this.getFrom(step)
today = this.getToday(step)
id = sys().getRandomId()
username = this.getUserName();
mobile = this.getUserMobile();
${code}
`;
@ -169,6 +170,7 @@ export class GBVMService extends GBService {
code = code.replace(/(hear)\s*(\w+)/gi, ($0, $1, $2) => {
return `${$2} = hear()`;
});
code = code.replace(/(\w)\s*\=\s*find\s*(.*)/gi, ($0, $1, $2, $3) => {
return `${$1} = sys().find(${$2})\n`;
});