From 7f60f163e667b3aee769b1624adc4abf057502ba Mon Sep 17 00:00:00 2001 From: Andres Aya Date: Tue, 16 May 2023 12:35:01 -0500 Subject: [PATCH] fix: get poll request from getAggregateVotesInPollMessage in v1 v2 v3 (#74) --- src/Utils/messages.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Utils/messages.ts b/src/Utils/messages.ts index 3de8edc..49e1835 100644 --- a/src/Utils/messages.ts +++ b/src/Utils/messages.ts @@ -748,7 +748,7 @@ export function getAggregateVotesInPollMessage( { message, pollUpdates }: Pick, 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 hash = sha256(Buffer.from(opt.optionName || '')).toString() acc[hash] = {