Skip to content

Commit

Permalink
fix: add missing gateway dispatch payloads to gateway event union (#619)
Browse files Browse the repository at this point in the history
  • Loading branch information
john-batch committed Oct 27, 2022
1 parent aaa57b4 commit 348dd41
Show file tree
Hide file tree
Showing 4 changed files with 144 additions and 0 deletions.
36 changes: 36 additions & 0 deletions deno/gateway/v10.ts
Expand Up @@ -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,
Expand Down Expand Up @@ -280,6 +281,11 @@ export type GatewayReceivePayload =
| GatewayDispatchPayload;

export type GatewayDispatchPayload =
| GatewayAutoModerationRuleModifyDispatch
| GatewayAutoModerationRuleCreateDispatch
| GatewayAutoModerationRuleDeleteDispatch
| GatewayAutoModerationActionExecutionDispatch
| GatewayApplicationCommandPermissionsUpdateDispatch
| GatewayChannelModifyDispatch
| GatewayChannelPinsUpdateDispatch
| GatewayGuildBanModifyDispatch
Expand Down Expand Up @@ -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
Expand Down
36 changes: 36 additions & 0 deletions deno/gateway/v9.ts
Expand Up @@ -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,
Expand Down Expand Up @@ -279,6 +280,11 @@ export type GatewayReceivePayload =
| GatewayDispatchPayload;

export type GatewayDispatchPayload =
| GatewayApplicationCommandPermissionsUpdateDispatch
| GatewayAutoModerationRuleModifyDispatch
| GatewayAutoModerationRuleCreateDispatch
| GatewayAutoModerationRuleDeleteDispatch
| GatewayAutoModerationActionExecutionDispatch
| GatewayChannelModifyDispatch
| GatewayChannelPinsUpdateDispatch
| GatewayGuildBanModifyDispatch
Expand Down Expand Up @@ -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
Expand Down
36 changes: 36 additions & 0 deletions gateway/v10.ts
Expand Up @@ -6,6 +6,7 @@ import type { Snowflake } from '../globals';
import type { GatewayPresenceUpdate } from '../payloads/v10/gateway';
import type {
APIApplication,
APIApplicationCommandPermission,
APIAutoModerationRule,
APIAutoModerationAction,
APIChannel,
Expand Down Expand Up @@ -280,6 +281,11 @@ export type GatewayReceivePayload =
| GatewayDispatchPayload;

export type GatewayDispatchPayload =
| GatewayAutoModerationRuleModifyDispatch
| GatewayAutoModerationRuleCreateDispatch
| GatewayAutoModerationRuleDeleteDispatch
| GatewayAutoModerationActionExecutionDispatch
| GatewayApplicationCommandPermissionsUpdateDispatch
| GatewayChannelModifyDispatch
| GatewayChannelPinsUpdateDispatch
| GatewayGuildBanModifyDispatch
Expand Down Expand Up @@ -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
Expand Down
36 changes: 36 additions & 0 deletions gateway/v9.ts
Expand Up @@ -6,6 +6,7 @@ import type { Snowflake } from '../globals';
import type { GatewayPresenceUpdate } from '../payloads/v9/gateway';
import type {
APIApplication,
APIApplicationCommandPermission,
APIAutoModerationRule,
APIAutoModerationAction,
APIChannel,
Expand Down Expand Up @@ -279,6 +280,11 @@ export type GatewayReceivePayload =
| GatewayDispatchPayload;

export type GatewayDispatchPayload =
| GatewayApplicationCommandPermissionsUpdateDispatch
| GatewayAutoModerationRuleModifyDispatch
| GatewayAutoModerationRuleCreateDispatch
| GatewayAutoModerationRuleDeleteDispatch
| GatewayAutoModerationActionExecutionDispatch
| GatewayChannelModifyDispatch
| GatewayChannelPinsUpdateDispatch
| GatewayGuildBanModifyDispatch
Expand Down Expand Up @@ -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
Expand Down

1 comment on commit 348dd41

@vercel
Copy link

@vercel vercel bot commented on 348dd41 Oct 27, 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.