mirror of
https://github.com/EvolutionAPI/evolution-api.git
synced 2025-07-22 20:12:02 -06:00
fix: send media message in chatwoot
This commit is contained in:
parent
373268c938
commit
db065ab942
@ -1196,8 +1196,10 @@ export class BaileysStartupService extends ChannelStartupService {
|
||||
}
|
||||
|
||||
if (this.configService.get<Database>('DATABASE').SAVE_DATA.CONTACTS)
|
||||
await this.prismaRepository.contact.create({
|
||||
data: contactRaw,
|
||||
await this.prismaRepository.contact.upsert({
|
||||
where: { remoteJid_instanceId: { remoteJid: contactRaw.remoteJid, instanceId: contactRaw.instanceId } },
|
||||
create: contactRaw,
|
||||
update: contactRaw,
|
||||
});
|
||||
|
||||
return;
|
||||
|
@ -540,7 +540,6 @@ export class ChatwootService {
|
||||
try {
|
||||
this.logger.verbose('--- Start createConversation ---');
|
||||
this.logger.verbose(`Instance: ${JSON.stringify(instance)}`);
|
||||
this.logger.verbose(`Body: ${JSON.stringify(body)}`);
|
||||
|
||||
const client = await this.clientCw(instance);
|
||||
|
||||
@ -1122,7 +1121,7 @@ export class ChatwootService {
|
||||
data.caption = caption;
|
||||
}
|
||||
|
||||
const messageSent = await waInstance?.mediaMessage(data, true);
|
||||
const messageSent = await waInstance?.mediaMessage(data, null, true);
|
||||
|
||||
return messageSent;
|
||||
} catch (error) {
|
||||
|
@ -410,6 +410,7 @@ export class DifyService {
|
||||
media: url,
|
||||
caption: altText,
|
||||
},
|
||||
null,
|
||||
false,
|
||||
);
|
||||
}
|
||||
|
@ -13,7 +13,7 @@ export class EvolutionBotService {
|
||||
private readonly waMonitor: WAMonitoringService,
|
||||
private readonly configService: ConfigService,
|
||||
private readonly prismaRepository: PrismaRepository,
|
||||
) { }
|
||||
) {}
|
||||
|
||||
private readonly logger = new Logger('EvolutionBotService');
|
||||
|
||||
@ -150,20 +150,18 @@ export class EvolutionBotService {
|
||||
delay: settings?.delayMessage || 1000,
|
||||
text: textBuffer.trim(),
|
||||
},
|
||||
false
|
||||
false,
|
||||
);
|
||||
textBuffer = '';
|
||||
}
|
||||
|
||||
if (mediaType === 'audio') {
|
||||
await instance.audioWhatsapp(
|
||||
{
|
||||
number: remoteJid.split('@')[0],
|
||||
delay: settings?.delayMessage || 1000,
|
||||
audio: url,
|
||||
caption: altText,
|
||||
}
|
||||
);
|
||||
await instance.audioWhatsapp({
|
||||
number: remoteJid.split('@')[0],
|
||||
delay: settings?.delayMessage || 1000,
|
||||
audio: url,
|
||||
caption: altText,
|
||||
});
|
||||
} else {
|
||||
await instance.mediaMessage(
|
||||
{
|
||||
@ -173,7 +171,8 @@ export class EvolutionBotService {
|
||||
media: url,
|
||||
caption: altText,
|
||||
},
|
||||
false
|
||||
null,
|
||||
false,
|
||||
);
|
||||
}
|
||||
} else {
|
||||
@ -197,7 +196,7 @@ export class EvolutionBotService {
|
||||
delay: settings?.delayMessage || 1000,
|
||||
text: textBuffer.trim(),
|
||||
},
|
||||
false
|
||||
false,
|
||||
);
|
||||
}
|
||||
|
||||
@ -214,7 +213,6 @@ export class EvolutionBotService {
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
private async initNewSession(
|
||||
instance: any,
|
||||
remoteJid: string,
|
||||
|
@ -171,6 +171,7 @@ export class FlowiseService {
|
||||
media: url,
|
||||
caption: altText,
|
||||
},
|
||||
null,
|
||||
false,
|
||||
);
|
||||
}
|
||||
|
@ -216,6 +216,7 @@ export class OpenaiService {
|
||||
media: url,
|
||||
caption: altText,
|
||||
},
|
||||
null,
|
||||
false,
|
||||
);
|
||||
}
|
||||
|
@ -243,6 +243,7 @@ export class TypebotService {
|
||||
mediatype: 'image',
|
||||
media: message.content.url,
|
||||
},
|
||||
null,
|
||||
false,
|
||||
);
|
||||
|
||||
@ -257,6 +258,7 @@ export class TypebotService {
|
||||
mediatype: 'video',
|
||||
media: message.content.url,
|
||||
},
|
||||
null,
|
||||
false,
|
||||
);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user