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: allow RestOrArray for command option builders #10175

Merged

Conversation

LeCarbonator
Copy link
Contributor

Please describe the changes this PR makes and why it should be merged:
This PR changes ApplicationCommandOption methods to allow both rest and array params, which previously wasn't consistent with other builders. This was done by widening the parameter from ...T[] to RestOrArray<T> and normalizing it inside the method. Since arrays are still allowed, this is not a breaking change. The test file has been modified to test both rest and array parameters.

Status and versioning classification:

  • I know how to update typings and have done so, or typings don't need updating

change ApplicationCommandOption methods to allow both rest and array params,
which previously wasn't consistent with other builders.
Copy link

vercel bot commented Mar 14, 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 Mar 24, 2024 6:07pm
discord-js-guide ⬜️ Ignored (Inspect) Visit Preview Mar 24, 2024 6:07pm

@Jiralite Jiralite changed the title feat(builders): allow RestOrArray for command option builders feat: allow RestOrArray for command option builders Mar 14, 2024
Copy link

codecov bot commented Mar 14, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 62.36%. Comparing base (a66fc65) to head (59aba28).
Report is 3 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #10175      +/-   ##
==========================================
+ Coverage   62.19%   62.36%   +0.16%     
==========================================
  Files         209      209              
  Lines       16316    16282      -34     
  Branches     1214     1213       -1     
==========================================
+ Hits        10148    10154       +6     
+ Misses       6123     6083      -40     
  Partials       45       45              
Flag Coverage Δ
builders 95.57% <100.00%> (+<0.01%) ⬆️
next ∅ <ø> (∅)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@kodiakhq kodiakhq bot merged commit a1a3a95 into discordjs:main Mar 24, 2024
6 checks passed
@LeCarbonator LeCarbonator deleted the fix/builders-rest-array-inconsistency branch March 24, 2024 20:54
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.

None yet

5 participants