Issue Description
client.once("ready", () => {
if (typeof client.setRejectIncomingCalls === "function") {
client.setRejectIncomingCalls(true).catch(() => {});
}
});
client.on("call", async (call) => {
if (call.fromMe) return;
try {
await call.reject();
console.log(
[${tenantId}] Rejected incoming ${call.isVideo ? "video" : "voice"} call from ${call.from},
);
} catch (e) {
console.error([${tenantId}] rejectCall:, e.message);
}
});
Reproduction Steps
client.on("call", async (call) => {
if (call.fromMe) return;
try {
await call.reject();
console.log(
[${tenantId}] Rejected incoming ${call.isVideo ? "video" : "voice"} call from ${call.from},
);
} catch (e) {
console.error([${tenantId}] rejectCall:, e.message);
}
});
Code Sample
User Setup
| WhatsApp |
Type |
| Account Type |
WhatsApp Business |
| Authentication Strategy |
LocalAuth |
| WhatsApp Web Version |
latest |
| whatsapp-web.js Version |
1.34.7 |
| Environment |
Version |
| Browser Type |
cmd |
| Browser Version |
v |
| Phone OS Version |
1.34.7 |
| Running OS Version |
windows |
| Node.js Version |
1.34.7 |
Checklist
Issue Description
client.once("ready", () => {
if (typeof client.setRejectIncomingCalls === "function") {
client.setRejectIncomingCalls(true).catch(() => {});
}
});
client.on("call", async (call) => {
if (call.fromMe) return;
try {
await call.reject();
console.log(
[${tenantId}] Rejected incoming ${call.isVideo ? "video" : "voice"} call from ${call.from},);
} catch (e) {
console.error(
[${tenantId}] rejectCall:, e.message);}
});
Reproduction Steps
client.on("call", async (call) => {
if (call.fromMe) return;
try {
await call.reject();
console.log(
[${tenantId}] Rejected incoming ${call.isVideo ? "video" : "voice"} call from ${call.from},);
} catch (e) {
console.error(
[${tenantId}] rejectCall:, e.message);}
});
Code Sample
User Setup
Checklist