Repository: orkestral/venom

Issue #952: TypeError: Cannot read property 'match' of undefined
Created: 2021-06-03T06:35:07Z
Description
Running a simple sendText program. It's suggesting that the number doesn't exist for a perfectly valid number! Throws me a error with chat.NumberExists as canReceiveMessage being returned false and then match undefined.
Environment

Venom version(s): 3.0.17
Browser: Chrome v91.0.4472.77
OS: MacOS Mojave
Node version: Node 10.21.0

Input Code
const venom = require('venom-bot');

async function asyncCall(client) {
	try {
		number = '971553194565';
		const chat = await client.checkNumberStatus(`${number}@c.us`);
		console.log('chat here', chat);
		await client
			.sendText('971553194565@c.us', '👋 Hello from Venom!')
			.then((result) => {
				console.log('Result: ', result); //return object success
			})
			.catch((erro) => {
				console.error('Error when sending: ', erro); //return object error
			});
	} catch (err) {
		throw err;
	}
}

async function start() {
	const client = await venom
		.create('session')
		.then((client) => {
			return client;
		})
		.catch((error) => console.info(error));
	asyncCall(client);
}

start();


Log Output

chat here { id:
   { server: 'c.us',
     user: '971553194565',
     _serialized: '971553194565@c.us' },
  status: {},
  isBusiness: false,
  canReceiveMessage: false }
(node:84599) UnhandledPromiseRejectionWarning: Error: Evaluation failed: TypeError: Cannot read property 'match' of undefined
    at new l (https://web.whatsapp.com/bootstrap_qr.c11753ab24650fdf3d67.js:21:24974)
    at new o (https://web.whatsapp.com/bootstrap_qr.c11753ab24650fdf3d67.js:21:29593)
    at Object.window.WAPI.window.WAPI.checkNumberStatus (/Users/ujjawalchauhan/Dropbox/mywasender/node_modules/venom-bot/dist/lib/wapi/wapi.js:1:64732)
    at Object.window.WAPI.window.WAPI.sendExist (/Users/ujjawalchauhan/Dropbox/mywasender/node_modules/venom-bot/dist/lib/wapi/wapi.js:1:29715)
    at Object.window.WAPI.window.WAPI.getNewMessageId (/Users/ujjawalchauhan/Dropbox/mywasender/node_modules/venom-bot/dist/lib/wapi/wapi.js:1:59842)
    at Object.window.WAPI.window.WAPI.sendMessage (/Users/ujjawalchauhan/Dropbox/mywasender/node_modules/venom-bot/dist/lib/wapi/wapi.js:1:38242)
    at ExecutionContext._evaluateInternal (/Users/ujjawalchauhan/Dropbox/mywasender/node_modules/puppeteer/lib/cjs/puppeteer/common/ExecutionContext.js:218:19)
    at process._tickCallback (internal/process/next_tick.js:68:7)
(node:84599) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:84599) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.```

Duplicate issue #956: I can't send any text message out of my chat's list
Created: 2021-06-05T11:16:45Z
(node:25506) UnhandledPromiseRejectionWarning: Error: Evaluation failed: TypeError: Cannot read property 'match' of undefined
at new l (https://web.whatsapp.com/bootstrap_qr.c11753ab24650fdf3d67.js:21:24974)
at new o (https://web.whatsapp.com/bootstrap_qr.c11753ab24650fdf3d67.js:21:29593)
at Object.window.WAPI.window.WAPI.checkNumberStatus (/home/public_html/node_modules/venom-bot/dist/lib/wapi/wapi.js:1:64732)
at Object.window.WAPI.window.WAPI.sendExist (/home/public_html/node_modules/venom-bot/dist/lib/wapi/wapi.js:1:29715)
at Object.window.WAPI.window.WAPI.getNewMessageId (/home/public_html/node_modules/venom-bot/dist/lib/wapi/wapi.js:1:59842)
at Object.window.WAPI.window.WAPI.sendMessage (/home/public_html/node_modules/venom-bot/dist/lib/wapi/wapi.js:1:38242)
at ExecutionContext._evaluateInternal (/home/public_html/node_modules/puppeteer/lib/cjs/puppeteer/common/ExecutionContext.js:221:19)
at processTicksAndRejections (internal/process/task_queues.js:97:5)
at async ExecutionContext.evaluate (/home/public_html/node_modules/puppeteer/lib/cjs/puppeteer/common/ExecutionContext.js:110:16)
(node:25506) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag --unhandled-rejections=strict (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 31)

Closing comment (2021-06-07T15:09:07Z): duplicate #952