This commit is contained in:
Davidson Gomes 2024-03-08 12:02:13 -03:00
parent 7bc4c7b36e
commit 17ecc88f80

View File

@ -936,7 +936,10 @@ export class BaileysStartupService extends WAStartupService {
) => {
try {
this.logger.verbose('Event received: messages.upsert');
for (const received of messages) {
const received = messages[0];
// for (const received of messages) {
if (
(type !== 'notify' && type !== 'append') ||
received.message?.protocolMessage ||
@ -964,7 +967,7 @@ export class BaileysStartupService extends WAStartupService {
received?.message?.documentMessage ||
received?.message?.audioMessage;
const contentMsg = received.message[getContentType(received.message)] as any;
const contentMsg = received?.message[getContentType(received.message)] as any;
if (this.localWebhook.webhook_base64 === true && isMedia) {
const buffer = await downloadMediaMessage(
@ -1106,7 +1109,7 @@ export class BaileysStartupService extends WAStartupService {
this.logger.verbose('Inserting contact in database');
this.repository.contact.insert([contactRaw], this.instance.name, database.SAVE_DATA.CONTACTS);
}
// }
} catch (error) {
this.logger.error(error);
}