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

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