mirror of
https://github.com/EvolutionAPI/evolution-api.git
synced 2025-07-14 01:41:24 -06:00
fix: Ajusts in sticker message to chatwoot
This commit is contained in:
parent
b77f22790b
commit
f475391ba6
@ -41,6 +41,7 @@ export class InstanceController {
|
||||
chatwoot_url,
|
||||
chatwoot_sign_msg,
|
||||
}: InstanceDto) {
|
||||
try {
|
||||
this.logger.verbose('requested createInstance from ' + instanceName + ' instance');
|
||||
|
||||
if (instanceName !== instanceName.toLowerCase().replace(/[^a-z0-9]/g, '')) {
|
||||
@ -189,6 +190,10 @@ export class InstanceController {
|
||||
webhook_url: `${urlServer}/chatwoot/webhook/${instance.instanceName}`,
|
||||
},
|
||||
};
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
return { error: true, message: error.toString() };
|
||||
}
|
||||
}
|
||||
|
||||
public async connectToWhatsapp({ instanceName, number = null }: InstanceDto) {
|
||||
|
@ -102,7 +102,12 @@ export class RepositoryBroker {
|
||||
this.logger.verbose('creating store path: ' + storePath);
|
||||
|
||||
const tempDir = join(storePath, 'temp');
|
||||
const chatwootDir = join(storePath, 'chatwoot');
|
||||
|
||||
if (!fs.existsSync(chatwootDir)) {
|
||||
this.logger.verbose('creating chatwoot dir: ' + chatwootDir);
|
||||
fs.mkdirSync(chatwootDir, { recursive: true });
|
||||
}
|
||||
if (!fs.existsSync(tempDir)) {
|
||||
this.logger.verbose('creating temp dir: ' + tempDir);
|
||||
fs.mkdirSync(tempDir, { recursive: true });
|
||||
|
@ -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 = {};
|
||||
|
@ -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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user