discordjs / builders

A collection of builders that you can use when creating your bot.
Apache License 2.0
97 stars 37 forks source link

(types): ApplicationCommandNumberOptionBase is not extending base properly #67

Open papsavas opened 2 years ago

papsavas commented 2 years ago

Issue description

Since the 13.4.0 Djs release, compiling to js fails due to this error:

node_modules/@discordjs/builders/dist/index.d.ts(516,5): error TS2416: Property 'toJSON' in type 'ApplicationCommandNumberOptionBase' is not assignable to the same property in base type 'ApplicationCommandOptionWithChoicesBase<number>'.
         Type '() => { min_value: number; max_value: number; type: ApplicationCommandOptionType.String | ApplicationCommandOptionType.Integer | ApplicationCommandOptionType.Number; ... 4 more ...; required?: boolean; } | ... 5 more ... | { ...; }' is not assignable to type '() => APIApplicationCommandOption'.
           Type '{ min_value: number; max_value: number; type: ApplicationCommandOptionType.String | ApplicationCommandOptionType.Integer | ApplicationCommandOptionType.Number; ... 4 more ...; required?: boolean; } | ... 5 more ... | { ...; }' is not assignable to type 'APIApplicationCommandOption'.
             Type '{ min_value: number; max_value: number; type: ApplicationCommandOptionType.Subcommand | ApplicationCommandOptionType.SubcommandGroup; options?: APIApplicationCommandOption[]; name: string; description: string; required?: boolean; autocomplete?: undefined; }' is not assignable to type 'APIApplicationCommandOption'.
               Type '{ min_value: number; max_value: number; type: ApplicationCommandOptionType.Subcommand | ApplicationCommandOptionType.SubcommandGroup; options?: APIApplicationCommandOption[]; name: string; description: string; required?: boolean; autocomplete?: undefined; }' is not assignable to type 'APIApplicationCommandNumericAutocompleteOptions'.
                 Types of property 'type' are incompatible.
                   Type 'ApplicationCommandOptionType.Subcommand | ApplicationCommandOptionType.SubcommandGroup' is not assignable to type 'ApplicationCommandOptionType.Integer | ApplicationCommandOptionType.Number'.
                     Type 'ApplicationCommandOptionType.Subcommand' is not assignable to type 'ApplicationCommandOptionType.Integer | ApplicationCommandOptionType.Number'.

Code sample

No response

@discordjs/builders version

0.10.0

Node.js version

nodejs: 16.6.1, typescript: 4.5.4

Operating system

No response

Priority this issue should have

High (immediate attention needed)

vladfrangu commented 2 years ago

Expected, conflicting versions of discord-api-types happened :( We're planning on fixing this very soon! It's an internal issue that needs to be cleaned up

pixeldev commented 2 years ago

Hey! Will this be fixed soon?

vladfrangu commented 2 years ago

I think this has already been fixed with the latest PR! Just needs to be published

pixeldev commented 2 years ago

Oh, then I'm waiting (i really need it );)

S222em commented 2 years ago

Todays release did not fix the issue for me. You were talking about #68?

vladfrangu commented 2 years ago

Yep! Make sure you installed the latest version of builders 👀

S222em commented 2 years ago

Yep! Make sure you installed the latest version of builders 👀

My bad, another non-discordjs related problem popped up.