Skip to content

Commit 0cc1f18

Browse files
authored
[BUG] Correção de mencionar
Caso seja enviado everyOne como false sem passar nada no mentioned
1 parent cc91f2e commit 0cc1f18

File tree

1 file changed

+2
-9
lines changed

1 file changed

+2
-9
lines changed

src/whatsapp/services/whatsapp.service.ts

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1686,20 +1686,13 @@ export class WAStartupService {
16861686
if (options?.mentions) {
16871687
this.logger.verbose('Mentions defined');
16881688

1689-
if (
1690-
!Array.isArray(options.mentions.mentioned) &&
1691-
!options.mentions.everyOne
1692-
) {
1693-
throw new BadRequestException('Mentions must be an array');
1694-
}
1695-
1696-
if (options.mentions.everyOne) {
1689+
if (options.mentions?.everyOne) {
16971690
this.logger.verbose('Mentions everyone');
16981691

16991692
this.logger.verbose('Getting group metadata');
17001693
mentions = groupMetadata.participants.map((participant) => participant.id);
17011694
this.logger.verbose('Getting group metadata for mentions');
1702-
} else {
1695+
} else if(options.mentions?.mentioned?.length) {
17031696
this.logger.verbose('Mentions manually defined');
17041697
mentions = options.mentions.mentioned.map((mention) => {
17051698
const jid = this.createJid(mention);

0 commit comments

Comments
 (0)