Merge pull request #370 from leandrosroc/main

fix: Sending status message
This commit is contained in:
Davidson Gomes 2024-01-19 16:38:59 -03:00 committed by GitHub
commit 69a323691f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -2457,21 +2457,6 @@ export class WAStartupService {
option as unknown as MiscMessageGenerationOptions,
);
}
if (!message['audio']) {
this.logger.verbose('Sending message');
return await this.client.sendMessage(
sender,
{
forward: {
key: { remoteJid: this.instance.wuid, fromMe: true },
message,
},
mentions,
},
option as unknown as MiscMessageGenerationOptions,
);
}
}
if (message['conversation']) {
this.logger.verbose('Sending message');
@ -2486,6 +2471,21 @@ export class WAStartupService {
);
}
if (!message['audio'] && sender != 'status@broadcast') {
this.logger.verbose('Sending message');
return await this.client.sendMessage(
sender,
{
forward: {
key: { remoteJid: this.instance.wuid, fromMe: true },
message,
},
mentions,
},
option as unknown as MiscMessageGenerationOptions,
);
}
if (sender === 'status@broadcast') {
this.logger.verbose('Sending message');
return await this.client.sendMessage(
@ -3138,6 +3138,8 @@ export class WAStartupService {
if (!group) throw new BadRequestException('Group not found');
onWhatsapp.push(new OnWhatsAppDto(group.id, !!group?.id, group?.subject));
} else if (jid === 'status@broadcast') {
onWhatsapp.push(new OnWhatsAppDto(jid, false));
} else {
jid = !jid.startsWith('+') ? `+${jid}` : jid;
const verify = await this.client.onWhatsApp(jid);