fix(core.gbapp): Auto start for whatsapp OK.
This commit is contained in:
parent
94e791ca71
commit
9cb4d11505
1 changed files with 18 additions and 9 deletions
|
@ -314,8 +314,8 @@ export class GBMinService {
|
||||||
activeMin.core.getParam(activeMin.instance, 'Start Dialog', null);
|
activeMin.core.getParam(activeMin.instance, 'Start Dialog', null);
|
||||||
|
|
||||||
if (startDialog) {
|
if (startDialog) {
|
||||||
GBLog.info(`Calling /call to Auto start ${startDialog} for ${activeMin.instance.instanceId}...`);
|
GBLog.info(`Calling /start to Auto start ${startDialog} for ${activeMin.instance.instanceId}...`);
|
||||||
req.body.messages[0].body = `/call ${startDialog}`;
|
req.body.messages[0].body = `/start`;
|
||||||
|
|
||||||
// Resets HEAR ON DIALOG value to none and passes
|
// Resets HEAR ON DIALOG value to none and passes
|
||||||
// current dialog to the direct line.
|
// current dialog to the direct line.
|
||||||
|
@ -345,8 +345,8 @@ export class GBMinService {
|
||||||
|
|
||||||
|
|
||||||
if (startDialog) {
|
if (startDialog) {
|
||||||
GBLog.info(`Calling /call for Auto start : ${startDialog} for ${activeMin.instance.botId}...`);
|
GBLog.info(`Calling /start for Auto start : ${startDialog} for ${activeMin.instance.botId}...`);
|
||||||
req.body.messages[0].body = `/call ${startDialog}`;
|
req.body.messages[0].body = `/start`;
|
||||||
await (activeMin as any).whatsAppDirectLine.received(req, res);
|
await (activeMin as any).whatsAppDirectLine.received(req, res);
|
||||||
} else {
|
} else {
|
||||||
await (activeMin as any).whatsAppDirectLine.sendToDevice(
|
await (activeMin as any).whatsAppDirectLine.sendToDevice(
|
||||||
|
@ -866,10 +866,18 @@ export class GBMinService {
|
||||||
|
|
||||||
await step.beginDialog('/');
|
await step.beginDialog('/');
|
||||||
}
|
}
|
||||||
else {
|
|
||||||
|
|
||||||
GBLog.info(`Member added to conversation: ${member.name}`);
|
} else {
|
||||||
}
|
GBLog.info(`Person added to conversation: ${member.name}`);
|
||||||
|
|
||||||
|
if (this.userMobile(step)) {
|
||||||
|
const startDialog = min.core.getParam(min.instance, 'Start Dialog', null);
|
||||||
|
if (startDialog && !user.welcomed) {
|
||||||
|
user.welcomed = true;
|
||||||
|
GBLog.info(`Auto start (whatsapp) dialog is now being called: ${startDialog} for ${min.instance.instanceId}...`);
|
||||||
|
await GBVMService.callVM(startDialog.toLowerCase(), min, step, this.deployer);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
} else if (context.activity.type === 'message') {
|
} else if (context.activity.type === 'message') {
|
||||||
|
@ -1006,8 +1014,9 @@ export class GBMinService {
|
||||||
const cmdOrDialogName = parts[0];
|
const cmdOrDialogName = parts[0];
|
||||||
parts.splice(0, 1);
|
parts.splice(0, 1);
|
||||||
const args = parts.join(' ');
|
const args = parts.join(' ');
|
||||||
|
if (cmdOrDialogName === '/start') {
|
||||||
if (cmdOrDialogName === '/call') {
|
// TODO: Args to BASIC.
|
||||||
|
} else if (cmdOrDialogName === '/call') {
|
||||||
await GBVMService.callVM(args, min, step, this.deployer);
|
await GBVMService.callVM(args, min, step, this.deployer);
|
||||||
} else {
|
} else {
|
||||||
await step.beginDialog(cmdOrDialogName, { args: args });
|
await step.beginDialog(cmdOrDialogName, { args: args });
|
||||||
|
|
Loading…
Add table
Reference in a new issue