Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Nov 26, 2025

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

Nested validation in chat input commands caused redundant validation passes. Parent predicates only validated structure (type fields), requiring children to validate their own properties.

Changes

Predicates now validate complete nested structures:

  • Created fullBasicOptionPredicate validating all option properties (name, description, choices, autocomplete, min/max values, channel types)
  • Created fullSubcommandPredicate validating subcommands with nested options
  • Created fullSubcommandGroupPredicate validating subcommand groups with nested subcommands
  • Updated chatInputCommandPredicate, chatInputCommandSubcommandPredicate, and chatInputCommandSubcommandGroupPredicate to use full predicates

Parent toJSON() methods now pass false to children:

  • ChatInputCommandBuilder.toJSON() passes false to nested options (line 33)
  • ChatInputCommandSubcommandGroupBuilder.toJSON() passes false to subcommands (line 77)
  • ChatInputCommandSubcommandBuilder.toJSON() passes false to options (line 110)

Result

Each structure validates once at parent level. Top-level validationOverride parameter still controls validation behavior—only internal nesting is affected.

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 only includes non-code changes, like changes to documentation, README, etc.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • downloads.rclone.org
    • Triggering command: /usr/local/bin/node node bin/rclone.js selfupdate (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Original prompt

This section details on the original issue you should resolve

<issue_title>Refactor chat input command subcommands overrides</issue_title>
<issue_description>Investigate whether the validation override can be changed to false.

options: options?.map((option) => option.toJSON(validationOverride)) ?? [],

options: options?.map((option) => option.toJSON(validationOverride)) ?? [],

</issue_description>

Comments on the Issue (you are @copilot in this section)


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

@vercel
Copy link

vercel bot commented Nov 26, 2025

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

2 Skipped Deployments
Project Deployment Preview Comments Updated (UTC)
discord-js Skipped Skipped Nov 26, 2025 11:30am
discord-js-guide Skipped Skipped Nov 26, 2025 11:30am

@vercel vercel bot temporarily deployed to Preview – discord-js-guide November 26, 2025 11:18 Inactive
@vercel vercel bot temporarily deployed to Preview – discord-js November 26, 2025 11:18 Inactive
@vercel vercel bot temporarily deployed to Preview – discord-js-guide November 26, 2025 11:30 Inactive
@vercel vercel bot temporarily deployed to Preview – discord-js November 26, 2025 11:30 Inactive
Copilot AI changed the title [WIP] Refactor chat input command subcommands overrides refactor(builders)!: use full predicates and disable nested validation Nov 26, 2025
Copilot AI requested a review from Jiralite November 26, 2025 11:38
Copilot finished work on behalf of Jiralite November 26, 2025 11:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Todo

Development

Successfully merging this pull request may close these issues.

Refactor chat input command subcommands overrides

2 participants