Skip to content

feat: split CommandInteractionOptionResolver #8439

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

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

Syjalo
Copy link
Contributor

@Syjalo Syjalo commented Aug 5, 2022

Please describe the changes this PR makes and why it should be merged:
This PR splits CommandInteractionOptionResolver to make methods visible in the docs only what are available in the context.

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

@vercel
Copy link

vercel bot commented Aug 5, 2022

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

Name Status Preview Updated
discord-js ✅ Ready (Inspect) Visit Preview Aug 10, 2022 at 5:51PM (UTC)

@vercel vercel bot temporarily deployed to Preview August 5, 2022 11:05 Inactive
@Jiralite Jiralite added this to the discord.js v14.2 milestone Aug 5, 2022
@monbrey
Copy link
Member

monbrey commented Aug 7, 2022

I don't see how this split is correct?

Why are the methods for subcommands, subcommand groups and the primitive types (string, number, integer, boolean) removed from the AutocompleteInteractionOptionResolver? They should all still work, as the value doesn't require any resolved structures.

I thought the issue was only that Discord doesn't send resolved data for Users/GuildMembers, Roles and Channels in AutocompleteInteraction.

Also this is 100% breaking. You changed the interface.

@Rebazkoye

This comment was marked as off-topic.

@vercel vercel bot temporarily deployed to Preview August 10, 2022 17:52 Inactive
@iCrawl iCrawl requested a review from vladfrangu August 12, 2022 03:10
@iCrawl iCrawl added the blocked label Aug 15, 2022
@Jiralite Jiralite removed this from the discord.js v14.3 milestone Aug 17, 2022
@@ -53,7 +53,7 @@ class AutocompleteInteraction extends BaseInteraction {
* The options passed to the command
* @type {CommandInteractionOptionResolver}
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
* @type {CommandInteractionOptionResolver}
* @type {AutocompleteInteractionOptionResolver}

@@ -15,7 +15,7 @@ class ChatInputCommandInteraction extends CommandInteraction {
* The options passed to the command.
* @type {CommandInteractionOptionResolver}
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
* @type {CommandInteractionOptionResolver}
* @type {ChatInputCommandInteractionOptionResolver}

@@ -18,7 +18,7 @@ class ContextMenuCommandInteraction extends CommandInteraction {
* The target of the interaction, parsed into options
* @type {CommandInteractionOptionResolver}
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
* @type {CommandInteractionOptionResolver}
* @type {ContextMenuCommandInteractionOptionResolver}

@Jiralite Jiralite added this to the discord.js 15.0.0 milestone Jul 31, 2024
@Jiralite Jiralite removed the blocked label Oct 1, 2024
@Qjuh
Copy link
Member

Qjuh commented Mar 30, 2025

No idea if this PR is still meant to be implemented.

  • If it is then I got the question why MessageContextMenuInteraction and UserContextMenuInteraction would still share the same CommandInteractionOptionResolver having both methods for getUser() and getMessage(), as the split seems to only be done partially.
  • If it isn't then maybe this PR should be closed

@Syjalo Syjalo marked this pull request as draft March 30, 2025 17:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Review in Progress
Development

Successfully merging this pull request may close these issues.

8 participants