#When someone calling, console the calling but, not display the actual number

2 messages · Page 1 of 1 (latest)

smoky crater
#

When someone calling to not number, now it can't fetch the actual number

`client.on('call', async (call) => {

// Ignore calls from a group
if (call.from.includes('@g.us')) {
    return;
}

console.log('Call received.');

const contact = await client.getContactById(call.from);
const callerNumber = contact ? contact.number : call.from.split('@')[0];

console.log(`Received a ${call.isVideo ? 'video' : 'voice'} call from ${callerNumbe>

if (call.isVideo) return;

const member = await findMemberByWhatsApp(callerNumber);
if (member) {
    if (rejectCalls) await call.reject();
}

await sendDetails(call.from, callerNumber, 'pend', null, member);

});`

Anyone can help?

primal cove
#

You are not considering @lid, now more and more that is the pattern