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

Slash command builder type incompatibility #10256

Closed
Anonymous4078 opened this issue May 6, 2024 · 4 comments · Fixed by #10255
Closed

Slash command builder type incompatibility #10256

Anonymous4078 opened this issue May 6, 2024 · 4 comments · Fixed by #10255

Comments

@Anonymous4078
Copy link

Which package is this bug report for?

discord.js

Issue description

Even after upgrading to 14.15.2

There are many errors

error TS2375: Type 'SlashCommandOptionsOnlyBuilder' is not assignable to type 'SlashCommandBuilder | SlashCommandSubcommandsOnlyBuilder' with 'exactOptionalPropertyTypes: true'. Consider adding 'undefined' to the types of the target's properties.

Code sample

No response

Versions

  • discord.js 14.15.2
  • typescript 5.4.5
  • node.js v20.11.0

Issue priority

High (immediate attention needed)

Which partials do you have configured?

Not applicable

Which gateway intents are you subscribing to?

Not applicable

I have tested this issue on a development release

No response

@monbrey
Copy link
Member

monbrey commented May 6, 2024

Please provide a reproducible code sample.

@Anonymous4078
Copy link
Author

data: new SlashCommandBuilder()
        .setName('info')
        .setDescription('View information')
        .addNumberOption((option) =>
          option
            .setName('id')
            .setDescription('Desc')
            .setRequired(true)
            .setMinValue(1),
        )
        .setDMPermission(false),```

@Jiralite Jiralite changed the title Even more problems Slash command builder type incompatibility May 6, 2024
@Jiralite
Copy link
Member

Jiralite commented May 6, 2024

Please at least make an effort to properly title your issues. At a glance, they are not informative.


This looks like data expects something else—that builder does not reproduce any errors for me. Double-check your data please!

@Anonymous4078
Copy link
Author

Please at least make an effort to properly title your issues. At a glance, they are not informative.

This looks like data expects something else—that builder does not reproduce any errors for me. Double-check your data please!

public readonly data: | SlashCommandBuilder | SlashCommandSubcommandsOnlyBuilder;

@Jiralite Jiralite linked a pull request May 6, 2024 that will close this issue
@Jiralite Jiralite added has PR and removed need repro labels May 6, 2024
@kodiakhq kodiakhq bot closed this as completed in #10255 May 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants