fix: fixed message with undefind in chatwoot

This commit is contained in:
Davidson Gomes 2023-07-13 17:31:15 -03:00
parent 834a80c35a
commit d309ede623

View File

@ -819,6 +819,10 @@ export class ChatwootService {
const bodyMessage = await this.getConversationMessage(body.message); const bodyMessage = await this.getConversationMessage(body.message);
if (!bodyMessage) {
return;
}
if (isMedia) { if (isMedia) {
const downloadBase64 = await waInstance?.getBase64FromMediaMessage({ const downloadBase64 = await waInstance?.getBase64FromMediaMessage({
message: { message: {
@ -839,7 +843,7 @@ export class ChatwootService {
writeFileSync(fileName, fileData, 'utf8'); writeFileSync(fileName, fileData, 'utf8');
if (body.key.remoteJid.includes('@g.us')) { if (body.key.remoteJid.includes('@g.us') && !body.key.fromMe) {
const participantName = body.pushName; const participantName = body.pushName;
const content = `**${participantName}**\n\n${bodyMessage}`; const content = `**${participantName}**\n\n${bodyMessage}`;