feat: stage channels! (#107)

This commit is contained in:
Vlad Frangu
2021-04-08 14:14:31 +03:00
committed by GitHub
parent d8d7bccea6
commit 6cd75426c6
11 changed files with 95 additions and 3 deletions

View File

@@ -114,7 +114,7 @@ export enum ChannelType {
/**
* A text channel within a guild
*/
GUILD_TEXT = 0,
GUILD_TEXT,
/**
* A direct message between users
*/
@@ -145,6 +145,12 @@ export enum ChannelType {
* See https://discord.com/developers/docs/game-and-server-management/special-channels
*/
GUILD_STORE,
/**
* A voice channel for hosting events with an audience
*
* See https://support.discord.com/hc/en-us/articles/1500005513722
*/
GUILD_STAGE_VOICE = 13,
}
export enum VideoQualityMode {

View File

@@ -44,6 +44,7 @@ export const PermissionFlagsBits = {
MANAGE_WEBHOOKS: 1n << 29n,
MANAGE_EMOJIS: 1n << 30n,
USE_APPLICATION_COMMANDS: 1n << 31n,
REQUEST_TO_SPEAK: 1n << 32n,
} as const;
/**

View File

@@ -59,6 +59,10 @@ export interface GatewayVoiceState {
* Whether this user is muted by the current user
*/
suppress: boolean;
/**
* The time at which the user requested to speak
*/
request_to_speak_timestamp: string | null;
}
/**

View File

@@ -770,3 +770,29 @@ export interface RESTPatchAPIGuildMemberVerificationJSONBody {
}
export type RESTPatchAPIGuildMemberVerificationResult = APIGuildMembershipScreening;
export interface RESTPatchAPIGuildVoiceStateCurrentMemberJSONBody {
/**
* The id of the channel the user is currently in
*/
channel_id: Snowflake;
/**
* Toggles the user's suppress state
*/
suppress?: boolean;
/**
* Sets the user's request to speak
*/
request_to_speak_timestamp?: string | null;
}
export interface RESTPatchAPIGuildVoiceStateUserJSONBody {
/**
* The id of the channel the user is currently in
*/
channel_id: Snowflake;
/**
* Toggles the user's suppress state
*/
suppress?: boolean;
}

View File

@@ -626,6 +626,15 @@ export const Routes = {
guildMemberVerification(guildID: Snowflake) {
return `/guilds/${guildID}/member-verification` as const;
},
/**
* Route for:
* - PATCH `/guilds/{guild.id}/voice-states/@me`
* - PATCH `/guilds/{guild.id}/voice-states/{user.id}`
*/
guildVoiceState(guildID: Snowflake, userID: Snowflake | '@me' = '@me') {
return `/guilds/${guildID}/voice-states/${userID}` as const;
},
};
export const RouteBases = {

View File

@@ -90,7 +90,7 @@
}
},
"lint-staged": {
"*.{mjs,js,ts}": "eslint --fix --ext mjs,js,ts"
"{v*,default,common}/**/*.{mjs,js,ts}": "eslint --fix --ext mjs,js,ts"
},
"commitlint": {
"extends": [

View File

@@ -114,7 +114,7 @@ export const enum ChannelType {
/**
* A text channel within a guild
*/
GUILD_TEXT = 0,
GUILD_TEXT,
/**
* A direct message between users
*/
@@ -145,6 +145,12 @@ export const enum ChannelType {
* See https://discord.com/developers/docs/game-and-server-management/special-channels
*/
GUILD_STORE,
/**
* A voice channel for hosting events with an audience
*
* See https://support.discord.com/hc/en-us/articles/1500005513722
*/
GUILD_STAGE_VOICE = 13,
}
export const enum VideoQualityMode {

View File

@@ -44,6 +44,7 @@ export const PermissionFlagsBits = {
MANAGE_WEBHOOKS: 1n << 29n,
MANAGE_EMOJIS: 1n << 30n,
USE_APPLICATION_COMMANDS: 1n << 31n,
REQUEST_TO_SPEAK: 1n << 32n,
} as const;
/**

View File

@@ -59,6 +59,10 @@ export interface GatewayVoiceState {
* Whether this user is muted by the current user
*/
suppress: boolean;
/**
* The time at which the user requested to speak
*/
request_to_speak_timestamp: string | null;
}
/**

View File

@@ -770,3 +770,29 @@ export interface RESTPatchAPIGuildMemberVerificationJSONBody {
}
export type RESTPatchAPIGuildMemberVerificationResult = APIGuildMembershipScreening;
export interface RESTPatchAPIGuildVoiceStateCurrentMemberJSONBody {
/**
* The id of the channel the user is currently in
*/
channel_id: Snowflake;
/**
* Toggles the user's suppress state
*/
suppress?: boolean;
/**
* Sets the user's request to speak
*/
request_to_speak_timestamp?: string | null;
}
export interface RESTPatchAPIGuildVoiceStateUserJSONBody {
/**
* The id of the channel the user is currently in
*/
channel_id: Snowflake;
/**
* Toggles the user's suppress state
*/
suppress?: boolean;
}

View File

@@ -626,6 +626,15 @@ export const Routes = {
guildMemberVerification(guildID: Snowflake) {
return `/guilds/${guildID}/member-verification` as const;
},
/**
* Route for:
* - PATCH `/guilds/{guild.id}/voice-states/@me`
* - PATCH `/guilds/{guild.id}/voice-states/{user.id}`
*/
guildVoiceState(guildID: Snowflake, userID: Snowflake | '@me' = '@me') {
return `/guilds/${guildID}/voice-states/${userID}` as const;
},
};
export const RouteBases = {