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?
10 Replies
- What's your exact discord.js
npm list discord.js
and node node -v
version?
- Not a discord.js issue? Check out #other-js-ts.
- Consider reading #how-to-get-help to improve your question!
- Explain what exactly your issue is.
- Post the full error stack trace, not just the top part!
- Show your code!
- Issue solved? Press the button!just to clarify, are you using
discord.js
or @discordjs/core
?discord.js
i was kind of just stumbling around. i dont know if im using the right stuff at all for this lol. Just basically trying to get the responses period. Whatever the "correct" way is now for the new style polls.
this code appears to be for
@discordjs/core
<Client>.api
and PollAPI
don't exist in discord.js
you can fetch an answer's voters by id with <TextChannel>.messages.fetchPollAnswerVoters()
:method: MessageManager#fetchPollAnswerVoters
@14.15.3
Fetches the users that voted for a poll answer.ah yes i was just noticing that theres a difference lol between the two. Okay. Cool. So that still works for the newer style polls?
Thse ones?
Yes, I mean those are the only type of polls by discord
Hmm. but didnt those style polls just come out? They are sent differently than the old ones
Got it. I was being dumb how i was sending the parameters for it. Was sending the message id and answer id as strings. Thanks
the old ones being reaction/component based polls?
it's not as if the api recognized those as polls, just reactions/components
while these new polls are recent, there wasn't an actual predecessor, so it's not as if these methods could have been for reaction/component based polls