fix(all): Corrected mobile number to WhatsApp while output md.
This commit is contained in:
parent
95524a902c
commit
9257ac7271
2 changed files with 5 additions and 5 deletions
|
@ -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(
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Add table
Reference in a new issue