From bc9ab4556ca8a7c8e4c7942c87fa322c91b733dc Mon Sep 17 00:00:00 2001 From: Advaith Date: Sun, 18 Apr 2021 00:34:51 -0700 Subject: [PATCH] refactor(Invite): rename `InviteTargetUserType` to `InviteTargetType` (#124) Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> BREAKING CHANGE: `InviteTargetUserType` is renamed to `InviteTargetType`, to match the documentation. - Reference: https://github.com/discord/discord-api-docs/pull/2690 --- deno/gateway/v8.ts | 8 ++++---- deno/payloads/v8/invite.ts | 10 ++++++---- deno/rest/v8/channel.ts | 8 +++++--- gateway/v8.ts | 8 ++++---- payloads/v8/invite.ts | 10 ++++++---- rest/v8/channel.ts | 8 +++++--- 6 files changed, 30 insertions(+), 22 deletions(-) diff --git a/deno/gateway/v8.ts b/deno/gateway/v8.ts index 40734f17..4cbc4107 100644 --- a/deno/gateway/v8.ts +++ b/deno/gateway/v8.ts @@ -19,7 +19,7 @@ import type { GatewayActivity, GatewayPresenceUpdate as RawGatewayPresenceUpdate, GatewayVoiceState, - InviteTargetUserType, + InviteTargetType, PresenceUpdateStatus, } from '../payloads/v8/mod.ts'; @@ -936,11 +936,11 @@ export interface GatewayInviteCreateDispatchData { */ max_uses: number; /** - * The type of user target for this voice channel invite + * The type of target for this voice channel invite * - * See https://discord.com/developers/docs/resources/invite#invite-object-target-user-types + * See https://discord.com/developers/docs/resources/invite#invite-object-invite-target-types */ - target_type?: InviteTargetUserType; + target_type?: InviteTargetType; /** * The user whose stream to display for this voice channel stream invite * diff --git a/deno/payloads/v8/invite.ts b/deno/payloads/v8/invite.ts index c31b47fd..ffc10d7c 100644 --- a/deno/payloads/v8/invite.ts +++ b/deno/payloads/v8/invite.ts @@ -34,11 +34,11 @@ export interface APIInvite { */ inviter?: APIUser; /** - * The type of user target for this voice channel invite + * The type of target for this voice channel invite * * See https://discord.com/developers/docs/resources/invite#invite-object-target-user-types */ - target_type?: InviteTargetUserType; + target_type?: InviteTargetType; /** * The user whose stream to display for this voice channel stream invite * @@ -47,6 +47,8 @@ export interface APIInvite { target_user?: APIUser; /** * The embedded application to open for this voice channel embedded application invite + * + * See https://discord.com/developers/docs/topics/oauth2#application */ target_application?: Partial; /** @@ -60,9 +62,9 @@ export interface APIInvite { } /** - * https://discord.com/developers/docs/resources/invite#invite-object-target-user-types + * https://discord.com/developers/docs/resources/invite#invite-object-invite-target-types */ -export enum InviteTargetUserType { +export enum InviteTargetType { STREAM = 1, EMBEDDED_APPLICATION, } diff --git a/deno/rest/v8/channel.ts b/deno/rest/v8/channel.ts index 93d50154..5290963d 100644 --- a/deno/rest/v8/channel.ts +++ b/deno/rest/v8/channel.ts @@ -10,7 +10,7 @@ import type { APIOverwrite, APIUser, ChannelType, - InviteTargetUserType, + InviteTargetType, MessageFlags, OverwriteType, VideoQualityMode, @@ -385,9 +385,11 @@ export interface RESTPostAPIChannelInviteJSONBody { */ unique?: boolean; /** - * The type of target user for this voice channel invite + * The type of target for this voice channel invite + * + * See https://discord.com/developers/docs/resources/invite#invite-object-invite-target-types */ - target_type?: InviteTargetUserType; + target_type?: InviteTargetType; /** * The id of the user whose stream to display for this invite * - Required if `target_type` is 1 diff --git a/gateway/v8.ts b/gateway/v8.ts index c87e415f..5550639a 100644 --- a/gateway/v8.ts +++ b/gateway/v8.ts @@ -19,7 +19,7 @@ import type { GatewayActivity, GatewayPresenceUpdate as RawGatewayPresenceUpdate, GatewayVoiceState, - InviteTargetUserType, + InviteTargetType, PresenceUpdateStatus, } from '../payloads/v8/index'; @@ -936,11 +936,11 @@ export interface GatewayInviteCreateDispatchData { */ max_uses: number; /** - * The type of user target for this voice channel invite + * The type of target for this voice channel invite * - * See https://discord.com/developers/docs/resources/invite#invite-object-target-user-types + * See https://discord.com/developers/docs/resources/invite#invite-object-invite-target-types */ - target_type?: InviteTargetUserType; + target_type?: InviteTargetType; /** * The user whose stream to display for this voice channel stream invite * diff --git a/payloads/v8/invite.ts b/payloads/v8/invite.ts index eef9b85a..c9fc5dd3 100644 --- a/payloads/v8/invite.ts +++ b/payloads/v8/invite.ts @@ -34,11 +34,11 @@ export interface APIInvite { */ inviter?: APIUser; /** - * The type of user target for this voice channel invite + * The type of target for this voice channel invite * * See https://discord.com/developers/docs/resources/invite#invite-object-target-user-types */ - target_type?: InviteTargetUserType; + target_type?: InviteTargetType; /** * The user whose stream to display for this voice channel stream invite * @@ -47,6 +47,8 @@ export interface APIInvite { target_user?: APIUser; /** * The embedded application to open for this voice channel embedded application invite + * + * See https://discord.com/developers/docs/topics/oauth2#application */ target_application?: Partial; /** @@ -60,9 +62,9 @@ export interface APIInvite { } /** - * https://discord.com/developers/docs/resources/invite#invite-object-target-user-types + * https://discord.com/developers/docs/resources/invite#invite-object-invite-target-types */ -export const enum InviteTargetUserType { +export const enum InviteTargetType { STREAM = 1, EMBEDDED_APPLICATION, } diff --git a/rest/v8/channel.ts b/rest/v8/channel.ts index 0a1bb6e7..cedf31c7 100644 --- a/rest/v8/channel.ts +++ b/rest/v8/channel.ts @@ -10,7 +10,7 @@ import type { APIOverwrite, APIUser, ChannelType, - InviteTargetUserType, + InviteTargetType, MessageFlags, OverwriteType, VideoQualityMode, @@ -385,9 +385,11 @@ export interface RESTPostAPIChannelInviteJSONBody { */ unique?: boolean; /** - * The type of target user for this voice channel invite + * The type of target for this voice channel invite + * + * See https://discord.com/developers/docs/resources/invite#invite-object-invite-target-types */ - target_type?: InviteTargetUserType; + target_type?: InviteTargetType; /** * The id of the user whose stream to display for this invite * - Required if `target_type` is 1