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

feat: polls overhaul #10328

Open
wants to merge 44 commits into
base: main
Choose a base branch
from
Open

feat: polls overhaul #10328

wants to merge 44 commits into from

Conversation

uhKevinMC
Copy link
Contributor

@uhKevinMC uhKevinMC commented Jun 6, 2024

Please describe the changes this PR makes and why it should be merged:

This PR resolves Issue #10326 and adds methods and properties found in similarly structured classes. This also creates a new manager, dubbed the PollAnswerVoterManager to store users that voted for the poll answer, similar to ReactionUserManager for users that reacted to a reaction.

This PR also patches a bug related to poll expiry dates being nullish in the future when polls have the option not to expire.

please do give feedback on this PR, I don't bite

  • Add Poll Answer Voter/User Manager
  • Add partials for Poll and PollAnswer
  • Add support for partials Poll and PollAnswer in respective events
  • Add typings for new properties, methods, classes, and partials
  • Add tests
  • Case testing
  • Sanity check
  • Finalize PR

Status and versioning classification:

  • Code changes have been tested against the Discord API, or there are no code changes
  • I know how to update typings and have done so, or typings don't need updating
  • This PR changes the library's interface (methods or parameters added)

Copy link

vercel bot commented Jun 6, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
discord-js ✅ Ready (Inspect) Visit Preview 💬 Add feedback Sep 22, 2024 2:33pm
1 Skipped Deployment
Name Status Preview Comments Updated (UTC)
discord-js-guide ⬜️ Ignored (Inspect) Visit Preview Sep 22, 2024 2:33pm

@Jiralite Jiralite marked this pull request as ready for review June 6, 2024 07:15
@Jiralite Jiralite requested a review from a team as a code owner June 6, 2024 07:15
@Jiralite Jiralite marked this pull request as draft June 6, 2024 07:15
@Jiralite Jiralite added this to the discord.js 14.16 milestone Jun 6, 2024
@Jiralite Jiralite linked an issue Jun 7, 2024 that may be closed by this pull request
@uhKevinMC uhKevinMC marked this pull request as ready for review June 8, 2024 08:14
@uhKevinMC
Copy link
Contributor Author

I'm not able to test this locally, gotta love yarn..

Feedback on this would be appreciated!

packages/discord.js/src/managers/PollAnswerVoterManager.js Outdated Show resolved Hide resolved
packages/discord.js/src/structures/Poll.js Outdated Show resolved Hide resolved
packages/discord.js/src/structures/PollAnswer.js Outdated Show resolved Hide resolved
packages/discord.js/src/structures/Poll.js Outdated Show resolved Hide resolved
packages/discord.js/src/structures/Poll.js Outdated Show resolved Hide resolved
packages/discord.js/src/structures/Message.js Outdated Show resolved Hide resolved
packages/discord.js/src/structures/Poll.js Outdated Show resolved Hide resolved
packages/discord.js/src/client/actions/Action.js Outdated Show resolved Hide resolved
packages/discord.js/typings/index.d.ts Outdated Show resolved Hide resolved
packages/discord.js/typings/index.d.ts Outdated Show resolved Hide resolved
@almeidx
Copy link
Member

almeidx commented Jul 2, 2024

Can you integrate these changes in this pull request too?

packages/discord.js/src/structures/Poll.js Outdated Show resolved Hide resolved
packages/discord.js/src/structures/Poll.js Outdated Show resolved Hide resolved
packages/discord.js/src/structures/Poll.js Outdated Show resolved Hide resolved
packages/discord.js/typings/index.d.ts Show resolved Hide resolved
packages/discord.js/typings/index.d.ts Show resolved Hide resolved
@vladfrangu
Copy link
Member

This needs a rebase

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Review in Progress
Development

Successfully merging this pull request may close these issues.

Emit poll events on uncached messages
5 participants