pedroslopez / whatsapp-web.js

A WhatsApp client library for NodeJS that connects through the WhatsApp Web browser app
https://wwebjs.dev
Apache License 2.0
15.53k stars 3.7k forks source link

fix: `getCountryCode` #3292

Open alechkos opened 1 month ago

alechkos commented 1 month ago

PR Details

Description

The PR fixes an issue where the getCountryCode function throws an error:

Evaluation failed: TypeError: window.Store.NumberInfo.findCC is not a function

Related Issue

closes #3229

How Has This Been Tested

// client initialization...

client.on('ready', async () => {
    const userId = 'XXXXXXXXXX@c.us';
    console.log(await client.getCountryCode(userId));
    console.log(await client.getFormattedNumber(userId));
});

You can try the fix by running one of the following commands:

Types of changes

Checklist