synik4l
synik4l
DIAdiscord.js - Imagine an app
Created by synik4l on 7/31/2024 in #djs-questions
How to use getAnswerVoters for new polls
Not sure if its just not fully implemented yet or what but I cant seem to figure out how to get the function to be called. Dont see any examples anywhere for it either. I never get to that logger.info(pollAPI). I just get back Cannot read properties of undefined (reading 'poll') (user-service). Any ideas? Or am I just trying to use new stuff too quickly lol?
const pollAPI = client.api.poll;
const answerIds = ['yes', 'no', 'maybe'];
logger.info(pollAPI);
for (const answerId of answerIds) {
try {
const voters = await pollAPI.getAnswerVoters(
activePoll.channelId,
activePoll.messageId,
`${answerId}_${activePoll.pokerId}`,
{ limit: 100 }
);
logger.info(`Poll: ${JSON.stringify(voters, null, 2)}`);
const pollAPI = client.api.poll;
const answerIds = ['yes', 'no', 'maybe'];
logger.info(pollAPI);
for (const answerId of answerIds) {
try {
const voters = await pollAPI.getAnswerVoters(
activePoll.channelId,
activePoll.messageId,
`${answerId}_${activePoll.pokerId}`,
{ limit: 100 }
);
logger.info(`Poll: ${JSON.stringify(voters, null, 2)}`);
13 replies