fix: add validation to prevent group calls in whatsapp.baileys.service.ts

Added a check to prevent group calls by throwing a BadRequestException when a group JID is detected. This change ensures that only individual calls are processed, preventing unsupported group call attempts and improving error handling.
This commit is contained in:
Davidson Gomes 2024-06-14 09:45:02 -03:00
parent 92a0d8ccc9
commit 2d49c73023

View File

@ -3438,6 +3438,11 @@ export class BaileysStartupService extends ChannelStartupService {
public async fakeCall(data: FakeCallDto) {
try {
const number = this.createJid(data.number);
if (number.includes('@g.us')) {
throw new BadRequestException('Group calls are not supported');
}
const mdDelay = data.delay ?? 0;
const call = await this.client.offerCall(number);