Skip to content

Commit d309ede

Browse files
committed
fix: fixed message with undefind in chatwoot
1 parent 834a80c commit d309ede

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/whatsapp/services/chatwoot.service.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -819,6 +819,10 @@ export class ChatwootService {
819819

820820
const bodyMessage = await this.getConversationMessage(body.message);
821821

822+
if (!bodyMessage) {
823+
return;
824+
}
825+
822826
if (isMedia) {
823827
const downloadBase64 = await waInstance?.getBase64FromMediaMessage({
824828
message: {
@@ -839,7 +843,7 @@ export class ChatwootService {
839843

840844
writeFileSync(fileName, fileData, 'utf8');
841845

842-
if (body.key.remoteJid.includes('@g.us')) {
846+
if (body.key.remoteJid.includes('@g.us') && !body.key.fromMe) {
843847
const participantName = body.pushName;
844848

845849
const content = `**${participantName}**\n\n${bodyMessage}`;

0 commit comments

Comments
 (0)