Skip to content

Commit

Permalink
refactor(APIVoiceChannelBase): support text and video in stages (#721)
Browse files Browse the repository at this point in the history
  • Loading branch information
Mateo-tem committed Feb 17, 2023
1 parent c09c5f5 commit 040b682
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 40 deletions.
20 changes: 10 additions & 10 deletions deno/payloads/v10/channel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,8 @@ export type TextChannelType =
| ChannelType.AnnouncementThread
| ChannelType.GuildText
| ChannelType.GuildForum
| ChannelType.GuildVoice;
| ChannelType.GuildVoice
| ChannelType.GuildStageVoice;

export type GuildChannelType = Exclude<ChannelType, ChannelType.DM | ChannelType.GroupDM>;

Expand Down Expand Up @@ -132,13 +133,15 @@ export type APITextChannel = APIGuildTextChannel<ChannelType.GuildText>;
export type APINewsChannel = APIGuildTextChannel<ChannelType.GuildAnnouncement>;
export type APIGuildCategoryChannel = APIGuildChannel<ChannelType.GuildCategory>;

export interface APIVoiceChannelBase<T extends ChannelType> extends APIGuildChannel<T> {
export interface APIVoiceChannelBase<T extends ChannelType>
extends APIGuildChannel<T>,
Omit<APITextBasedChannel<T>, 'name' | 'last_pin_timestamp'> {
/**
* The bitrate (in bits) of the voice channel
* The bitrate (in bits) of the voice or stage channel
*/
bitrate?: number;
/**
* The user limit of the voice channel
* The user limit of the voice or stage channel
*/
user_limit?: number;
/**
Expand All @@ -147,19 +150,16 @@ export interface APIVoiceChannelBase<T extends ChannelType> extends APIGuildChan
* See https://discord.com/developers/docs/resources/voice#voice-region-object
*/
rtc_region?: string | null;
}

export interface APIGuildVoiceChannel
extends APIVoiceChannelBase<ChannelType.GuildVoice>,
Omit<APITextBasedChannel<ChannelType.GuildVoice>, 'name' | 'last_pin_timestamp'> {
/**
* The camera video quality mode of the voice channel, `1` when not present
* The camera video quality mode of the voice or stage channel, `1` when not present
*
* See https://discord.com/developers/docs/resources/channel#channel-object-video-quality-modes
*/
video_quality_mode?: VideoQualityMode;
}

export type APIGuildVoiceChannel = APIVoiceChannelBase<ChannelType.GuildVoice>;

export type APIGuildStageVoiceChannel = APIVoiceChannelBase<ChannelType.GuildStageVoice>;

export interface APIDMChannelBase<T extends ChannelType> extends Omit<APITextBasedChannel<T>, 'rate_limit_per_user'> {
Expand Down
20 changes: 10 additions & 10 deletions deno/payloads/v9/channel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,8 @@ export type TextChannelType =
| ChannelType.AnnouncementThread
| ChannelType.GuildText
| ChannelType.GuildForum
| ChannelType.GuildVoice;
| ChannelType.GuildVoice
| ChannelType.GuildStageVoice;

export type GuildChannelType = Exclude<ChannelType, ChannelType.DM | ChannelType.GroupDM>;

Expand Down Expand Up @@ -132,13 +133,15 @@ export type APITextChannel = APIGuildTextChannel<ChannelType.GuildText>;
export type APINewsChannel = APIGuildTextChannel<ChannelType.GuildAnnouncement>;
export type APIGuildCategoryChannel = APIGuildChannel<ChannelType.GuildCategory>;

export interface APIVoiceChannelBase<T extends ChannelType> extends APIGuildChannel<T> {
export interface APIVoiceChannelBase<T extends ChannelType>
extends APIGuildChannel<T>,
Omit<APITextBasedChannel<T>, 'name' | 'last_pin_timestamp'> {
/**
* The bitrate (in bits) of the voice channel
* The bitrate (in bits) of the voice or stage channel
*/
bitrate?: number;
/**
* The user limit of the voice channel
* The user limit of the voice or stage channel
*/
user_limit?: number;
/**
Expand All @@ -147,19 +150,16 @@ export interface APIVoiceChannelBase<T extends ChannelType> extends APIGuildChan
* See https://discord.com/developers/docs/resources/voice#voice-region-object
*/
rtc_region?: string | null;
}

export interface APIGuildVoiceChannel
extends APIVoiceChannelBase<ChannelType.GuildVoice>,
Omit<APITextBasedChannel<ChannelType.GuildVoice>, 'name' | 'last_pin_timestamp'> {
/**
* The camera video quality mode of the voice channel, `1` when not present
* The camera video quality mode of the voice or stage channel, `1` when not present
*
* See https://discord.com/developers/docs/resources/channel#channel-object-video-quality-modes
*/
video_quality_mode?: VideoQualityMode;
}

export type APIGuildVoiceChannel = APIVoiceChannelBase<ChannelType.GuildVoice>;

export type APIGuildStageVoiceChannel = APIVoiceChannelBase<ChannelType.GuildStageVoice>;

export interface APIDMChannelBase<T extends ChannelType> extends Omit<APITextBasedChannel<T>, 'rate_limit_per_user'> {
Expand Down
20 changes: 10 additions & 10 deletions payloads/v10/channel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,8 @@ export type TextChannelType =
| ChannelType.AnnouncementThread
| ChannelType.GuildText
| ChannelType.GuildForum
| ChannelType.GuildVoice;
| ChannelType.GuildVoice
| ChannelType.GuildStageVoice;

export type GuildChannelType = Exclude<ChannelType, ChannelType.DM | ChannelType.GroupDM>;

Expand Down Expand Up @@ -132,13 +133,15 @@ export type APITextChannel = APIGuildTextChannel<ChannelType.GuildText>;
export type APINewsChannel = APIGuildTextChannel<ChannelType.GuildAnnouncement>;
export type APIGuildCategoryChannel = APIGuildChannel<ChannelType.GuildCategory>;

export interface APIVoiceChannelBase<T extends ChannelType> extends APIGuildChannel<T> {
export interface APIVoiceChannelBase<T extends ChannelType>
extends APIGuildChannel<T>,
Omit<APITextBasedChannel<T>, 'name' | 'last_pin_timestamp'> {
/**
* The bitrate (in bits) of the voice channel
* The bitrate (in bits) of the voice or stage channel
*/
bitrate?: number;
/**
* The user limit of the voice channel
* The user limit of the voice or stage channel
*/
user_limit?: number;
/**
Expand All @@ -147,19 +150,16 @@ export interface APIVoiceChannelBase<T extends ChannelType> extends APIGuildChan
* See https://discord.com/developers/docs/resources/voice#voice-region-object
*/
rtc_region?: string | null;
}

export interface APIGuildVoiceChannel
extends APIVoiceChannelBase<ChannelType.GuildVoice>,
Omit<APITextBasedChannel<ChannelType.GuildVoice>, 'name' | 'last_pin_timestamp'> {
/**
* The camera video quality mode of the voice channel, `1` when not present
* The camera video quality mode of the voice or stage channel, `1` when not present
*
* See https://discord.com/developers/docs/resources/channel#channel-object-video-quality-modes
*/
video_quality_mode?: VideoQualityMode;
}

export type APIGuildVoiceChannel = APIVoiceChannelBase<ChannelType.GuildVoice>;

export type APIGuildStageVoiceChannel = APIVoiceChannelBase<ChannelType.GuildStageVoice>;

export interface APIDMChannelBase<T extends ChannelType> extends Omit<APITextBasedChannel<T>, 'rate_limit_per_user'> {
Expand Down
20 changes: 10 additions & 10 deletions payloads/v9/channel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,8 @@ export type TextChannelType =
| ChannelType.AnnouncementThread
| ChannelType.GuildText
| ChannelType.GuildForum
| ChannelType.GuildVoice;
| ChannelType.GuildVoice
| ChannelType.GuildStageVoice;

export type GuildChannelType = Exclude<ChannelType, ChannelType.DM | ChannelType.GroupDM>;

Expand Down Expand Up @@ -132,13 +133,15 @@ export type APITextChannel = APIGuildTextChannel<ChannelType.GuildText>;
export type APINewsChannel = APIGuildTextChannel<ChannelType.GuildAnnouncement>;
export type APIGuildCategoryChannel = APIGuildChannel<ChannelType.GuildCategory>;

export interface APIVoiceChannelBase<T extends ChannelType> extends APIGuildChannel<T> {
export interface APIVoiceChannelBase<T extends ChannelType>
extends APIGuildChannel<T>,
Omit<APITextBasedChannel<T>, 'name' | 'last_pin_timestamp'> {
/**
* The bitrate (in bits) of the voice channel
* The bitrate (in bits) of the voice or stage channel
*/
bitrate?: number;
/**
* The user limit of the voice channel
* The user limit of the voice or stage channel
*/
user_limit?: number;
/**
Expand All @@ -147,19 +150,16 @@ export interface APIVoiceChannelBase<T extends ChannelType> extends APIGuildChan
* See https://discord.com/developers/docs/resources/voice#voice-region-object
*/
rtc_region?: string | null;
}

export interface APIGuildVoiceChannel
extends APIVoiceChannelBase<ChannelType.GuildVoice>,
Omit<APITextBasedChannel<ChannelType.GuildVoice>, 'name' | 'last_pin_timestamp'> {
/**
* The camera video quality mode of the voice channel, `1` when not present
* The camera video quality mode of the voice or stage channel, `1` when not present
*
* See https://discord.com/developers/docs/resources/channel#channel-object-video-quality-modes
*/
video_quality_mode?: VideoQualityMode;
}

export type APIGuildVoiceChannel = APIVoiceChannelBase<ChannelType.GuildVoice>;

export type APIGuildStageVoiceChannel = APIVoiceChannelBase<ChannelType.GuildStageVoice>;

export interface APIDMChannelBase<T extends ChannelType> extends Omit<APITextBasedChannel<T>, 'rate_limit_per_user'> {
Expand Down

1 comment on commit 040b682

@vercel
Copy link

@vercel vercel bot commented on 040b682 Feb 17, 2023

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.