mirror of
https://github.com/FranP-code/Baileys.git
synced 2025-10-13 00:32:22 +00:00
fix: get poll request from getAggregateVotesInPollMessage in v1 v2 v3 (#74)
This commit is contained in:
@@ -748,7 +748,7 @@ export function getAggregateVotesInPollMessage(
|
|||||||
{ message, pollUpdates }: Pick<WAMessage, 'pollUpdates' | 'message'>,
|
{ message, pollUpdates }: Pick<WAMessage, 'pollUpdates' | 'message'>,
|
||||||
meId?: string
|
meId?: string
|
||||||
) {
|
) {
|
||||||
const opts = message?.pollCreationMessage?.options || []
|
const opts = message?.pollCreationMessage?.options || message?.pollCreationMessageV2?.options || message?.pollCreationMessageV3?.options || []
|
||||||
const voteHashMap = opts.reduce((acc, opt) => {
|
const voteHashMap = opts.reduce((acc, opt) => {
|
||||||
const hash = sha256(Buffer.from(opt.optionName || '')).toString()
|
const hash = sha256(Buffer.from(opt.optionName || '')).toString()
|
||||||
acc[hash] = {
|
acc[hash] = {
|
||||||
|
|||||||
Reference in New Issue
Block a user