chore: update Baileys dependency to version 7.0.0-rc.3 and improve message key handling in WhatsApp service
Some checks failed
Build Docker image / Build and Deploy (push) Has been cancelled

This commit is contained in:
Davidson Gomes
2025-09-15 16:21:33 -03:00
parent bfe7030fab
commit 486645fb08
7 changed files with 2855 additions and 1434 deletions

View File

@@ -3,6 +3,8 @@ import fs from 'fs';
import i18next from 'i18next';
import path from 'path';
const __dirname = path.resolve(process.cwd(), 'src', 'utils');
const languages = ['en', 'pt-BR', 'es'];
const translationsPath = path.join(__dirname, 'translations');
const configService: ConfigService = new ConfigService();
@@ -12,8 +14,9 @@ const resources: any = {};
languages.forEach((language) => {
const languagePath = path.join(translationsPath, `${language}.json`);
if (fs.existsSync(languagePath)) {
const translationContent = fs.readFileSync(languagePath, 'utf8');
resources[language] = {
translation: require(languagePath),
translation: JSON.parse(translationContent),
};
}
});