new(whatsapp.gblib): New WhatsApp provider: Meta.
This commit is contained in:
parent
a8099c5f97
commit
6130f01565
2 changed files with 14 additions and 1 deletions
|
@ -612,6 +612,19 @@ export class DialogKeywords {
|
||||||
return await this.internalSendFile({ pid, mobile, channel: proc.channel, filename, caption });
|
return await this.internalSendFile({ pid, mobile, channel: proc.channel, filename, caption });
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sends a template to a given mobile.
|
||||||
|
*
|
||||||
|
* @example SEND TEMPLATE TO "+199988887777","image.jpg"
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public async sendTemplateTo({ pid, mobile, filename: text}) {
|
||||||
|
const { min, user, proc } = await DialogKeywords.getProcessInfo(pid);
|
||||||
|
GBLogEx.info(min, `BASIC: SEND TEMPLATE TO '${mobile}',filename '${text}'.`);
|
||||||
|
const service = new GBConversationalService(min.core);
|
||||||
|
return await service.fillAndBroadcastTemplate(min, mobile, text);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sends a file to the current user.
|
* Sends a file to the current user.
|
||||||
*
|
*
|
||||||
|
|
|
@ -1028,7 +1028,7 @@ export class KeywordsExpressions {
|
||||||
/^\s*(send template to)(\s*)(.*)/gim,
|
/^\s*(send template to)(\s*)(.*)/gim,
|
||||||
($0, $1, $2, $3) => {
|
($0, $1, $2, $3) => {
|
||||||
const params = this.getParams($3, ['mobile', 'text']);
|
const params = this.getParams($3, ['mobile', 'text']);
|
||||||
return `await dk.fillAndBroadcastTemplate({pid: pid, ${params}})`;
|
return `await dk.sendTemplateTo({pid: pid, ${params}})`;
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue