From bfba702fded852877183a8c3db89f58af5231c6c Mon Sep 17 00:00:00 2001 From: MarksonSolutions Date: Fri, 20 Dec 2024 16:00:15 -0400 Subject: [PATCH] send audio using sendWhatsAppAudio route, wabussines --- .../integrations/channel/meta/whatsapp.business.service.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/api/integrations/channel/meta/whatsapp.business.service.ts b/src/api/integrations/channel/meta/whatsapp.business.service.ts index 921d0e6d4..170410663 100644 --- a/src/api/integrations/channel/meta/whatsapp.business.service.ts +++ b/src/api/integrations/channel/meta/whatsapp.business.service.ts @@ -1100,7 +1100,11 @@ export class BusinessStartupService extends ChannelStartupService { if (file?.buffer) { mediaData.audio = file.buffer.toString('base64'); - } else { + } + else if(isURL(mediaData.audio)){ + mediaData.audio = mediaData.audio + } + else { console.error('El archivo no tiene buffer o file es undefined'); throw new Error('File or buffer is undefined'); }