-
-
Notifications
You must be signed in to change notification settings - Fork 4k
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: new select menus #8793
feat: new select menus #8793
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎ |
c18538f
to
e6eeb88
Compare
Codecov Report
@@ Coverage Diff @@
## main #8793 +/- ##
==========================================
- Coverage 91.97% 85.62% -6.35%
==========================================
Files 10 96 +86
Lines 2107 9457 +7350
Branches 244 1134 +890
==========================================
+ Hits 1938 8098 +6160
- Misses 166 1317 +1151
- Partials 3 42 +39
Flags with carried forward coverage won't be shown. Click here to find out more.
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
Its just copied lol |
Did you actually read the bullet point list of five things this PR does better? |
The only better thing i see is
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add BaseInteraction#isAnySelectMenu()
that will be changed to BaseInteraction#isSelectMenu()
in v15
Not a bad idea, will do tomorrow. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should also add type tests for the type narrowing between different select menu types.
Co-authored-by: Julian Vennen <julian@aternos.org>
e0d24f7
to
e559511
Compare
Now also tested. |
packages/discord.js/src/structures/MentionableSelectMenuInteraction.js
Outdated
Show resolved
Hide resolved
packages/discord.js/src/structures/UserSelectMenuInteraction.js
Outdated
Show resolved
Hide resolved
packages/discord.js/src/structures/UserSelectMenuInteraction.js
Outdated
Show resolved
Hide resolved
Maybe bump discord-api-types to the latest version (0.37.6)? |
Co-authored-by: Almeida <almeidx@pm.me>
Feel like that's out of scope for me at this point unless we need something from that version/it has relevant bug fixes. |
packages/builders/src/components/selectMenu/ChannelSelectMenu.ts
Outdated
Show resolved
Hide resolved
packages/builders/src/components/selectMenu/ChannelSelectMenu.ts
Outdated
Show resolved
Hide resolved
packages/builders/src/components/selectMenu/ChannelSelectMenu.ts
Outdated
Show resolved
Hide resolved
packages/builders/src/components/selectMenu/ChannelSelectMenu.ts
Outdated
Show resolved
Hide resolved
packages/discord.js/src/structures/MentionableSelectMenuInteraction.js
Outdated
Show resolved
Hide resolved
Co-authored-by: Aura Román <kyradiscord@gmail.com>
* feat(builders): new select menus * chore: better re-exporting of deprecated classes * feat: new select menus * chore: typings * chore: add missing todo comment * chore: finish updating tests * chore: add runtime deprecation warnings * chore: format deprecation warning * feat(BaseInteraction): isAnySelectMenu * chore: requested changes * fix: deprecation comments * chore: update @deprecated comments in typings * chore: add tests for select menu type narrowing * fix: bad auto imports Co-authored-by: Julian Vennen <julian@aternos.org> * fix: properly handle resolved members * fix: collectors * chore: suggested changes Co-authored-by: Almeida <almeidx@pm.me> * fix(typings): bad class extends * feat(ChannelSelectMenuBuilder): validation * chore: update todo comment * refactor(ChannelSelectMenu): better handling of channel_types state * chore: style nit * chore: suggested nits Co-authored-by: Aura Román <kyradiscord@gmail.com> Co-authored-by: Julian Vennen <julian@aternos.org> Co-authored-by: Almeida <almeidx@pm.me> Co-authored-by: Aura Román <kyradiscord@gmail.com> Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
Please describe the changes this PR makes and why it should be merged:
As discussed internally (see: https://canary.discord.com/channels/222078108977594368/999796393810067607/1035493023162830848), supersedes #8775
Things this PR does better:
SelectMenuComponent
into multiple classesCloses #8753
Note: There is one caveat with the typings I wrote,
AnySelectMenuInteraction
is a confusing type name and something we moved away from in the past. Ideally this would just be namedSelectMenuInteraction
and be a union of all the possible select menu interaction classes, but this is not possible, asSelectMenuInteraction
is the name of the oldStringSelectMenuInteraction
and is re-exported as such to prevent this PR from being breaking.Status and versioning classification: