diff --git a/packages/basic.gblib/services/DialogKeywords.ts b/packages/basic.gblib/services/DialogKeywords.ts index 97d593fa..503addbe 100644 --- a/packages/basic.gblib/services/DialogKeywords.ts +++ b/packages/basic.gblib/services/DialogKeywords.ts @@ -450,6 +450,25 @@ export class DialogKeywords { } } + /** + * Prepares the next dialog to be shown to the specified user. + */ + public async gotoDialog(step, fromOrDialogName: string, dialogName: string) { + if (dialogName) { + let sec = new SecService(); + let user = await sec.getUserFromSystemId(fromOrDialogName); + if (!user) { + user = await sec.ensureUser(this.min.instance.instanceId, fromOrDialogName, + fromOrDialogName, null, 'whatsapp', 'from', null); + } + await sec.updateUserHearOnDialog(user.userId, dialogName); + } + else { + await step.beginDialog(dialogName); + } + } + + /** * Talks to the user by using the specified text. */ diff --git a/packages/basic.gblib/services/GBVMService.ts b/packages/basic.gblib/services/GBVMService.ts index 37b1d9a0..e75dc160 100644 --- a/packages/basic.gblib/services/GBVMService.ts +++ b/packages/basic.gblib/services/GBVMService.ts @@ -242,7 +242,7 @@ export class GBVMService extends GBService { }); code = code.replace(/(go to)(\s)(.*)/gi, ($0, $1, $2, $3) => { - return `sys().gotoDialog(${$3})\n`; + return `sys().gotoDialog(step, ${$3})\n`; }); code = code.replace(/(hear)\s*(\w+)/gi, ($0, $1, $2) => { diff --git a/packages/basic.gblib/services/SystemKeywords.ts b/packages/basic.gblib/services/SystemKeywords.ts index 27591a38..bfc69746 100644 --- a/packages/basic.gblib/services/SystemKeywords.ts +++ b/packages/basic.gblib/services/SystemKeywords.ts @@ -144,17 +144,6 @@ export class SystemKeywords { return data; } - /** - * Prepares the next dialog to be shown to the specified user. - */ - public async gotoDialog(from: string, dialogName: string) { - let sec = new SecService(); - let user = await sec.getUserFromSystemId(from); - if (!user) { - user = await sec.ensureUser(this.min.instance.instanceId, from, from, null, 'whatsapp', 'from', null); - } - await sec.updateUserHearOnDialog(user.userId, dialogName); - } /** * Holds script execution for the number of seconds specified. diff --git a/packages/core.gbapp/services/GBDeployer.ts b/packages/core.gbapp/services/GBDeployer.ts index 6c06b572..d7b3f8d9 100644 --- a/packages/core.gbapp/services/GBDeployer.ts +++ b/packages/core.gbapp/services/GBDeployer.ts @@ -444,6 +444,10 @@ export class GBDeployer implements IGBDeployer { */ public async downloadFolder(min: GBMinInstance, localPath: string, remotePath: string, baseUrl: string = null, client = null): Promise { + + + GBLog.info(`downloadFolder: localPath=${localPath}, remotePath=${remotePath}, baseUrl=${baseUrl}`); + if (!baseUrl) { [baseUrl, client] = await GBDeployer.internalGetDriveClient(min); @@ -469,6 +473,8 @@ export class GBDeployer implements IGBDeployer { const botId = min.instance.botId; const path = urlJoin(`/${botId}.gbai`, remotePath); let url = `${baseUrl}/drive/root:${path}:/children`; + + GBLog.info(`Download URL: ${url}`); const res = await client .api(url) diff --git a/packages/core.gbapp/services/GBMinService.ts b/packages/core.gbapp/services/GBMinService.ts index 3eafbf78..bae373e2 100644 --- a/packages/core.gbapp/services/GBMinService.ts +++ b/packages/core.gbapp/services/GBMinService.ts @@ -894,7 +894,11 @@ export class GBMinService { // Skips if the bot is talking. const startDialog = min.core.getParam(min.instance, 'Start Dialog', null); - if (context.activity.type === 'conversationUpdate' && + if (context.activity.type === 'conversationUpdate') + { + GBLog.info(`Bot installed on Teams.`); + } + else if (context.activity.type === 'conversationUpdate' && context.activity.membersAdded.length > 0) { // Check if a bot or a human participant is being added to the conversation.