mirror of
https://github.com/EvolutionAPI/evolution-api.git
synced 2025-12-27 15:47:45 -06:00
fix: Corregir manejo de archivo de audio en WhatsApp
This commit is contained in:
@@ -483,7 +483,12 @@ export class EvolutionStartupService extends ChannelStartupService {
|
||||
public async audioWhatsapp(data: SendAudioDto, file?: any, isIntegration = false) {
|
||||
const mediaData: SendAudioDto = { ...data };
|
||||
|
||||
if (file) mediaData.audio = file.buffer.toString('base64');
|
||||
if (file?.buffer) {
|
||||
mediaData.audio = file.buffer.toString('base64');
|
||||
} else {
|
||||
console.error("El archivo o buffer no est<73> definido correctamente.");
|
||||
throw new Error("File or buffer is undefined.");
|
||||
}
|
||||
|
||||
const message = await this.processAudio(mediaData.audio, data.number);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user