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.05k stars 3.58k forks source link

vote_update event #3256

Open momokang opened 2 weeks ago

momokang commented 2 weeks ago

Is there an existing issue for this?

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

After WhatsApp is updated, vote_update event is not able to trigger anymore, however I saw similar case https://github.com/pedroslopez/whatsapp-web.js/pull/3207 but it's closed.

Is it not planned to be developed in future? Is there any alternative solution to know someone voted in poll?

Describe the solution you'd like.

Vote_update event is working or alternative to know poll voted.

Describe an alternate solution.

No response

Additional context

No response

BenyFilho commented 2 weeks ago

Use this simple trick and the event will work, open the chat window just after sending a poll.

const poll = new Poll('Do you prefer?', ['Cat', 'Dog']);
const msgVote = await client.sendMessage('xxxxxxxxx@c.us', poll);
const chatWindow = await client.interface.openChatWindow('xxxxxxxxx@c.us');
momokang commented 2 weeks ago

Use this simple trick and the event will work, open the chat window just after sending a poll.

const poll = new Poll('Do you prefer?', ['Cat', 'Dog']);
const msgVote = await client.sendMessage('xxxxxxxxx@c.us', poll);
const chatWindow = await client.interface.openChatWindow('xxxxxxxxx@c.us');

Because we have a lot of customers to send, maybe 100 customers, we can't open 100 chat window and wait for them to vote.

BenyFilho commented 2 weeks ago

You don't need to open a chat and wait for the vote, is just open the chat at least once.