From ce1680f51556aaa20c02a1ebef03050dfedf5af7 Mon Sep 17 00:00:00 2001 From: Tassio Alves Date: Thu, 27 Mar 2025 10:46:13 -0400 Subject: [PATCH] [FIX] Adding a timestamp to the filename to make it possible to send the same file more than once in the same conversation. --- .../integrations/channel/whatsapp/whatsapp.baileys.service.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/api/integrations/channel/whatsapp/whatsapp.baileys.service.ts b/src/api/integrations/channel/whatsapp/whatsapp.baileys.service.ts index bafefa18..72c0d9de 100644 --- a/src/api/integrations/channel/whatsapp/whatsapp.baileys.service.ts +++ b/src/api/integrations/channel/whatsapp/whatsapp.baileys.service.ts @@ -1330,7 +1330,7 @@ export class BaileysStartupService extends ChannelStartupService { const { buffer, mediaType, fileName, size } = media; const mimetype = mimeTypes.lookup(fileName).toString(); - const fullName = join(`${this.instance.id}`, received.key.remoteJid, mediaType, fileName); + const fullName = join(`${this.instance.id}`, received.key.remoteJid, mediaType, `${Date.now()}_${fileName}`); await s3Service.uploadFile(fullName, buffer, size.fileLength?.low, { 'Content-Type': mimetype, });