Skip to content

Commit

Permalink
feat: missing subscription dispatch types (#1105)
Browse files Browse the repository at this point in the history
  • Loading branch information
almeidx committed Sep 22, 2024
1 parent 2ae2324 commit 2b653a0
Show file tree
Hide file tree
Showing 4 changed files with 204 additions and 0 deletions.
51 changes: 51 additions & 0 deletions deno/gateway/v10.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ import type {
APIAuditLogEntry,
APIEntitlement,
ChannelType,
APISubscription,
} from '../payloads/v10/mod.ts';
import type { ReactionType } from '../rest/v10/mod.ts';
import type { Nullable } from '../utils/internals.ts';
Expand Down Expand Up @@ -349,6 +350,7 @@ export type GatewayDispatchPayload =
| GatewayStageInstanceCreateDispatch
| GatewayStageInstanceDeleteDispatch
| GatewayStageInstanceUpdateDispatch
| GatewaySubscriptionModifyDispatch
| GatewayThreadCreateDispatch
| GatewayThreadDeleteDispatch
| GatewayThreadListSyncDispatch
Expand Down Expand Up @@ -617,6 +619,55 @@ export interface GatewayApplicationCommandPermissionsUpdateDispatchData {
permissions: APIApplicationCommandPermission[];
}

/**
* https://discord.com/developers/docs/topics/gateway-events#subscription-create
* https://discord.com/developers/docs/topics/gateway-events#subscription-update
* https://discord.com/developers/docs/topics/gateway-events#subscription-delete
*/
export type GatewaySubscriptionModifyDispatch = DataPayload<
| GatewayDispatchEvents.SubscriptionCreate
| GatewayDispatchEvents.SubscriptionDelete
| GatewayDispatchEvents.SubscriptionUpdate,
GatewaySubscriptionModifyDispatchData
>;

/**
* https://discord.com/developers/docs/topics/gateway-events#subscription-create
* https://discord.com/developers/docs/topics/gateway-events#subscription-update
* https://discord.com/developers/docs/topics/gateway-events#subscription-delete
*/
export type GatewaySubscriptionModifyDispatchData = APISubscription;

/**
* https://discord.com/developers/docs/topics/gateway-events#subscription-create
*/
export type GatewaySubscriptionCreateDispatch = GatewaySubscriptionModifyDispatch;

/**
* https://discord.com/developers/docs/topics/gateway-events#subscription-create
*/
export type GatewaySubscriptionCreateDispatchData = GatewaySubscriptionModifyDispatchData;

/**
* https://discord.com/developers/docs/topics/gateway-events#subscription-update
*/
export type GatewaySubscriptionUpdateDispatch = GatewaySubscriptionModifyDispatch;

/**
* https://discord.com/developers/docs/topics/gateway-events#subscription-update
*/
export type GatewaySubscriptionUpdateDispatchData = GatewaySubscriptionModifyDispatchData;

/**
* https://discord.com/developers/docs/topics/gateway-events#subscription-delete
*/
export type GatewaySubscriptionDeleteDispatch = GatewaySubscriptionModifyDispatch;

/**
* https://discord.com/developers/docs/topics/gateway-events#subscription-delete
*/
export type GatewaySubscriptionDeleteDispatchData = GatewaySubscriptionModifyDispatchData;

/**
* https://discord.com/developers/docs/topics/gateway-events#channel-create
* https://discord.com/developers/docs/topics/gateway-events#channel-update
Expand Down
51 changes: 51 additions & 0 deletions deno/gateway/v9.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ import type {
AutoModerationRuleTriggerType,
APIAuditLogEntry,
ChannelType,
APISubscription,
} from '../payloads/v9/mod.ts';
import type { ReactionType } from '../rest/v9/mod.ts';
import type { Nullable } from '../utils/internals.ts';
Expand Down Expand Up @@ -348,6 +349,7 @@ export type GatewayDispatchPayload =
| GatewayStageInstanceCreateDispatch
| GatewayStageInstanceDeleteDispatch
| GatewayStageInstanceUpdateDispatch
| GatewaySubscriptionModifyDispatch
| GatewayThreadCreateDispatch
| GatewayThreadDeleteDispatch
| GatewayThreadListSyncDispatch
Expand Down Expand Up @@ -616,6 +618,55 @@ export interface GatewayApplicationCommandPermissionsUpdateDispatchData {
permissions: APIApplicationCommandPermission[];
}

/**
* https://discord.com/developers/docs/topics/gateway-events#subscription-create
* https://discord.com/developers/docs/topics/gateway-events#subscription-update
* https://discord.com/developers/docs/topics/gateway-events#subscription-delete
*/
export type GatewaySubscriptionModifyDispatch = DataPayload<
| GatewayDispatchEvents.SubscriptionCreate
| GatewayDispatchEvents.SubscriptionDelete
| GatewayDispatchEvents.SubscriptionUpdate,
GatewaySubscriptionModifyDispatchData
>;

/**
* https://discord.com/developers/docs/topics/gateway-events#subscription-create
* https://discord.com/developers/docs/topics/gateway-events#subscription-update
* https://discord.com/developers/docs/topics/gateway-events#subscription-delete
*/
export type GatewaySubscriptionModifyDispatchData = APISubscription;

/**
* https://discord.com/developers/docs/topics/gateway-events#subscription-create
*/
export type GatewaySubscriptionCreateDispatch = GatewaySubscriptionModifyDispatch;

/**
* https://discord.com/developers/docs/topics/gateway-events#subscription-create
*/
export type GatewaySubscriptionCreateDispatchData = GatewaySubscriptionModifyDispatchData;

/**
* https://discord.com/developers/docs/topics/gateway-events#subscription-update
*/
export type GatewaySubscriptionUpdateDispatch = GatewaySubscriptionModifyDispatch;

/**
* https://discord.com/developers/docs/topics/gateway-events#subscription-update
*/
export type GatewaySubscriptionUpdateDispatchData = GatewaySubscriptionModifyDispatchData;

/**
* https://discord.com/developers/docs/topics/gateway-events#subscription-delete
*/
export type GatewaySubscriptionDeleteDispatch = GatewaySubscriptionModifyDispatch;

/**
* https://discord.com/developers/docs/topics/gateway-events#subscription-delete
*/
export type GatewaySubscriptionDeleteDispatchData = GatewaySubscriptionModifyDispatchData;

/**
* https://discord.com/developers/docs/topics/gateway-events#channel-create
* https://discord.com/developers/docs/topics/gateway-events#channel-update
Expand Down
51 changes: 51 additions & 0 deletions gateway/v10.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ import type {
APIAuditLogEntry,
APIEntitlement,
ChannelType,
APISubscription,
} from '../payloads/v10/index';
import type { ReactionType } from '../rest/v10/index';
import type { Nullable } from '../utils/internals';
Expand Down Expand Up @@ -349,6 +350,7 @@ export type GatewayDispatchPayload =
| GatewayStageInstanceCreateDispatch
| GatewayStageInstanceDeleteDispatch
| GatewayStageInstanceUpdateDispatch
| GatewaySubscriptionModifyDispatch
| GatewayThreadCreateDispatch
| GatewayThreadDeleteDispatch
| GatewayThreadListSyncDispatch
Expand Down Expand Up @@ -617,6 +619,55 @@ export interface GatewayApplicationCommandPermissionsUpdateDispatchData {
permissions: APIApplicationCommandPermission[];
}

/**
* https://discord.com/developers/docs/topics/gateway-events#subscription-create
* https://discord.com/developers/docs/topics/gateway-events#subscription-update
* https://discord.com/developers/docs/topics/gateway-events#subscription-delete
*/
export type GatewaySubscriptionModifyDispatch = DataPayload<
| GatewayDispatchEvents.SubscriptionCreate
| GatewayDispatchEvents.SubscriptionDelete
| GatewayDispatchEvents.SubscriptionUpdate,
GatewaySubscriptionModifyDispatchData
>;

/**
* https://discord.com/developers/docs/topics/gateway-events#subscription-create
* https://discord.com/developers/docs/topics/gateway-events#subscription-update
* https://discord.com/developers/docs/topics/gateway-events#subscription-delete
*/
export type GatewaySubscriptionModifyDispatchData = APISubscription;

/**
* https://discord.com/developers/docs/topics/gateway-events#subscription-create
*/
export type GatewaySubscriptionCreateDispatch = GatewaySubscriptionModifyDispatch;

/**
* https://discord.com/developers/docs/topics/gateway-events#subscription-create
*/
export type GatewaySubscriptionCreateDispatchData = GatewaySubscriptionModifyDispatchData;

/**
* https://discord.com/developers/docs/topics/gateway-events#subscription-update
*/
export type GatewaySubscriptionUpdateDispatch = GatewaySubscriptionModifyDispatch;

/**
* https://discord.com/developers/docs/topics/gateway-events#subscription-update
*/
export type GatewaySubscriptionUpdateDispatchData = GatewaySubscriptionModifyDispatchData;

/**
* https://discord.com/developers/docs/topics/gateway-events#subscription-delete
*/
export type GatewaySubscriptionDeleteDispatch = GatewaySubscriptionModifyDispatch;

/**
* https://discord.com/developers/docs/topics/gateway-events#subscription-delete
*/
export type GatewaySubscriptionDeleteDispatchData = GatewaySubscriptionModifyDispatchData;

/**
* https://discord.com/developers/docs/topics/gateway-events#channel-create
* https://discord.com/developers/docs/topics/gateway-events#channel-update
Expand Down
51 changes: 51 additions & 0 deletions gateway/v9.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ import type {
AutoModerationRuleTriggerType,
APIAuditLogEntry,
ChannelType,
APISubscription,
} from '../payloads/v9/index';
import type { ReactionType } from '../rest/v9/index';
import type { Nullable } from '../utils/internals';
Expand Down Expand Up @@ -348,6 +349,7 @@ export type GatewayDispatchPayload =
| GatewayStageInstanceCreateDispatch
| GatewayStageInstanceDeleteDispatch
| GatewayStageInstanceUpdateDispatch
| GatewaySubscriptionModifyDispatch
| GatewayThreadCreateDispatch
| GatewayThreadDeleteDispatch
| GatewayThreadListSyncDispatch
Expand Down Expand Up @@ -616,6 +618,55 @@ export interface GatewayApplicationCommandPermissionsUpdateDispatchData {
permissions: APIApplicationCommandPermission[];
}

/**
* https://discord.com/developers/docs/topics/gateway-events#subscription-create
* https://discord.com/developers/docs/topics/gateway-events#subscription-update
* https://discord.com/developers/docs/topics/gateway-events#subscription-delete
*/
export type GatewaySubscriptionModifyDispatch = DataPayload<
| GatewayDispatchEvents.SubscriptionCreate
| GatewayDispatchEvents.SubscriptionDelete
| GatewayDispatchEvents.SubscriptionUpdate,
GatewaySubscriptionModifyDispatchData
>;

/**
* https://discord.com/developers/docs/topics/gateway-events#subscription-create
* https://discord.com/developers/docs/topics/gateway-events#subscription-update
* https://discord.com/developers/docs/topics/gateway-events#subscription-delete
*/
export type GatewaySubscriptionModifyDispatchData = APISubscription;

/**
* https://discord.com/developers/docs/topics/gateway-events#subscription-create
*/
export type GatewaySubscriptionCreateDispatch = GatewaySubscriptionModifyDispatch;

/**
* https://discord.com/developers/docs/topics/gateway-events#subscription-create
*/
export type GatewaySubscriptionCreateDispatchData = GatewaySubscriptionModifyDispatchData;

/**
* https://discord.com/developers/docs/topics/gateway-events#subscription-update
*/
export type GatewaySubscriptionUpdateDispatch = GatewaySubscriptionModifyDispatch;

/**
* https://discord.com/developers/docs/topics/gateway-events#subscription-update
*/
export type GatewaySubscriptionUpdateDispatchData = GatewaySubscriptionModifyDispatchData;

/**
* https://discord.com/developers/docs/topics/gateway-events#subscription-delete
*/
export type GatewaySubscriptionDeleteDispatch = GatewaySubscriptionModifyDispatch;

/**
* https://discord.com/developers/docs/topics/gateway-events#subscription-delete
*/
export type GatewaySubscriptionDeleteDispatchData = GatewaySubscriptionModifyDispatchData;

/**
* https://discord.com/developers/docs/topics/gateway-events#channel-create
* https://discord.com/developers/docs/topics/gateway-events#channel-update
Expand Down

0 comments on commit 2b653a0

Please sign in to comment.