Skip to content

Commit ce1680f

Browse files
author
Tassio Alves
committed
[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 b89f114 commit ce1680f

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
@@ -1330,7 +1330,7 @@ export class BaileysStartupService extends ChannelStartupService {
13301330

13311331
const { buffer, mediaType, fileName, size } = media;
13321332
const mimetype = mimeTypes.lookup(fileName).toString();
1333-
const fullName = join(`${this.instance.id}`, received.key.remoteJid, mediaType, fileName);
1333+
const fullName = join(`${this.instance.id}`, received.key.remoteJid, mediaType, `${Date.now()}_${fileName}`);
13341334
await s3Service.uploadFile(fullName, buffer, size.fileLength?.low, {
13351335
'Content-Type': mimetype,
13361336
});

0 commit comments

Comments
 (0)