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(SlashCommandBuilder): Add explicit command type when building #10395

Merged
merged 3 commits into from
Jul 21, 2024
Merged

feat(SlashCommandBuilder): Add explicit command type when building #10395

merged 3 commits into from
Jul 21, 2024

Conversation

Amgelo563
Copy link
Contributor

Please describe the changes this PR makes and why it should be merged:
This PR makes the SlashCommandBuilder explicitly specify its type (ApplicationCommandType.ChatInput) when building, by modifying the SharedSlashCommand mixin.

One useful scenario for this is when mapping data received from the API (which always contains the type) to a builder's generated data (which currently doesn't contain the type for chat inputs), without relying on a fallback or assuming Discord's default.

I also asked about the issue on the developing-djs channel and a maintainer suggested I should open a PR for it.

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

@Amgelo563 Amgelo563 requested a review from a team as a code owner July 18, 2024 02:35
Copy link

vercel bot commented Jul 18, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

2 Skipped Deployments
Name Status Preview Comments Updated (UTC)
discord-js ⬜️ Ignored (Inspect) Visit Preview Jul 21, 2024 3:01pm
discord-js-guide ⬜️ Ignored (Inspect) Visit Preview Jul 21, 2024 3:01pm

Copy link

codecov bot commented Jul 18, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 50.53%. Comparing base (efa16a6) to head (58f4ea7).

Additional details and impacted files
@@           Coverage Diff           @@
##             main   #10395   +/-   ##
=======================================
  Coverage   50.52%   50.53%           
=======================================
  Files         228      228           
  Lines       20705    20707    +2     
  Branches     1252     1252           
=======================================
+ Hits        10462    10464    +2     
  Misses      10199    10199           
  Partials       44       44           
Flag Coverage Δ
builders 95.78% <100.00%> (+<0.01%) ⬆️

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.

@Jiralite Jiralite added this to the builders 1.9.0 milestone Jul 19, 2024
@kodiakhq kodiakhq bot merged commit b2970bb into discordjs:main Jul 21, 2024
24 checks passed
@Amgelo563 Amgelo563 deleted the feat/slash-builder-type branch July 22, 2024 00:59
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.

4 participants