Polls in WhatsApp are so convenient for the users, but so painful for group admins. Cannot modify them, cannot re-use or replicate them.
Best workaround I found is to use WPPConnect/WA-JS
This creates a sort of API in the browser console that can be used to just copy-paste from an editor to create a poll.
- Install Tampermonkey in your browser (I tested with Chrome)
- Select “Create new script”
- Paste from https://github.com/wppconnect-team/wa-js?tab=readme-ov-file#tampermonkey-or-greasemonkey, do not need to write anything where it says “Your code here”
Now after we login to WhatsApp Web and select the target group chat, we can open the “Developer tools”, paste and execute:
= WPP.chat.getActiveChat()
c .chat.sendCreatePollMessage(
WPP.id,
c'Title of the poll',
'9am', '9:30am', '10am', '2pm', '2:30pm', '3pm', 'No', 'Maybe']
[; )
This is very convenient especially if you send many polls that have mostly the same options.
You can also generate options dynamically in Javascript:
= WPP.chat.getActiveChat()
c = ['9am', '10am', '11am']
am = ['2pm', '2:30pm', '3pm']
pm = ['Sat', 'Sun']
day = ['No', 'Maybe']
other
= []
options for (i = 0; i < day.length; i++) {
if (day[i] == 'Sun') {
for (j = 0; j < am.length; j++) {
.push(day[i] + ' ' + am[j])
options
}
}for (j = 0; j < pm.length; j++) {
.push(day[i] + ' ' + pm[j])
options
}
}= options.concat(other)
options
if (options.length > 12) {
throw new Error('Number of options exceeds the limit of 12.');
else {
} .chat.sendCreatePollMessage(
WPP.id,
c'Event title',
options;
) }