diff --git a/packages/basic.gblib/services/DialogKeywords.ts b/packages/basic.gblib/services/DialogKeywords.ts index 4b6cddab..6d49dbed 100644 --- a/packages/basic.gblib/services/DialogKeywords.ts +++ b/packages/basic.gblib/services/DialogKeywords.ts @@ -315,6 +315,8 @@ export class DialogKeywords { * */ public async sendFile(step, filename, caption) { + const mobile = this.userMobile(step); + GBLog.info(`BASIC: SEND FILE (current: ${mobile}', filename '${filename}'.`); return await this.internalSendFile(step, null, filename, caption); } @@ -505,7 +507,7 @@ export class DialogKeywords { } await this.min.conversationalService['playMarkdown'](this.min, md, - DialogKeywords.getChannel(step), step); + DialogKeywords.getChannel(step), step, mobile); } else { GBLog.info(`BASIC: Sending the file ${filename} to mobile ${mobile}.`); const url = urlJoin( diff --git a/packages/core.gbapp/services/GBConversationalService.ts b/packages/core.gbapp/services/GBConversationalService.ts index e7f4c806..f7725aee 100644 --- a/packages/core.gbapp/services/GBConversationalService.ts +++ b/packages/core.gbapp/services/GBConversationalService.ts @@ -373,7 +373,8 @@ export class GBConversationalService { min: GBMinInstance, answer: string, channel: string, - step: GBDialogStep + step: GBDialogStep, + mobile: string ) { const user = await min.userProfile.get(step.context, {}); @@ -420,12 +421,9 @@ export class GBConversationalService { // MSFT Translator breaks markdown, so we need to fix it: text = text.replace('! [', '![').replace('] (', ']('); - text = text.replace(`[[embed url=`, process.env.BOT_URL + '/').replace(']]', ''); // TODO: Improve it. text = text.replace(`](kb`, "](" + process.env.BOT_URL + '/kb'); // TODO: Improve it. - // According to the channel, formats the output optimized to it. - const mobile = this.userMobile(step); if (mobile) { await this.sendMarkdownToMobile(min, step, mobile, text);