From 348dd416d1c94231fdfda88fa0ef03b34a384bb4 Mon Sep 17 00:00:00 2001 From: john-batch <70102999+john-batch@users.noreply.github.com> Date: Thu, 27 Oct 2022 20:16:05 +0200 Subject: [PATCH] fix: add missing gateway dispatch payloads to gateway event union (#619) --- deno/gateway/v10.ts | 36 ++++++++++++++++++++++++++++++++++++ deno/gateway/v9.ts | 36 ++++++++++++++++++++++++++++++++++++ gateway/v10.ts | 36 ++++++++++++++++++++++++++++++++++++ gateway/v9.ts | 36 ++++++++++++++++++++++++++++++++++++ 4 files changed, 144 insertions(+) diff --git a/deno/gateway/v10.ts b/deno/gateway/v10.ts index 13f44e79f..fe8c7e82b 100644 --- a/deno/gateway/v10.ts +++ b/deno/gateway/v10.ts @@ -6,6 +6,7 @@ import type { Snowflake } from '../globals.ts'; import type { GatewayPresenceUpdate } from '../payloads/v10/gateway.ts'; import type { APIApplication, + APIApplicationCommandPermission, APIAutoModerationRule, APIAutoModerationAction, APIChannel, @@ -280,6 +281,11 @@ export type GatewayReceivePayload = | GatewayDispatchPayload; export type GatewayDispatchPayload = + | GatewayAutoModerationRuleModifyDispatch + | GatewayAutoModerationRuleCreateDispatch + | GatewayAutoModerationRuleDeleteDispatch + | GatewayAutoModerationActionExecutionDispatch + | GatewayApplicationCommandPermissionsUpdateDispatch | GatewayChannelModifyDispatch | GatewayChannelPinsUpdateDispatch | GatewayGuildBanModifyDispatch @@ -556,6 +562,36 @@ export interface GatewayAutoModerationActionExecutionDispatchData { matched_content: string | null; } +/** + * https://discord.com/developers/docs/topics/gateway-events#application-command-permissions-update + */ +export type GatewayApplicationCommandPermissionsUpdateDispatch = DataPayload< + GatewayDispatchEvents.ApplicationCommandPermissionsUpdate, + GatewayApplicationCommandPermissionsUpdateDispatchData +>; + +/** + * https://discord.com/developers/docs/topics/gateway-events#application-command-permissions-update + */ +export interface GatewayApplicationCommandPermissionsUpdateDispatchData { + /** + * ID of the command or the application ID + */ + id: Snowflake; + /** + * ID of the application the command belongs to + */ + application_id: Snowflake; + /** + * ID of the guild + */ + guild_id: Snowflake; + /** + * Permissions for the command in the guild, max of 100 + */ + permissions: APIApplicationCommandPermission[]; +} + /** * https://discord.com/developers/docs/topics/gateway#channel-create * https://discord.com/developers/docs/topics/gateway#channel-update diff --git a/deno/gateway/v9.ts b/deno/gateway/v9.ts index 28d4a1eb4..067c14844 100644 --- a/deno/gateway/v9.ts +++ b/deno/gateway/v9.ts @@ -6,6 +6,7 @@ import type { Snowflake } from '../globals.ts'; import type { GatewayPresenceUpdate } from '../payloads/v9/gateway.ts'; import type { APIApplication, + APIApplicationCommandPermission, APIAutoModerationRule, APIAutoModerationAction, APIChannel, @@ -279,6 +280,11 @@ export type GatewayReceivePayload = | GatewayDispatchPayload; export type GatewayDispatchPayload = + | GatewayApplicationCommandPermissionsUpdateDispatch + | GatewayAutoModerationRuleModifyDispatch + | GatewayAutoModerationRuleCreateDispatch + | GatewayAutoModerationRuleDeleteDispatch + | GatewayAutoModerationActionExecutionDispatch | GatewayChannelModifyDispatch | GatewayChannelPinsUpdateDispatch | GatewayGuildBanModifyDispatch @@ -555,6 +561,36 @@ export interface GatewayAutoModerationActionExecutionDispatchData { matched_content: string | null; } +/** + * https://discord.com/developers/docs/topics/gateway-events#application-command-permissions-update + */ +export type GatewayApplicationCommandPermissionsUpdateDispatch = DataPayload< + GatewayDispatchEvents.ApplicationCommandPermissionsUpdate, + GatewayApplicationCommandPermissionsUpdateDispatchData +>; + +/** + * https://discord.com/developers/docs/topics/gateway-events#application-command-permissions-update + */ +export interface GatewayApplicationCommandPermissionsUpdateDispatchData { + /** + * ID of the command or the application ID + */ + id: Snowflake; + /** + * ID of the application the command belongs to + */ + application_id: Snowflake; + /** + * ID of the guild + */ + guild_id: Snowflake; + /** + * Permissions for the command in the guild, max of 100 + */ + permissions: APIApplicationCommandPermission[]; +} + /** * https://discord.com/developers/docs/topics/gateway#channel-create * https://discord.com/developers/docs/topics/gateway#channel-update diff --git a/gateway/v10.ts b/gateway/v10.ts index 5b7dc6909..fe347e8fb 100644 --- a/gateway/v10.ts +++ b/gateway/v10.ts @@ -6,6 +6,7 @@ import type { Snowflake } from '../globals'; import type { GatewayPresenceUpdate } from '../payloads/v10/gateway'; import type { APIApplication, + APIApplicationCommandPermission, APIAutoModerationRule, APIAutoModerationAction, APIChannel, @@ -280,6 +281,11 @@ export type GatewayReceivePayload = | GatewayDispatchPayload; export type GatewayDispatchPayload = + | GatewayAutoModerationRuleModifyDispatch + | GatewayAutoModerationRuleCreateDispatch + | GatewayAutoModerationRuleDeleteDispatch + | GatewayAutoModerationActionExecutionDispatch + | GatewayApplicationCommandPermissionsUpdateDispatch | GatewayChannelModifyDispatch | GatewayChannelPinsUpdateDispatch | GatewayGuildBanModifyDispatch @@ -556,6 +562,36 @@ export interface GatewayAutoModerationActionExecutionDispatchData { matched_content: string | null; } +/** + * https://discord.com/developers/docs/topics/gateway-events#application-command-permissions-update + */ +export type GatewayApplicationCommandPermissionsUpdateDispatch = DataPayload< + GatewayDispatchEvents.ApplicationCommandPermissionsUpdate, + GatewayApplicationCommandPermissionsUpdateDispatchData +>; + +/** + * https://discord.com/developers/docs/topics/gateway-events#application-command-permissions-update + */ +export interface GatewayApplicationCommandPermissionsUpdateDispatchData { + /** + * ID of the command or the application ID + */ + id: Snowflake; + /** + * ID of the application the command belongs to + */ + application_id: Snowflake; + /** + * ID of the guild + */ + guild_id: Snowflake; + /** + * Permissions for the command in the guild, max of 100 + */ + permissions: APIApplicationCommandPermission[]; +} + /** * https://discord.com/developers/docs/topics/gateway#channel-create * https://discord.com/developers/docs/topics/gateway#channel-update diff --git a/gateway/v9.ts b/gateway/v9.ts index af0e598e4..367a08cf0 100644 --- a/gateway/v9.ts +++ b/gateway/v9.ts @@ -6,6 +6,7 @@ import type { Snowflake } from '../globals'; import type { GatewayPresenceUpdate } from '../payloads/v9/gateway'; import type { APIApplication, + APIApplicationCommandPermission, APIAutoModerationRule, APIAutoModerationAction, APIChannel, @@ -279,6 +280,11 @@ export type GatewayReceivePayload = | GatewayDispatchPayload; export type GatewayDispatchPayload = + | GatewayApplicationCommandPermissionsUpdateDispatch + | GatewayAutoModerationRuleModifyDispatch + | GatewayAutoModerationRuleCreateDispatch + | GatewayAutoModerationRuleDeleteDispatch + | GatewayAutoModerationActionExecutionDispatch | GatewayChannelModifyDispatch | GatewayChannelPinsUpdateDispatch | GatewayGuildBanModifyDispatch @@ -555,6 +561,36 @@ export interface GatewayAutoModerationActionExecutionDispatchData { matched_content: string | null; } +/** + * https://discord.com/developers/docs/topics/gateway-events#application-command-permissions-update + */ +export type GatewayApplicationCommandPermissionsUpdateDispatch = DataPayload< + GatewayDispatchEvents.ApplicationCommandPermissionsUpdate, + GatewayApplicationCommandPermissionsUpdateDispatchData +>; + +/** + * https://discord.com/developers/docs/topics/gateway-events#application-command-permissions-update + */ +export interface GatewayApplicationCommandPermissionsUpdateDispatchData { + /** + * ID of the command or the application ID + */ + id: Snowflake; + /** + * ID of the application the command belongs to + */ + application_id: Snowflake; + /** + * ID of the guild + */ + guild_id: Snowflake; + /** + * Permissions for the command in the guild, max of 100 + */ + permissions: APIApplicationCommandPermission[]; +} + /** * https://discord.com/developers/docs/topics/gateway#channel-create * https://discord.com/developers/docs/topics/gateway#channel-update