Skip to content

fix: disable per option validation on chat input subcommands#11405

Merged
kodiakhq[bot] merged 2 commits intomainfrom
fix/builders-disable-option-validation
Mar 7, 2026
Merged

fix: disable per option validation on chat input subcommands#11405
kodiakhq[bot] merged 2 commits intomainfrom
fix/builders-disable-option-validation

Conversation

@almeidx
Copy link
Member

@almeidx almeidx commented Jan 25, 2026

Disables the double validation on the options, misssed from:

Supercedes #11312
Resolves #11309

@vercel
Copy link

vercel bot commented Jan 25, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

2 Skipped Deployments
Project Deployment Actions Updated (UTC)
discord-js Ignored Ignored Preview Mar 6, 2026 11:56pm
discord-js-guide Ignored Ignored Preview Mar 6, 2026 11:56pm

Request Review

@codecov
Copy link

codecov bot commented Jan 25, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 32.17%. Comparing base (41439d3) to head (745f4c5).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #11405      +/-   ##
==========================================
+ Coverage   31.61%   32.17%   +0.56%     
==========================================
  Files         387      375      -12     
  Lines       13995    13722     -273     
  Branches     1100     1072      -28     
==========================================
- Hits         4424     4415       -9     
+ Misses       9437     9175     -262     
+ Partials      134      132       -2     
Flag Coverage Δ
builders 68.02% <100.00%> (ø)

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.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR completes the refactoring of validation behavior in chat input command builders by disabling per-option validation for subcommand options, aligning with the pattern established in PR #11304. The change prevents redundant validation passes since parent predicates now validate complete nested structures.

Changes:

  • Modified ChatInputCommandSubcommandGroupBuilder.toJSON() to pass false instead of validationOverride to nested subcommand options
  • Modified ChatInputCommandSubcommandBuilder.toJSON() to pass false instead of validationOverride to nested basic options

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@coderabbitai
Copy link

coderabbitai bot commented Jan 25, 2026

📝 Walkthrough

Walkthrough

Modified nested option serialization in chat input command subcommands to always use false for the validation override parameter when calling toJSON(), rather than forwarding the outer validation override. Outer validation remains applied to parent data.

Changes

Cohort / File(s) Summary
Chat Input Subcommand Serialization
packages/builders/src/interactions/commands/chatInput/ChatInputCommandSubcommands.ts
Changed 2 instances of option.toJSON(validationOverride) to option.toJSON(false) in subcommand group and subcommand option serialization

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Possibly related PRs

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the main change: disabling per-option validation on chat input subcommands, which directly aligns with the code changes modifying toJSON calls.
Linked Issues check ✅ Passed The code changes directly address issue #11309 by disabling per-option validation by changing option.toJSON(validationOverride) to option.toJSON(false) at the specified lines.
Out of Scope Changes check ✅ Passed All changes are focused on the ChatInputCommandSubcommands.ts file and directly address the validation override refactoring specified in linked issue #11309, with no extraneous modifications.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Description check ✅ Passed The pull request description clearly relates to the changeset - it references a change missed from #11304 and addresses validation override modifications in chat input subcommands, which directly matches the file modifications shown in the summary.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-project-automation github-project-automation bot moved this from Todo to Review Approved in discord.js Mar 6, 2026
@kodiakhq kodiakhq bot merged commit 52173b6 into main Mar 7, 2026
9 checks passed
@kodiakhq kodiakhq bot deleted the fix/builders-disable-option-validation branch March 7, 2026 00:02
@github-project-automation github-project-automation bot moved this from Review Approved to Done in discord.js Mar 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

Refactor chat input command subcommands overrides

5 participants