mirror of
https://github.com/EvolutionAPI/evolution-api.git
synced 2025-12-09 01:49:37 -06:00
fix(baileys): corrigir verificação de mensagem no serviço Baileys
- Ajustada a lógica de verificação para garantir que o ID da mensagem seja definido apenas quando disponível, evitando possíveis erros de referência. - Atualizada a definição do caminho de traduções para suportar a estrutura de diretórios em produção.
This commit is contained in:
parent
22465c0a56
commit
c31b62fb3d
@ -1498,7 +1498,10 @@ export class BaileysStartupService extends ChannelStartupService {
|
|||||||
`) as any[];
|
`) as any[];
|
||||||
findMessage = messages[0] || null;
|
findMessage = messages[0] || null;
|
||||||
|
|
||||||
if (findMessage) message.messageId = findMessage.id;
|
if (!findMessage?.id) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
message.messageId = findMessage.id;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (update.message === null && update.status === undefined) {
|
if (update.message === null && update.status === undefined) {
|
||||||
|
|||||||
@ -3,10 +3,11 @@ import fs from 'fs';
|
|||||||
import i18next from 'i18next';
|
import i18next from 'i18next';
|
||||||
import path from 'path';
|
import path from 'path';
|
||||||
|
|
||||||
const __dirname = path.resolve(process.cwd(), 'src', 'utils');
|
const translationsPath = fs.existsSync(path.resolve(process.cwd(), 'dist'))
|
||||||
|
? path.resolve(process.cwd(), 'dist', 'translations')
|
||||||
|
: path.resolve(process.cwd(), 'src', 'utils', 'translations');
|
||||||
|
|
||||||
const languages = ['en', 'pt-BR', 'es'];
|
const languages = ['en', 'pt-BR', 'es'];
|
||||||
const translationsPath = path.join(__dirname, 'translations');
|
|
||||||
const configService: ConfigService = new ConfigService();
|
const configService: ConfigService = new ConfigService();
|
||||||
|
|
||||||
const resources: any = {};
|
const resources: any = {};
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user