Skip to content

Commit

Permalink
fix(APIApplicationCommandAutocompleteInteraction): make options fie…
Browse files Browse the repository at this point in the history
…ld required (#332)
  • Loading branch information
andre4ik3 committed Feb 15, 2022
1 parent a8f19e6 commit 5396daf
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 6 deletions.
5 changes: 4 additions & 1 deletion deno/payloads/v8/_interactions/autocomplete.ts
Expand Up @@ -12,7 +12,10 @@ export type APIApplicationCommandAutocompleteInteraction = APIBaseInteraction<
> &
Required<
Pick<
APIBaseInteraction<InteractionType.ApplicationCommandAutocomplete, APIChatInputApplicationCommandInteractionData>,
APIBaseInteraction<
InteractionType.ApplicationCommandAutocomplete,
Required<Pick<APIChatInputApplicationCommandInteractionData, 'options'>>
>,
'data'
>
>;
Expand Down
5 changes: 4 additions & 1 deletion deno/payloads/v9/_interactions/autocomplete.ts
Expand Up @@ -12,7 +12,10 @@ export type APIApplicationCommandAutocompleteInteraction = APIBaseInteraction<
> &
Required<
Pick<
APIBaseInteraction<InteractionType.ApplicationCommandAutocomplete, APIChatInputApplicationCommandInteractionData>,
APIBaseInteraction<
InteractionType.ApplicationCommandAutocomplete,
Required<Pick<APIChatInputApplicationCommandInteractionData, 'options'>>
>,
'data'
>
>;
Expand Down
5 changes: 4 additions & 1 deletion payloads/v8/_interactions/autocomplete.ts
Expand Up @@ -12,7 +12,10 @@ export type APIApplicationCommandAutocompleteInteraction = APIBaseInteraction<
> &
Required<
Pick<
APIBaseInteraction<InteractionType.ApplicationCommandAutocomplete, APIChatInputApplicationCommandInteractionData>,
APIBaseInteraction<
InteractionType.ApplicationCommandAutocomplete,
Required<Pick<APIChatInputApplicationCommandInteractionData, 'options'>>
>,
'data'
>
>;
Expand Down
5 changes: 4 additions & 1 deletion payloads/v9/_interactions/autocomplete.ts
Expand Up @@ -12,7 +12,10 @@ export type APIApplicationCommandAutocompleteInteraction = APIBaseInteraction<
> &
Required<
Pick<
APIBaseInteraction<InteractionType.ApplicationCommandAutocomplete, APIChatInputApplicationCommandInteractionData>,
APIBaseInteraction<
InteractionType.ApplicationCommandAutocomplete,
Required<Pick<APIChatInputApplicationCommandInteractionData, 'options'>>
>,
'data'
>
>;
Expand Down
4 changes: 2 additions & 2 deletions tests/v9/interactions.test-d.ts
Expand Up @@ -2,7 +2,7 @@ import { expectType } from 'tsd';
import {
APIApplicationCommandInteraction,
APIApplicationCommandInteractionData,
APIChatInputApplicationCommandInteractionData,
APIApplicationCommandAutocompleteInteraction,
APIDMInteraction,
APIGuildInteraction,
APIInteraction,
Expand Down Expand Up @@ -40,7 +40,7 @@ if (interaction.type === InteractionType.MessageComponent) {
}

if (interaction.type === InteractionType.ApplicationCommandAutocomplete) {
expectType<APIChatInputApplicationCommandInteractionData>(interaction.data);
expectType<APIApplicationCommandAutocompleteInteraction['data']>(interaction.data);
}

if (interaction.type === InteractionType.ModalSubmit) {
Expand Down

0 comments on commit 5396daf

Please sign in to comment.