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(CommandInteraction): make options a collection #5705

Merged
merged 4 commits into from Jun 2, 2021

Conversation

iShibi
Copy link
Contributor

@iShibi iShibi commented May 30, 2021

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

Currently, CommandInteraction#options is an Array. This PR changes it to a Collection. As discussed in the support server, options of a CommandInteraction have unique names. Thus, having a Collection with names as keys is much better than using an array in this case.

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)
  • This PR includes breaking changes (methods removed or renamed, parameters moved or removed)

@ImRodry

This comment has been minimized.

@iCrawl
Copy link
Member

iCrawl commented May 31, 2021

This needs a rebase.

typings/index.d.ts Outdated Show resolved Hide resolved
Copy link
Member

@kyranet kyranet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As long as V8 doesn't make a random change that makes Map behave like an unordered hash map (thus not preserving the insertion order), this is fine.

The options are send in order as you'd expect them, so i appreciate the array here
Source

Other than that, LGTM.

@iCrawl iCrawl merged commit fdad140 into discordjs:master Jun 2, 2021
@monbrey monbrey mentioned this pull request Jun 3, 2021
@iShibi iShibi deleted the options-collection branch June 15, 2021 15:01
@iCrawl iCrawl added this to the Version 13 milestone Jun 27, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants