UNPKG

@kamuridesu/whatframework

Version:

A simple WhatsApp Bot Framework on top of Baileys

24 lines (23 loc) 701 B
import { Message } from "../data/message.js"; async function pollParser(key, pollUpdates, bot) { if (!key) { return; } const originalMessage = await bot.loadMessage(key); if (originalMessage instanceof Message || typeof originalMessage == "undefined") { return undefined; } // console.log(originalMessage?.pollUpdates); const message = await bot.getMessage(key); // const votes = getAggregateVotesInPollMessage({ // message: message, // pollUpdates: pollUpdates // }); // const poll = { // pollName: message.pollCreationMessage?.name, // votes: votes // } // return poll; } export { pollParser };