Skip to content

Commit 5acd7a9

Browse files
matheusmartinsInspermatheusmartinsInsper
authored andcommitted
[FIX] Adding a timestamp to the filename to make it possible to send the same file more than once in the same conversation.
1 parent 0136815 commit 5acd7a9

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/api/integrations/channel/whatsapp/whatsapp.baileys.service.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1068,7 +1068,7 @@ export class BaileysStartupService extends ChannelStartupService {
10681068

10691069
const { buffer, mediaType, fileName, size } = media;
10701070
const mimetype = mimeTypes.lookup(fileName).toString();
1071-
const fullName = join(`${this.instance.id}`, received.key.remoteJid, mediaType, fileName);
1071+
const fullName = join(`${this.instance.id}`, received.key.remoteJid, mediaType, `${Date.now()}_${fileName}`);
10721072
await s3Service.uploadFile(fullName, buffer, size.fileLength?.low, {
10731073
'Content-Type': mimetype,
10741074
});

0 commit comments

Comments
 (0)