* feat: polls overhaul (#10328) * feat(Managers): add PollAnswerVoterManager * feat(Partials): make Polls partial-safe * types: add typings * chore: add tests * fix: use fetch method in manager instead * chore: add tests for manager * feat: add partial support to poll actions * style: formatting * fix: change all .users references to .voters * refactor: add additional logic for partials * fix: actually add the partials * fix: fixed issue where event does not emit on first event * fix: align property type with DAPI documentation * fix: resolve additional bugs with partials * typings: update typings to reflect property type change * fix: tests * fix: adjust tests * refactor: combine partials logic into one statement * docs: mark getter as readonly * refactor: apply suggestions Co-authored-by: Almeida <github@almeidx.dev> * refactor(Actions): apply suggestions * refactor(PollAnswerVoterManager): apply suggestions * refactor(Message): check for existing poll before creating a poll * refactor(Polls): apply suggestions * revert(types): remove unused method from Poll class * refactor(Actions): consolidate poll creation logic into action class * refactor(PollAnswerVoterManager): set default for fetch parameter * refactor(Message): apply suggestion * fix: remove partial setter * refactor(Polls): apply suggestions * types: apply suggestions * refactor: remove clones * docs: spacing * refactor: move setters from constructor to _patch * types: adjust partials for poll classes * test: add more tests for polls * refactor: move updates around, more correct partial types * fix: handle more cases * refactor: requested changes * fix: missing imports * fix: update imports * fix: require file extensions --------- Co-authored-by: Almeida <github@almeidx.dev> Co-authored-by: Qjuh <76154676+Qjuh@users.noreply.github.com> * fix(Poll): ensure `this.answers` is set before we reference it (#10809) * Ensure his.answers is set sooner if it's null during a patch * Move data.answers block up as well to ensure the patched answers are set * Ensure collection is set in constructor instead --------- Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com> * fix(PollAnswer): only define _emoji property once (#10811) Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com> --------- Co-authored-by: Kevin <uhkevinmc@eedo.app> Co-authored-by: Qjuh <76154676+Qjuh@users.noreply.github.com> Co-authored-by: Jacob Morrison <jake.morrison24@gmail.com> Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
About
This repository contains multiple packages with separate releases. You can find the assembled Discord API wrapper at discord.js. It is a powerful Node.js module that allows you to easily interact with the Discord API.
Packages
discord.js(source) - A powerful Node.js module for interacting with the Discord API@discordjs/brokers(source) - A collection of brokers for use with discord.js@discordjs/builders(source) - A utility package for easily building Discord API payloads@discordjs/collection(source) - A powerful utility data structure@discordjs/core(source) - A thinly abstracted wrapper around the core components of the Discord API@discordjs/formatters(source) - A collection of functions for formatting strings@discordjs/proxy(source) - A wrapper around@discordjs/restfor running an HTTP proxy@discordjs/rest(source) - A module for interacting with the Discord REST API@discordjs/voice(source) - A module for interacting with the Discord Voice API@discordjs/util(source) - A collection of utility functions@discordjs/ws(source) - A wrapper around Discord's gateway
Links
- Website (source)
- Documentation
- Guide (source) Also see the v13 to v14 Update Guide, which includes updated and removed items from the library.
- discord.js Discord server
- Discord API Discord server
- GitHub
- npm
- Related libraries
Extensions
Contributing
Please read through our contribution guidelines before starting a pull request. We welcome contributions of all kinds, not just code! If you're stuck for ideas, look for the good first issue label on issues in the repository. If you have any questions about the project, feel free to ask them on Discord. Before creating your own issue or pull request, always check to see if one already exists! Don't rush contributions, take your time and ensure you're doing it correctly.
Help
If you don't understand something in the documentation, you are experiencing problems, or you just need a gentle nudge in the right direction, please join our Discord server.