Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: add missing gateway dispatch payloads to gateway event union #619

Merged
merged 7 commits into from
Oct 27, 2022
36 changes: 36 additions & 0 deletions deno/gateway/v10.ts
Original file line number Diff line number Diff line change
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 gateway/v10.ts
Original file line number Diff line number Diff line change
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