fix(DialogKeywords): update file writing method and adjust WhatsApp file sending logic
All checks were successful
GBCI / build (push) Successful in 35s
All checks were successful
GBCI / build (push) Successful in 35s
This commit is contained in:
parent
d55a16aa80
commit
47e3c7648b
1 changed files with 3 additions and 3 deletions
|
@ -1521,7 +1521,7 @@ export class DialogKeywords {
|
|||
'cache',
|
||||
`${fileOnly.replace(/\s/gi, '')}-${GBAdminService.getNumberIdentifier()}.${ext}`
|
||||
);
|
||||
await fs.writeFile(localName, buf, { encoding: null });
|
||||
await fs.writeFile(localName, new Uint8Array(buf), { encoding: null });
|
||||
|
||||
url = urlJoin(GBServer.globals.publicAddress, min.botId, 'cache', path.basename(localName));
|
||||
} else if (GBConfigService.get('GB_MODE') === 'gbcluster') {
|
||||
|
@ -1616,8 +1616,8 @@ export class DialogKeywords {
|
|||
contentUrl: url
|
||||
});
|
||||
|
||||
if (channel === 'omnichannel' || !user) {
|
||||
await min.conversationalService.sendFile(min, null, mobile, url, caption);
|
||||
if (!isNaN(mobile)) {
|
||||
await min.whatsAppDirectLine.sendFileToDevice(mobile, url, filename, caption, undefined, true);
|
||||
} else {
|
||||
await min.conversationalService['sendOnConversation'](min, user, reply);
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue