whatsapp-web.js icon indicating copy to clipboard operation
whatsapp-web.js copied to clipboard

Please add feature to check users online status and last seen

Open anlnsai opened this issue 2 years ago • 2 comments

Is there an existing issue for this?

  • [X] I have searched the existing issues

Is your feature request related to a problem? Please describe.

No

Describe the solution you'd like.

Please add feature to check users online status and last seen

Describe an alternate solution.

NA

Additional context

NA

anlnsai avatar Dec 04 '22 19:12 anlnsai

Hello,

I did something like that:

await page.exposeFunction("contactPresence", async (phoneNumber) => {
	await page.waitForSelector('[data-testid="search"]').then(()=>  page.click('[data-testid="search"]', {
		delay: 0
	}));

	await page.type("._13NKt.copyable-text.selectable-text[title='Cuadro de texto para ingresar la búsqueda']", phoneNumber);

	await page.waitForTimeout(250);
	await page.keyboard.press("Enter")
	await page.waitForTimeout(1500)

	const element = await page.$("._2YPr_.i0jNr");

	var text = "";

	if (element != null)
		text = await page.evaluate(element => element.textContent, element);

	return text;
});

Best Regards.

angelruiznieto90 avatar Dec 15 '22 21:12 angelruiznieto90

Hello,

I did something like that:

await page.exposeFunction("contactPresence", async (phoneNumber) => {
	await page.waitForSelector('[data-testid="search"]').then(()=>  page.click('[data-testid="search"]', {
		delay: 0
	}));

	await page.type("._13NKt.copyable-text.selectable-text[title='Cuadro de texto para ingresar la búsqueda']", phoneNumber);

	await page.waitForTimeout(250);
	await page.keyboard.press("Enter")
	await page.waitForTimeout(1500)

	const element = await page.$("._2YPr_.i0jNr");

	var text = "";

	if (element != null)
		text = await page.evaluate(element => element.textContent, element);

	return text;
});

Best Regards.

how to run it?

pa7rickr avatar Dec 31 '22 22:12 pa7rickr

Hello, I did something like that:

await page.exposeFunction("contactPresence", async (phoneNumber) => {
	await page.waitForSelector('[data-testid="search"]').then(()=>  page.click('[data-testid="search"]', {
		delay: 0
	}));

	await page.type("._13NKt.copyable-text.selectable-text[title='Cuadro de texto para ingresar la búsqueda']", phoneNumber);

	await page.waitForTimeout(250);
	await page.keyboard.press("Enter")
	await page.waitForTimeout(1500)

	const element = await page.$("._2YPr_.i0jNr");

	var text = "";

	if (element != null)
		text = await page.evaluate(element => element.textContent, element);

	return text;
});

Best Regards.

hey, can u please tell how to run this code.?

JayEshan avatar May 10 '23 04:05 JayEshan

I feel like there isnt any context. page isnt defined and as far as my understanding goes does this solution not even use whatsapp-web.js

EmilEmilchen avatar Jun 22 '23 17:06 EmilEmilchen