fix: optimize send message from group with mentions

This commit is contained in:
Davidson Gomes 2023-07-14 08:31:43 -03:00
parent a7b05f1e85
commit be492a3e3f

View File

@ -1434,9 +1434,6 @@ export class WAStartupService {
let mentions: string[];
if (isJidGroup(sender)) {
try {
this.logger.verbose('Getting group metadata');
const groupMetadata = await this.client.groupMetadata(sender);
if (options?.mentions) {
this.logger.verbose('Mentions defined');
@ -1450,6 +1447,8 @@ export class WAStartupService {
if (options.mentions.everyOne) {
this.logger.verbose('Mentions everyone');
this.logger.verbose('Getting group metadata');
const groupMetadata = await this.client.groupMetadata(sender);
mentions = groupMetadata.participants.map((participant) => participant.id);
this.logger.verbose('Getting group metadata for mentions');
} else {