Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Include which users answered what on the finished polls on the payload #10261

Closed
IslandRhythms opened this issue May 7, 2024 · 2 comments
Closed

Comments

@IslandRhythms
Copy link

Which application or package is this feature request for?

discord.js

Feature

With the new release of polls, I'm moving away from my homemade version to using discord's solution. A gripe I have is that when a answer is submitted or removed, it will give you the userId and the answer, but when the poll ends it only gives the total vote count. This is a little annoying because If I want to record who answered the poll, I have to constantly ping my db and keep track of who answered what or who revoked their answer. Additionally, polls don't have an id. I guess I could use the expiresTimestamp as an id but I feel like that's kind of a workaround as opposed to the poll having its own Id. Also, when a user answers no identifer is included in that payload. Thus, making it not possible to track multiple polls at once.

Ideal solution or implementation

Give polls ids. include the poll id on an answer and revoke answer. When a poll is complete, include who answered what. Ideally you also allow a poll to be made where only people with a certain role can answer but I have a solution for that already. Looking through the repo, I saw that the emitter is only returing the poll object that is a part of the message object. Simply just returning the message object and letting the user destrucure it would be a big help.

Alternative solutions or implementations

No response

Other context

No response

@monbrey
Copy link
Member

monbrey commented May 7, 2024

API feature requests should go to Discord, not us. We can only implement the features the API provides.

In this instance, I believe you're looking for the fetchVoters method.

https://discord.js.org/docs/packages/discord.js/14.15.2/PollAnswer:Class#fetchVoters

@IslandRhythms
Copy link
Author

Sorry about that. Thank you for the Pointer.

@monbrey monbrey closed this as completed May 7, 2024
@Jiralite Jiralite closed this as not planned Won't fix, can't repro, duplicate, stale May 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants