This commit is contained in:
Alan Mosko 2023-09-06 16:18:48 -03:00 committed by GitHub
parent d47cc5d5f4
commit 0c4c8162c2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1844,8 +1844,10 @@ export class WAStartupService {
private async sendMessageWithTyping<T = proto.IMessage>(number: string, message: T, options?: Options) {
this.logger.verbose('Sending message with typing');
this.logger.verbose(`Check if number "${number}" is WhatsApp`);
const isWA = (await this.whatsappNumber({ numbers: [number] }))?.shift();
this.logger.verbose(`Exists: "${isWA.exists}" | jid: ${isWA.jid}`);
if (!isWA.exists && !isJidGroup(isWA.jid) && !isWA.jid.includes('@broadcast')) {
throw new BadRequestException(isWA);
}