fix: Ajusts in sticker message to chatwoot

This commit is contained in:
Davidson Gomes
2023-07-24 20:32:15 -03:00
parent b77f22790b
commit f475391ba6
4 changed files with 141 additions and 136 deletions

View File

@@ -1179,7 +1179,7 @@ export class ChatwootService {
videoMessage: msg.videoMessage?.caption,
extendedTextMessage: msg.extendedTextMessage?.text,
messageContextInfo: msg.messageContextInfo?.stanzaId,
stickerMessage: msg.stickerMessage?.fileSha256.toString('base64'),
stickerMessage: undefined,
documentMessage: msg.documentMessage?.caption,
documentWithCaptionMessage:
msg.documentWithCaptionMessage?.message?.documentMessage?.caption,
@@ -1199,10 +1199,6 @@ export class ChatwootService {
const result = typeKey ? types[typeKey] : undefined;
if (typeKey === 'stickerMessage') {
return null;
}
if (typeKey === 'contactMessage') {
const vCardData = result.split('\n');
const contactInfo = {};

View File

@@ -116,16 +116,15 @@ import { useMultiFileAuthStateDb } from '../../utils/use-multi-file-auth-state-d
import Long from 'long';
import { WebhookRaw } from '../models/webhook.model';
import { ChatwootRaw } from '../models/chatwoot.model';
import { SettingsRaw } from '../models';
import { dbserver } from '../../db/db.connect';
import NodeCache from 'node-cache';
import { useMultiFileAuthStateRedisDb } from '../../utils/use-multi-file-auth-state-redis-db';
import sharp from 'sharp';
import { RedisCache } from '../../db/redis.client';
import { Log } from '../../config/env.config';
import ProxyAgent from 'proxy-agent';
import { ChatwootService } from './chatwoot.service';
import { waMonitor } from '../whatsapp.module';
import { SettingsRaw } from '../models';
export class WAStartupService {
constructor(
@@ -382,7 +381,7 @@ export class WAStartupService {
if (!data) {
this.logger.verbose('Settings not found');
throw new NotFoundException('Settings not found');
return null;
}
this.logger.verbose(`Settings url: ${data.reject_call}`);
@@ -1129,7 +1128,7 @@ export class WAStartupService {
received.messageTimestamp = received.messageTimestamp?.toNumber();
}
if (settings.groups_ignore && received.key.remoteJid.includes('@g.us')) {
if (settings?.groups_ignore && received.key.remoteJid.includes('@g.us')) {
this.logger.verbose('group ignored');
return;
}