Skip to content

Commit 040b682

Browse files
authored
refactor(APIVoiceChannelBase): support text and video in stages (#721)
1 parent c09c5f5 commit 040b682

File tree

4 files changed

+40
-40
lines changed

4 files changed

+40
-40
lines changed

deno/payloads/v10/channel.ts

+10-10
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,8 @@ export type TextChannelType =
4949
| ChannelType.AnnouncementThread
5050
| ChannelType.GuildText
5151
| ChannelType.GuildForum
52-
| ChannelType.GuildVoice;
52+
| ChannelType.GuildVoice
53+
| ChannelType.GuildStageVoice;
5354

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

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

135-
export interface APIVoiceChannelBase<T extends ChannelType> extends APIGuildChannel<T> {
136+
export interface APIVoiceChannelBase<T extends ChannelType>
137+
extends APIGuildChannel<T>,
138+
Omit<APITextBasedChannel<T>, 'name' | 'last_pin_timestamp'> {
136139
/**
137-
* The bitrate (in bits) of the voice channel
140+
* The bitrate (in bits) of the voice or stage channel
138141
*/
139142
bitrate?: number;
140143
/**
141-
* The user limit of the voice channel
144+
* The user limit of the voice or stage channel
142145
*/
143146
user_limit?: number;
144147
/**
@@ -147,19 +150,16 @@ export interface APIVoiceChannelBase<T extends ChannelType> extends APIGuildChan
147150
* See https://discord.com/developers/docs/resources/voice#voice-region-object
148151
*/
149152
rtc_region?: string | null;
150-
}
151-
152-
export interface APIGuildVoiceChannel
153-
extends APIVoiceChannelBase<ChannelType.GuildVoice>,
154-
Omit<APITextBasedChannel<ChannelType.GuildVoice>, 'name' | 'last_pin_timestamp'> {
155153
/**
156-
* The camera video quality mode of the voice channel, `1` when not present
154+
* The camera video quality mode of the voice or stage channel, `1` when not present
157155
*
158156
* See https://discord.com/developers/docs/resources/channel#channel-object-video-quality-modes
159157
*/
160158
video_quality_mode?: VideoQualityMode;
161159
}
162160

161+
export type APIGuildVoiceChannel = APIVoiceChannelBase<ChannelType.GuildVoice>;
162+
163163
export type APIGuildStageVoiceChannel = APIVoiceChannelBase<ChannelType.GuildStageVoice>;
164164

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

deno/payloads/v9/channel.ts

+10-10
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,8 @@ export type TextChannelType =
4949
| ChannelType.AnnouncementThread
5050
| ChannelType.GuildText
5151
| ChannelType.GuildForum
52-
| ChannelType.GuildVoice;
52+
| ChannelType.GuildVoice
53+
| ChannelType.GuildStageVoice;
5354

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

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

135-
export interface APIVoiceChannelBase<T extends ChannelType> extends APIGuildChannel<T> {
136+
export interface APIVoiceChannelBase<T extends ChannelType>
137+
extends APIGuildChannel<T>,
138+
Omit<APITextBasedChannel<T>, 'name' | 'last_pin_timestamp'> {
136139
/**
137-
* The bitrate (in bits) of the voice channel
140+
* The bitrate (in bits) of the voice or stage channel
138141
*/
139142
bitrate?: number;
140143
/**
141-
* The user limit of the voice channel
144+
* The user limit of the voice or stage channel
142145
*/
143146
user_limit?: number;
144147
/**
@@ -147,19 +150,16 @@ export interface APIVoiceChannelBase<T extends ChannelType> extends APIGuildChan
147150
* See https://discord.com/developers/docs/resources/voice#voice-region-object
148151
*/
149152
rtc_region?: string | null;
150-
}
151-
152-
export interface APIGuildVoiceChannel
153-
extends APIVoiceChannelBase<ChannelType.GuildVoice>,
154-
Omit<APITextBasedChannel<ChannelType.GuildVoice>, 'name' | 'last_pin_timestamp'> {
155153
/**
156-
* The camera video quality mode of the voice channel, `1` when not present
154+
* The camera video quality mode of the voice or stage channel, `1` when not present
157155
*
158156
* See https://discord.com/developers/docs/resources/channel#channel-object-video-quality-modes
159157
*/
160158
video_quality_mode?: VideoQualityMode;
161159
}
162160

161+
export type APIGuildVoiceChannel = APIVoiceChannelBase<ChannelType.GuildVoice>;
162+
163163
export type APIGuildStageVoiceChannel = APIVoiceChannelBase<ChannelType.GuildStageVoice>;
164164

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

payloads/v10/channel.ts

+10-10
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,8 @@ export type TextChannelType =
4949
| ChannelType.AnnouncementThread
5050
| ChannelType.GuildText
5151
| ChannelType.GuildForum
52-
| ChannelType.GuildVoice;
52+
| ChannelType.GuildVoice
53+
| ChannelType.GuildStageVoice;
5354

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

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

135-
export interface APIVoiceChannelBase<T extends ChannelType> extends APIGuildChannel<T> {
136+
export interface APIVoiceChannelBase<T extends ChannelType>
137+
extends APIGuildChannel<T>,
138+
Omit<APITextBasedChannel<T>, 'name' | 'last_pin_timestamp'> {
136139
/**
137-
* The bitrate (in bits) of the voice channel
140+
* The bitrate (in bits) of the voice or stage channel
138141
*/
139142
bitrate?: number;
140143
/**
141-
* The user limit of the voice channel
144+
* The user limit of the voice or stage channel
142145
*/
143146
user_limit?: number;
144147
/**
@@ -147,19 +150,16 @@ export interface APIVoiceChannelBase<T extends ChannelType> extends APIGuildChan
147150
* See https://discord.com/developers/docs/resources/voice#voice-region-object
148151
*/
149152
rtc_region?: string | null;
150-
}
151-
152-
export interface APIGuildVoiceChannel
153-
extends APIVoiceChannelBase<ChannelType.GuildVoice>,
154-
Omit<APITextBasedChannel<ChannelType.GuildVoice>, 'name' | 'last_pin_timestamp'> {
155153
/**
156-
* The camera video quality mode of the voice channel, `1` when not present
154+
* The camera video quality mode of the voice or stage channel, `1` when not present
157155
*
158156
* See https://discord.com/developers/docs/resources/channel#channel-object-video-quality-modes
159157
*/
160158
video_quality_mode?: VideoQualityMode;
161159
}
162160

161+
export type APIGuildVoiceChannel = APIVoiceChannelBase<ChannelType.GuildVoice>;
162+
163163
export type APIGuildStageVoiceChannel = APIVoiceChannelBase<ChannelType.GuildStageVoice>;
164164

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

payloads/v9/channel.ts

+10-10
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,8 @@ export type TextChannelType =
4949
| ChannelType.AnnouncementThread
5050
| ChannelType.GuildText
5151
| ChannelType.GuildForum
52-
| ChannelType.GuildVoice;
52+
| ChannelType.GuildVoice
53+
| ChannelType.GuildStageVoice;
5354

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

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

135-
export interface APIVoiceChannelBase<T extends ChannelType> extends APIGuildChannel<T> {
136+
export interface APIVoiceChannelBase<T extends ChannelType>
137+
extends APIGuildChannel<T>,
138+
Omit<APITextBasedChannel<T>, 'name' | 'last_pin_timestamp'> {
136139
/**
137-
* The bitrate (in bits) of the voice channel
140+
* The bitrate (in bits) of the voice or stage channel
138141
*/
139142
bitrate?: number;
140143
/**
141-
* The user limit of the voice channel
144+
* The user limit of the voice or stage channel
142145
*/
143146
user_limit?: number;
144147
/**
@@ -147,19 +150,16 @@ export interface APIVoiceChannelBase<T extends ChannelType> extends APIGuildChan
147150
* See https://discord.com/developers/docs/resources/voice#voice-region-object
148151
*/
149152
rtc_region?: string | null;
150-
}
151-
152-
export interface APIGuildVoiceChannel
153-
extends APIVoiceChannelBase<ChannelType.GuildVoice>,
154-
Omit<APITextBasedChannel<ChannelType.GuildVoice>, 'name' | 'last_pin_timestamp'> {
155153
/**
156-
* The camera video quality mode of the voice channel, `1` when not present
154+
* The camera video quality mode of the voice or stage channel, `1` when not present
157155
*
158156
* See https://discord.com/developers/docs/resources/channel#channel-object-video-quality-modes
159157
*/
160158
video_quality_mode?: VideoQualityMode;
161159
}
162160

161+
export type APIGuildVoiceChannel = APIVoiceChannelBase<ChannelType.GuildVoice>;
162+
163163
export type APIGuildStageVoiceChannel = APIVoiceChannelBase<ChannelType.GuildStageVoice>;
164164

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

0 commit comments

Comments
 (0)