[FIX] Adding a timestamp to the filename to make it possible to send the same file more than once in the same conversation.

This commit is contained in:
Tassio Alves 2025-03-27 10:46:13 -04:00
parent b89f1144b4
commit ce1680f515

View File

@ -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,
});