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 #10185

Merged
merged 2 commits into from
Apr 30, 2024
Merged

feat: polls #10185

merged 2 commits into from
Apr 30, 2024

Conversation

almeidx
Copy link
Member

@almeidx almeidx commented Mar 21, 2024

Please describe the changes this PR makes and why it should be merged:
Added support for polls.

Decided to take an opinionated stance with the poll results here. Instead of having a separate structure (results) like Discord, the answer vote count has been inlined directly into PollAnswer (e.g. poll.results.answer_counts[].count -> poll.answers[].voteCount), as it seemed to provide better DX to me. Additionally, also flattened all Poll Media objects (e.g. poll.question.text -> poll.question)

Upstream:

Depends on:

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 Mar 21, 2024

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

2 Ignored Deployments
Name Status Preview Comments Updated (UTC)
discord-js ⬜️ Ignored (Inspect) Visit Preview Apr 30, 2024 11:18pm
discord-js-guide ⬜️ Ignored (Inspect) Visit Preview Apr 30, 2024 11:18pm

@almeidx almeidx force-pushed the feat/polls branch 2 times, most recently from 31465b2 to 670efe1 Compare March 22, 2024 00:35
@almeidx almeidx force-pushed the feat/polls branch 5 times, most recently from d5f34c7 to 33bc1f9 Compare March 24, 2024 18:37
@Jiralite Jiralite added this to the discord.js 14.16 milestone Apr 9, 2024
@Jiralite Jiralite removed this from the discord.js 14.16 milestone Apr 9, 2024
@Jiralite Jiralite modified the milestone: discord.js 14.15 Apr 20, 2024
@almeidx almeidx removed the blocked label Apr 27, 2024
@almeidx almeidx marked this pull request as ready for review April 27, 2024 17:57
@almeidx almeidx requested review from a team and iCrawl as code owners April 27, 2024 17:57
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
@vladfrangu vladfrangu added this to the discord.js 14.15 milestone Apr 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

5 participants