Skip to content

Commit

Permalink
fix(Interactions): make app_permissions required (#652)
Browse files Browse the repository at this point in the history
  • Loading branch information
advaith1 authored Dec 14, 2022
1 parent 2a5413d commit 89bc0f4
Show file tree
Hide file tree
Showing 8 changed files with 24 additions and 16 deletions.
4 changes: 3 additions & 1 deletion deno/payloads/v10/_interactions/applicationCommands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,9 @@ export type APIApplicationCommandInteractionData =
*/
export type APIApplicationCommandInteractionWrapper<Data extends APIApplicationCommandInteractionData> =
APIBaseInteraction<InteractionType.ApplicationCommand, Data> &
Required<Pick<APIBaseInteraction<InteractionType.ApplicationCommand, Data>, 'channel_id' | 'data'>>;
Required<
Pick<APIBaseInteraction<InteractionType.ApplicationCommand, Data>, 'channel_id' | 'data' | 'app_permissions'>
>;

/**
* https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object
Expand Down
6 changes: 3 additions & 3 deletions deno/payloads/v10/_interactions/messageComponents.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export type APIMessageComponentInteraction = APIBaseInteraction<
Required<
Pick<
APIBaseInteraction<InteractionType.MessageComponent, APIMessageComponentInteractionData>,
'channel_id' | 'data' | 'message'
'channel_id' | 'data' | 'app_permissions' | 'message'
>
>;

Expand All @@ -26,7 +26,7 @@ export type APIMessageComponentButtonInteraction = APIBaseInteraction<
Required<
Pick<
APIBaseInteraction<InteractionType.MessageComponent, APIMessageButtonInteractionData>,
'channel_id' | 'data' | 'message'
'channel_id' | 'data' | 'app_permissions' | 'message'
>
>;

Expand All @@ -37,7 +37,7 @@ export type APIMessageComponentSelectMenuInteraction = APIBaseInteraction<
Required<
Pick<
APIBaseInteraction<InteractionType.MessageComponent, APIMessageSelectMenuInteractionData>,
'channel_id' | 'data' | 'message'
'channel_id' | 'data' | 'app_permissions' | 'message'
>
>;

Expand Down
4 changes: 3 additions & 1 deletion deno/payloads/v9/_interactions/applicationCommands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,9 @@ export type APIApplicationCommandInteractionData =
*/
export type APIApplicationCommandInteractionWrapper<Data extends APIApplicationCommandInteractionData> =
APIBaseInteraction<InteractionType.ApplicationCommand, Data> &
Required<Pick<APIBaseInteraction<InteractionType.ApplicationCommand, Data>, 'channel_id' | 'data'>>;
Required<
Pick<APIBaseInteraction<InteractionType.ApplicationCommand, Data>, 'channel_id' | 'data' | 'app_permissions'>
>;

/**
* https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object
Expand Down
6 changes: 3 additions & 3 deletions deno/payloads/v9/_interactions/messageComponents.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export type APIMessageComponentInteraction = APIBaseInteraction<
Required<
Pick<
APIBaseInteraction<InteractionType.MessageComponent, APIMessageComponentInteractionData>,
'channel_id' | 'data' | 'message'
'channel_id' | 'data' | 'app_permissions' | 'message'
>
>;

Expand All @@ -26,7 +26,7 @@ export type APIMessageComponentButtonInteraction = APIBaseInteraction<
Required<
Pick<
APIBaseInteraction<InteractionType.MessageComponent, APIMessageButtonInteractionData>,
'channel_id' | 'data' | 'message'
'channel_id' | 'data' | 'app_permissions' | 'message'
>
>;

Expand All @@ -37,7 +37,7 @@ export type APIMessageComponentSelectMenuInteraction = APIBaseInteraction<
Required<
Pick<
APIBaseInteraction<InteractionType.MessageComponent, APIMessageSelectMenuInteractionData>,
'channel_id' | 'data' | 'message'
'channel_id' | 'data' | 'app_permissions' | 'message'
>
>;

Expand Down
4 changes: 3 additions & 1 deletion payloads/v10/_interactions/applicationCommands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,9 @@ export type APIApplicationCommandInteractionData =
*/
export type APIApplicationCommandInteractionWrapper<Data extends APIApplicationCommandInteractionData> =
APIBaseInteraction<InteractionType.ApplicationCommand, Data> &
Required<Pick<APIBaseInteraction<InteractionType.ApplicationCommand, Data>, 'channel_id' | 'data'>>;
Required<
Pick<APIBaseInteraction<InteractionType.ApplicationCommand, Data>, 'channel_id' | 'data' | 'app_permissions'>
>;

/**
* https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object
Expand Down
6 changes: 3 additions & 3 deletions payloads/v10/_interactions/messageComponents.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export type APIMessageComponentInteraction = APIBaseInteraction<
Required<
Pick<
APIBaseInteraction<InteractionType.MessageComponent, APIMessageComponentInteractionData>,
'channel_id' | 'data' | 'message'
'channel_id' | 'data' | 'app_permissions' | 'message'
>
>;

Expand All @@ -26,7 +26,7 @@ export type APIMessageComponentButtonInteraction = APIBaseInteraction<
Required<
Pick<
APIBaseInteraction<InteractionType.MessageComponent, APIMessageButtonInteractionData>,
'channel_id' | 'data' | 'message'
'channel_id' | 'data' | 'app_permissions' | 'message'
>
>;

Expand All @@ -37,7 +37,7 @@ export type APIMessageComponentSelectMenuInteraction = APIBaseInteraction<
Required<
Pick<
APIBaseInteraction<InteractionType.MessageComponent, APIMessageSelectMenuInteractionData>,
'channel_id' | 'data' | 'message'
'channel_id' | 'data' | 'app_permissions' | 'message'
>
>;

Expand Down
4 changes: 3 additions & 1 deletion payloads/v9/_interactions/applicationCommands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,9 @@ export type APIApplicationCommandInteractionData =
*/
export type APIApplicationCommandInteractionWrapper<Data extends APIApplicationCommandInteractionData> =
APIBaseInteraction<InteractionType.ApplicationCommand, Data> &
Required<Pick<APIBaseInteraction<InteractionType.ApplicationCommand, Data>, 'channel_id' | 'data'>>;
Required<
Pick<APIBaseInteraction<InteractionType.ApplicationCommand, Data>, 'channel_id' | 'data' | 'app_permissions'>
>;

/**
* https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object
Expand Down
6 changes: 3 additions & 3 deletions payloads/v9/_interactions/messageComponents.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export type APIMessageComponentInteraction = APIBaseInteraction<
Required<
Pick<
APIBaseInteraction<InteractionType.MessageComponent, APIMessageComponentInteractionData>,
'channel_id' | 'data' | 'message'
'channel_id' | 'data' | 'app_permissions' | 'message'
>
>;

Expand All @@ -26,7 +26,7 @@ export type APIMessageComponentButtonInteraction = APIBaseInteraction<
Required<
Pick<
APIBaseInteraction<InteractionType.MessageComponent, APIMessageButtonInteractionData>,
'channel_id' | 'data' | 'message'
'channel_id' | 'data' | 'app_permissions' | 'message'
>
>;

Expand All @@ -37,7 +37,7 @@ export type APIMessageComponentSelectMenuInteraction = APIBaseInteraction<
Required<
Pick<
APIBaseInteraction<InteractionType.MessageComponent, APIMessageSelectMenuInteractionData>,
'channel_id' | 'data' | 'message'
'channel_id' | 'data' | 'app_permissions' | 'message'
>
>;

Expand Down

1 comment on commit 89bc0f4

@vercel
Copy link

@vercel vercel bot commented on 89bc0f4 Dec 14, 2022

Choose a reason for hiding this comment

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

Please sign in to comment.