feat: voice channel status (#1631)

* feat: voice channel status

* chore: update docs links

---------

Co-authored-by: Jiralite <33201955+Jiralite@users.noreply.github.com>
Co-authored-by: Almeida <almeidx@pm.me>
This commit is contained in:
Kshitij Anurag
2026-06-16 11:55:06 +01:00
committed by GitHub
co-authored by Jiralite Almeida
parent c79d369c4d
commit 7d3339b894
18 changed files with 668 additions and 0 deletions
+130
View File
@@ -109,6 +109,10 @@ export enum GatewayOpcodes {
* Request information about soundboard sounds in a set of guilds
*/
RequestSoundboardSounds = 31,
/**
* Request ephemeral channel data for channels in a guild.
*/
RequestChannelInfo = 43,
}
/**
@@ -239,6 +243,7 @@ export enum GatewayDispatchEvents {
AutoModerationRuleUpdate = 'AUTO_MODERATION_RULE_UPDATE',
ChannelCreate = 'CHANNEL_CREATE',
ChannelDelete = 'CHANNEL_DELETE',
ChannelInfo = 'CHANNEL_INFO',
ChannelPinsUpdate = 'CHANNEL_PINS_UPDATE',
ChannelUpdate = 'CHANNEL_UPDATE',
EntitlementCreate = 'ENTITLEMENT_CREATE',
@@ -305,6 +310,8 @@ export enum GatewayDispatchEvents {
TypingStart = 'TYPING_START',
UserUpdate = 'USER_UPDATE',
VoiceChannelEffectSend = 'VOICE_CHANNEL_EFFECT_SEND',
VoiceChannelStartTimeUpdate = 'VOICE_CHANNEL_START_TIME_UPDATE',
VoiceChannelStatusUpdate = 'VOICE_CHANNEL_STATUS_UPDATE',
VoiceServerUpdate = 'VOICE_SERVER_UPDATE',
VoiceStateUpdate = 'VOICE_STATE_UPDATE',
WebhooksUpdate = 'WEBHOOKS_UPDATE',
@@ -313,6 +320,7 @@ export enum GatewayDispatchEvents {
export type GatewaySendPayload =
| GatewayHeartbeat
| GatewayIdentify
| GatewayRequestChannelInfo
| GatewayRequestGuildMembers
| GatewayRequestSoundboardSounds
| GatewayResume
@@ -335,6 +343,7 @@ export type GatewayDispatchPayload =
| GatewayAutoModerationRuleUpdateDispatch
| GatewayChannelCreateDispatch
| GatewayChannelDeleteDispatch
| GatewayChannelInfoDispatch
| GatewayChannelPinsUpdateDispatch
| GatewayChannelUpdateDispatch
| GatewayEntitlementCreateDispatch
@@ -401,6 +410,8 @@ export type GatewayDispatchPayload =
| GatewayTypingStartDispatch
| GatewayUserUpdateDispatch
| GatewayVoiceChannelEffectSendDispatch
| GatewayVoiceChannelStartTimeUpdateDispatch
| GatewayVoiceChannelStatusUpdateDispatch
| GatewayVoiceServerUpdateDispatch
| GatewayVoiceStateUpdateDispatch
| GatewayWebhooksUpdateDispatch;
@@ -787,6 +798,46 @@ export type GatewayChannelDeleteDispatch = _DataPayload<
*/
export type GatewayChannelDeleteDispatchData = GatewayChannelModifyDispatchData;
/**
* @see {@link https://docs.discord.com/developers/events/gateway-events#channel-info}
*/
export type GatewayChannelInfoDispatch = _DataPayload<
GatewayDispatchEvents.ChannelInfo,
GatewayChannelInfoDispatchData
>;
/**
* @see {@link https://docs.discord.com/developers/events/gateway-events#channel-info}
*/
export interface GatewayChannelInfoDispatchData {
/**
* The guild id
*/
guild_id: Snowflake;
/**
* Ephemeral data for channels in the guild
*/
channels: GatewayChannelInfoChannel[];
}
/**
* @see {@link https://docs.discord.com/developers/events/gateway-events#channel-info-channel-info-channel-structure}
*/
export interface GatewayChannelInfoChannel {
/**
* The channel id
*/
id: Snowflake;
/**
* The voice channel status
*/
status?: string | null;
/**
* Unix timestamp (in seconds) of when the voice session started
*/
voice_start_time?: number | null;
}
/**
* @see {@link https://discord.com/developers/docs/topics/gateway-events#channel-pins-update}
*/
@@ -2162,6 +2213,58 @@ export enum VoiceChannelEffectSendAnimationType {
Basic,
}
/**
* @see {@link https://docs.discord.com/developers/events/gateway-events#voice-channel-status-update}
*/
export type GatewayVoiceChannelStatusUpdateDispatch = _DataPayload<
GatewayDispatchEvents.VoiceChannelStatusUpdate,
GatewayVoiceChannelStatusUpdateDispatchData
>;
/**
* @see {@link https://docs.discord.com/developers/events/gateway-events#voice-channel-status-update}
*/
export interface GatewayVoiceChannelStatusUpdateDispatchData {
/**
* The channel id
*/
id: Snowflake;
/**
* The guild id
*/
guild_id: Snowflake;
/**
* The new voice channel status
*/
status: string | null;
}
/**
* @see {@link https://docs.discord.com/developers/events/gateway-events#voice-channel-start-time-update}
*/
export type GatewayVoiceChannelStartTimeUpdateDispatch = _DataPayload<
GatewayDispatchEvents.VoiceChannelStartTimeUpdate,
GatewayVoiceChannelStartTimeUpdateDispatchData
>;
/**
* @see {@link https://docs.discord.com/developers/events/gateway-events#voice-channel-start-time-update}
*/
export interface GatewayVoiceChannelStartTimeUpdateDispatchData {
/**
* The channel id
*/
id: Snowflake;
/**
* The guild id
*/
guild_id: Snowflake;
/**
* Unix timestamp (in seconds) of when the voice session started
*/
voice_start_time?: number | null;
}
/**
* @see {@link https://discord.com/developers/docs/topics/gateway-events#voice-state-update}
*/
@@ -2551,6 +2654,33 @@ export interface GatewayRequestSoundboardSoundsData {
guild_ids: Snowflake[];
}
/**
* @see {@link https://docs.discord.com/developers/events/gateway-events#request-channel-info}
*/
export interface GatewayRequestChannelInfo {
op: GatewayOpcodes.RequestChannelInfo;
d: GatewayRequestChannelInfoData;
}
export enum GatewayRequestChannelInfoField {
Status = 'status',
VoiceStartTime = 'voice_start_time',
}
/**
* @see {@link https://docs.discord.com/developers/events/gateway-events#request-channel-info}
*/
export interface GatewayRequestChannelInfoData {
/**
* The guild id to request channel info for
*/
guild_id: Snowflake;
/**
* The fields to request. The current available fields are `status` and `voice_start_time`
*/
fields: (GatewayRequestChannelInfoField | (string & {}))[];
}
/**
* @see {@link https://discord.com/developers/docs/topics/gateway-events#update-voice-state}
*/
+130
View File
@@ -109,6 +109,10 @@ export enum GatewayOpcodes {
* Request information about soundboard sounds in a set of guilds
*/
RequestSoundboardSounds = 31,
/**
* Request ephemeral channel data for channels in a guild.
*/
RequestChannelInfo = 43,
}
/**
@@ -238,6 +242,7 @@ export enum GatewayDispatchEvents {
AutoModerationRuleUpdate = 'AUTO_MODERATION_RULE_UPDATE',
ChannelCreate = 'CHANNEL_CREATE',
ChannelDelete = 'CHANNEL_DELETE',
ChannelInfo = 'CHANNEL_INFO',
ChannelPinsUpdate = 'CHANNEL_PINS_UPDATE',
ChannelUpdate = 'CHANNEL_UPDATE',
EntitlementCreate = 'ENTITLEMENT_CREATE',
@@ -304,6 +309,8 @@ export enum GatewayDispatchEvents {
TypingStart = 'TYPING_START',
UserUpdate = 'USER_UPDATE',
VoiceChannelEffectSend = 'VOICE_CHANNEL_EFFECT_SEND',
VoiceChannelStartTimeUpdate = 'VOICE_CHANNEL_START_TIME_UPDATE',
VoiceChannelStatusUpdate = 'VOICE_CHANNEL_STATUS_UPDATE',
VoiceServerUpdate = 'VOICE_SERVER_UPDATE',
VoiceStateUpdate = 'VOICE_STATE_UPDATE',
WebhooksUpdate = 'WEBHOOKS_UPDATE',
@@ -312,6 +319,7 @@ export enum GatewayDispatchEvents {
export type GatewaySendPayload =
| GatewayHeartbeat
| GatewayIdentify
| GatewayRequestChannelInfo
| GatewayRequestGuildMembers
| GatewayRequestSoundboardSounds
| GatewayResume
@@ -334,6 +342,7 @@ export type GatewayDispatchPayload =
| GatewayAutoModerationRuleUpdateDispatch
| GatewayChannelCreateDispatch
| GatewayChannelDeleteDispatch
| GatewayChannelInfoDispatch
| GatewayChannelPinsUpdateDispatch
| GatewayChannelUpdateDispatch
| GatewayEntitlementCreateDispatch
@@ -400,6 +409,8 @@ export type GatewayDispatchPayload =
| GatewayTypingStartDispatch
| GatewayUserUpdateDispatch
| GatewayVoiceChannelEffectSendDispatch
| GatewayVoiceChannelStartTimeUpdateDispatch
| GatewayVoiceChannelStatusUpdateDispatch
| GatewayVoiceServerUpdateDispatch
| GatewayVoiceStateUpdateDispatch
| GatewayWebhooksUpdateDispatch;
@@ -786,6 +797,46 @@ export type GatewayChannelDeleteDispatch = _DataPayload<
*/
export type GatewayChannelDeleteDispatchData = GatewayChannelModifyDispatchData;
/**
* @see {@link https://docs.discord.com/developers/events/gateway-events#channel-info}
*/
export type GatewayChannelInfoDispatch = _DataPayload<
GatewayDispatchEvents.ChannelInfo,
GatewayChannelInfoDispatchData
>;
/**
* @see {@link https://docs.discord.com/developers/events/gateway-events#channel-info}
*/
export interface GatewayChannelInfoDispatchData {
/**
* The guild id
*/
guild_id: Snowflake;
/**
* Ephemeral data for channels in the guild
*/
channels: GatewayChannelInfoChannel[];
}
/**
* @see {@link https://docs.discord.com/developers/events/gateway-events#channel-info-channel-info-channel-structure}
*/
export interface GatewayChannelInfoChannel {
/**
* The channel id
*/
id: Snowflake;
/**
* The voice channel status
*/
status?: string | null;
/**
* Unix timestamp (in seconds) of when the voice session started
*/
voice_start_time?: number | null;
}
/**
* @see {@link https://discord.com/developers/docs/topics/gateway-events#channel-pins-update}
*/
@@ -2161,6 +2212,58 @@ export enum VoiceChannelEffectSendAnimationType {
Basic,
}
/**
* @see {@link https://docs.discord.com/developers/events/gateway-events#voice-channel-status-update}
*/
export type GatewayVoiceChannelStatusUpdateDispatch = _DataPayload<
GatewayDispatchEvents.VoiceChannelStatusUpdate,
GatewayVoiceChannelStatusUpdateDispatchData
>;
/**
* @see {@link https://docs.discord.com/developers/events/gateway-events#voice-channel-status-update}
*/
export interface GatewayVoiceChannelStatusUpdateDispatchData {
/**
* The channel id
*/
id: Snowflake;
/**
* The guild id
*/
guild_id: Snowflake;
/**
* The new voice channel status
*/
status: string | null;
}
/**
* @see {@link https://docs.discord.com/developers/events/gateway-events#voice-channel-start-time-update}
*/
export type GatewayVoiceChannelStartTimeUpdateDispatch = _DataPayload<
GatewayDispatchEvents.VoiceChannelStartTimeUpdate,
GatewayVoiceChannelStartTimeUpdateDispatchData
>;
/**
* @see {@link https://docs.discord.com/developers/events/gateway-events#voice-channel-start-time-update}
*/
export interface GatewayVoiceChannelStartTimeUpdateDispatchData {
/**
* The channel id
*/
id: Snowflake;
/**
* The guild id
*/
guild_id: Snowflake;
/**
* Unix timestamp (in seconds) of when the voice session started
*/
voice_start_time?: number | null;
}
/**
* @see {@link https://discord.com/developers/docs/topics/gateway-events#voice-state-update}
*/
@@ -2550,6 +2653,33 @@ export interface GatewayRequestSoundboardSoundsData {
guild_ids: Snowflake[];
}
/**
* @see {@link https://docs.discord.com/developers/events/gateway-events#request-channel-info}
*/
export interface GatewayRequestChannelInfo {
op: GatewayOpcodes.RequestChannelInfo;
d: GatewayRequestChannelInfoData;
}
export enum GatewayRequestChannelInfoField {
Status = 'status',
VoiceStartTime = 'voice_start_time',
}
/**
* @see {@link https://docs.discord.com/developers/events/gateway-events#request-channel-info}
*/
export interface GatewayRequestChannelInfoData {
/**
* The guild id to request channel info for
*/
guild_id: Snowflake;
/**
* The fields to request. The current available fields are `status` and `voice_start_time`
*/
fields: (GatewayRequestChannelInfoField | (string & {}))[];
}
/**
* @see {@link https://discord.com/developers/docs/topics/gateway-events#update-voice-state}
*/
+6
View File
@@ -275,6 +275,12 @@ export const PermissionFlagsBits = {
* Applies to channel types: Text, Voice, Stage
*/
SendVoiceMessages: 1n << 46n,
/**
* Allows setting voice channel status
*
* Applies to channel types: Voice
*/
SetVoiceChannelStatus: 1n << 48n,
/**
* Allows sending polls
*
+11
View File
@@ -226,6 +226,8 @@ export enum AuditLogEvent {
HomeSettingsCreate = 190,
HomeSettingsUpdate,
VoiceChannelStatusCreate,
VoiceChannelStatusDelete,
}
/**
@@ -282,6 +284,8 @@ export interface APIAuditLogOptions {
* - AUTO_MODERATION_FLAG_TO_CHANNEL
* - AUTO_MODERATION_USER_COMMUNICATION_DISABLED
* - AUTO_MODERATION_QUARANTINE_USER
* - VOICE_CHANNEL_STATUS_CREATE
* - VOICE_CHANNEL_STATUS_DELETE
*/
channel_id?: Snowflake;
@@ -354,6 +358,13 @@ export interface APIAuditLogOptions {
* - APPLICATION_COMMAND_PERMISSION_UPDATE
*/
application_id?: Snowflake;
/**
* The new voice channel status
*
* Present from:
* - VOICE_CHANNEL_STATUS_CREATE
*/
status?: string;
}
export enum AuditLogOptionsType {
+11
View File
@@ -226,6 +226,8 @@ export enum AuditLogEvent {
HomeSettingsCreate = 190,
HomeSettingsUpdate,
VoiceChannelStatusCreate,
VoiceChannelStatusDelete,
}
/**
@@ -282,6 +284,8 @@ export interface APIAuditLogOptions {
* - AUTO_MODERATION_FLAG_TO_CHANNEL
* - AUTO_MODERATION_USER_COMMUNICATION_DISABLED
* - AUTO_MODERATION_QUARANTINE_USER
* - VOICE_CHANNEL_STATUS_CREATE
* - VOICE_CHANNEL_STATUS_DELETE
*/
channel_id?: Snowflake;
@@ -354,6 +358,13 @@ export interface APIAuditLogOptions {
* - APPLICATION_COMMAND_PERMISSION_UPDATE
*/
application_id?: Snowflake;
/**
* The new voice channel status
*
* Present from:
* - VOICE_CHANNEL_STATUS_CREATE
*/
status?: string;
}
export enum AuditLogOptionsType {
+15
View File
@@ -897,3 +897,18 @@ export interface RESTGetAPIChannelUsersThreadsArchivedResult extends APIThreadLi
*/
has_more: boolean;
}
/**
* @see {@link https://docs.discord.com/developers/resources/channel#set-voice-channel-status}
*/
export interface RESTPutAPIChannelVoiceStatusJSONBody {
/**
* New voice channel status (up to 500 characters)
*/
status: string | null;
}
/**
* @see {@link https://docs.discord.com/developers/resources/channel#set-voice-channel-status}
*/
export type RESTPutAPIChannelVoiceStatusResult = undefined;
+8
View File
@@ -228,6 +228,14 @@ export const Routes = {
return `/channels/${channelId}/recipients/${userId}` as const;
},
/**
* Route for:
* - PUT `/channels/{channel.id}/voice-status`
*/
channelVoiceStatus(channelId: Snowflake) {
return `/channels/${channelId}/voice-status` as const;
},
/**
* Route for:
* - GET `/guilds/{guild.id}/emojis`
+15
View File
@@ -911,3 +911,18 @@ export type RESTGetAPIChannelThreadsResult = APIThreadList;
* @see {@link https://discord.com/developers/docs/resources/channel#list-joined-private-archived-threads}
*/
export type RESTGetAPIChannelUsersThreadsArchivedResult = APIThreadList;
/**
* @see {@link https://docs.discord.com/developers/resources/channel#set-voice-channel-status}
*/
export interface RESTPutAPIChannelVoiceStatusJSONBody {
/**
* New voice channel status (up to 500 characters)
*/
status: string | null;
}
/**
* @see {@link https://docs.discord.com/developers/resources/channel#set-voice-channel-status}
*/
export type RESTPutAPIChannelVoiceStatusResult = undefined;
+8
View File
@@ -228,6 +228,14 @@ export const Routes = {
return `/channels/${channelId}/recipients/${userId}` as const;
},
/**
* Route for:
* - PUT `/channels/{channel.id}/voice-status`
*/
channelVoiceStatus(channelId: Snowflake) {
return `/channels/${channelId}/voice-status` as const;
},
/**
* Route for:
* - GET `/guilds/{guild.id}/emojis`
+130
View File
@@ -109,6 +109,10 @@ export enum GatewayOpcodes {
* Request information about soundboard sounds in a set of guilds
*/
RequestSoundboardSounds = 31,
/**
* Request ephemeral channel data for channels in a guild.
*/
RequestChannelInfo = 43,
}
/**
@@ -239,6 +243,7 @@ export enum GatewayDispatchEvents {
AutoModerationRuleUpdate = 'AUTO_MODERATION_RULE_UPDATE',
ChannelCreate = 'CHANNEL_CREATE',
ChannelDelete = 'CHANNEL_DELETE',
ChannelInfo = 'CHANNEL_INFO',
ChannelPinsUpdate = 'CHANNEL_PINS_UPDATE',
ChannelUpdate = 'CHANNEL_UPDATE',
EntitlementCreate = 'ENTITLEMENT_CREATE',
@@ -305,6 +310,8 @@ export enum GatewayDispatchEvents {
TypingStart = 'TYPING_START',
UserUpdate = 'USER_UPDATE',
VoiceChannelEffectSend = 'VOICE_CHANNEL_EFFECT_SEND',
VoiceChannelStartTimeUpdate = 'VOICE_CHANNEL_START_TIME_UPDATE',
VoiceChannelStatusUpdate = 'VOICE_CHANNEL_STATUS_UPDATE',
VoiceServerUpdate = 'VOICE_SERVER_UPDATE',
VoiceStateUpdate = 'VOICE_STATE_UPDATE',
WebhooksUpdate = 'WEBHOOKS_UPDATE',
@@ -313,6 +320,7 @@ export enum GatewayDispatchEvents {
export type GatewaySendPayload =
| GatewayHeartbeat
| GatewayIdentify
| GatewayRequestChannelInfo
| GatewayRequestGuildMembers
| GatewayRequestSoundboardSounds
| GatewayResume
@@ -335,6 +343,7 @@ export type GatewayDispatchPayload =
| GatewayAutoModerationRuleUpdateDispatch
| GatewayChannelCreateDispatch
| GatewayChannelDeleteDispatch
| GatewayChannelInfoDispatch
| GatewayChannelPinsUpdateDispatch
| GatewayChannelUpdateDispatch
| GatewayEntitlementCreateDispatch
@@ -401,6 +410,8 @@ export type GatewayDispatchPayload =
| GatewayTypingStartDispatch
| GatewayUserUpdateDispatch
| GatewayVoiceChannelEffectSendDispatch
| GatewayVoiceChannelStartTimeUpdateDispatch
| GatewayVoiceChannelStatusUpdateDispatch
| GatewayVoiceServerUpdateDispatch
| GatewayVoiceStateUpdateDispatch
| GatewayWebhooksUpdateDispatch;
@@ -787,6 +798,46 @@ export type GatewayChannelDeleteDispatch = _DataPayload<
*/
export type GatewayChannelDeleteDispatchData = GatewayChannelModifyDispatchData;
/**
* @see {@link https://docs.discord.com/developers/events/gateway-events#channel-info}
*/
export type GatewayChannelInfoDispatch = _DataPayload<
GatewayDispatchEvents.ChannelInfo,
GatewayChannelInfoDispatchData
>;
/**
* @see {@link https://docs.discord.com/developers/events/gateway-events#channel-info}
*/
export interface GatewayChannelInfoDispatchData {
/**
* The guild id
*/
guild_id: Snowflake;
/**
* Ephemeral data for channels in the guild
*/
channels: GatewayChannelInfoChannel[];
}
/**
* @see {@link https://docs.discord.com/developers/events/gateway-events#channel-info-channel-info-channel-structure}
*/
export interface GatewayChannelInfoChannel {
/**
* The channel id
*/
id: Snowflake;
/**
* The voice channel status
*/
status?: string | null;
/**
* Unix timestamp (in seconds) of when the voice session started
*/
voice_start_time?: number | null;
}
/**
* @see {@link https://discord.com/developers/docs/topics/gateway-events#channel-pins-update}
*/
@@ -2162,6 +2213,58 @@ export enum VoiceChannelEffectSendAnimationType {
Basic,
}
/**
* @see {@link https://docs.discord.com/developers/events/gateway-events#voice-channel-status-update}
*/
export type GatewayVoiceChannelStatusUpdateDispatch = _DataPayload<
GatewayDispatchEvents.VoiceChannelStatusUpdate,
GatewayVoiceChannelStatusUpdateDispatchData
>;
/**
* @see {@link https://docs.discord.com/developers/events/gateway-events#voice-channel-status-update}
*/
export interface GatewayVoiceChannelStatusUpdateDispatchData {
/**
* The channel id
*/
id: Snowflake;
/**
* The guild id
*/
guild_id: Snowflake;
/**
* The new voice channel status
*/
status: string | null;
}
/**
* @see {@link https://docs.discord.com/developers/events/gateway-events#voice-channel-start-time-update}
*/
export type GatewayVoiceChannelStartTimeUpdateDispatch = _DataPayload<
GatewayDispatchEvents.VoiceChannelStartTimeUpdate,
GatewayVoiceChannelStartTimeUpdateDispatchData
>;
/**
* @see {@link https://docs.discord.com/developers/events/gateway-events#voice-channel-start-time-update}
*/
export interface GatewayVoiceChannelStartTimeUpdateDispatchData {
/**
* The channel id
*/
id: Snowflake;
/**
* The guild id
*/
guild_id: Snowflake;
/**
* Unix timestamp (in seconds) of when the voice session started
*/
voice_start_time?: number | null;
}
/**
* @see {@link https://discord.com/developers/docs/topics/gateway-events#voice-state-update}
*/
@@ -2551,6 +2654,33 @@ export interface GatewayRequestSoundboardSoundsData {
guild_ids: Snowflake[];
}
/**
* @see {@link https://docs.discord.com/developers/events/gateway-events#request-channel-info}
*/
export interface GatewayRequestChannelInfo {
op: GatewayOpcodes.RequestChannelInfo;
d: GatewayRequestChannelInfoData;
}
export enum GatewayRequestChannelInfoField {
Status = 'status',
VoiceStartTime = 'voice_start_time',
}
/**
* @see {@link https://docs.discord.com/developers/events/gateway-events#request-channel-info}
*/
export interface GatewayRequestChannelInfoData {
/**
* The guild id to request channel info for
*/
guild_id: Snowflake;
/**
* The fields to request. The current available fields are `status` and `voice_start_time`
*/
fields: (GatewayRequestChannelInfoField | (string & {}))[];
}
/**
* @see {@link https://discord.com/developers/docs/topics/gateway-events#update-voice-state}
*/
+130
View File
@@ -109,6 +109,10 @@ export enum GatewayOpcodes {
* Request information about soundboard sounds in a set of guilds
*/
RequestSoundboardSounds = 31,
/**
* Request ephemeral channel data for channels in a guild.
*/
RequestChannelInfo = 43,
}
/**
@@ -238,6 +242,7 @@ export enum GatewayDispatchEvents {
AutoModerationRuleUpdate = 'AUTO_MODERATION_RULE_UPDATE',
ChannelCreate = 'CHANNEL_CREATE',
ChannelDelete = 'CHANNEL_DELETE',
ChannelInfo = 'CHANNEL_INFO',
ChannelPinsUpdate = 'CHANNEL_PINS_UPDATE',
ChannelUpdate = 'CHANNEL_UPDATE',
EntitlementCreate = 'ENTITLEMENT_CREATE',
@@ -304,6 +309,8 @@ export enum GatewayDispatchEvents {
TypingStart = 'TYPING_START',
UserUpdate = 'USER_UPDATE',
VoiceChannelEffectSend = 'VOICE_CHANNEL_EFFECT_SEND',
VoiceChannelStartTimeUpdate = 'VOICE_CHANNEL_START_TIME_UPDATE',
VoiceChannelStatusUpdate = 'VOICE_CHANNEL_STATUS_UPDATE',
VoiceServerUpdate = 'VOICE_SERVER_UPDATE',
VoiceStateUpdate = 'VOICE_STATE_UPDATE',
WebhooksUpdate = 'WEBHOOKS_UPDATE',
@@ -312,6 +319,7 @@ export enum GatewayDispatchEvents {
export type GatewaySendPayload =
| GatewayHeartbeat
| GatewayIdentify
| GatewayRequestChannelInfo
| GatewayRequestGuildMembers
| GatewayRequestSoundboardSounds
| GatewayResume
@@ -334,6 +342,7 @@ export type GatewayDispatchPayload =
| GatewayAutoModerationRuleUpdateDispatch
| GatewayChannelCreateDispatch
| GatewayChannelDeleteDispatch
| GatewayChannelInfoDispatch
| GatewayChannelPinsUpdateDispatch
| GatewayChannelUpdateDispatch
| GatewayEntitlementCreateDispatch
@@ -400,6 +409,8 @@ export type GatewayDispatchPayload =
| GatewayTypingStartDispatch
| GatewayUserUpdateDispatch
| GatewayVoiceChannelEffectSendDispatch
| GatewayVoiceChannelStartTimeUpdateDispatch
| GatewayVoiceChannelStatusUpdateDispatch
| GatewayVoiceServerUpdateDispatch
| GatewayVoiceStateUpdateDispatch
| GatewayWebhooksUpdateDispatch;
@@ -786,6 +797,46 @@ export type GatewayChannelDeleteDispatch = _DataPayload<
*/
export type GatewayChannelDeleteDispatchData = GatewayChannelModifyDispatchData;
/**
* @see {@link https://docs.discord.com/developers/events/gateway-events#channel-info}
*/
export type GatewayChannelInfoDispatch = _DataPayload<
GatewayDispatchEvents.ChannelInfo,
GatewayChannelInfoDispatchData
>;
/**
* @see {@link https://docs.discord.com/developers/events/gateway-events#channel-info}
*/
export interface GatewayChannelInfoDispatchData {
/**
* The guild id
*/
guild_id: Snowflake;
/**
* Ephemeral data for channels in the guild
*/
channels: GatewayChannelInfoChannel[];
}
/**
* @see {@link https://docs.discord.com/developers/events/gateway-events#channel-info-channel-info-channel-structure}
*/
export interface GatewayChannelInfoChannel {
/**
* The channel id
*/
id: Snowflake;
/**
* The voice channel status
*/
status?: string | null;
/**
* Unix timestamp (in seconds) of when the voice session started
*/
voice_start_time?: number | null;
}
/**
* @see {@link https://discord.com/developers/docs/topics/gateway-events#channel-pins-update}
*/
@@ -2161,6 +2212,58 @@ export enum VoiceChannelEffectSendAnimationType {
Basic,
}
/**
* @see {@link https://docs.discord.com/developers/events/gateway-events#voice-channel-status-update}
*/
export type GatewayVoiceChannelStatusUpdateDispatch = _DataPayload<
GatewayDispatchEvents.VoiceChannelStatusUpdate,
GatewayVoiceChannelStatusUpdateDispatchData
>;
/**
* @see {@link https://docs.discord.com/developers/events/gateway-events#voice-channel-status-update}
*/
export interface GatewayVoiceChannelStatusUpdateDispatchData {
/**
* The channel id
*/
id: Snowflake;
/**
* The guild id
*/
guild_id: Snowflake;
/**
* The new voice channel status
*/
status: string | null;
}
/**
* @see {@link https://docs.discord.com/developers/events/gateway-events#voice-channel-start-time-update}
*/
export type GatewayVoiceChannelStartTimeUpdateDispatch = _DataPayload<
GatewayDispatchEvents.VoiceChannelStartTimeUpdate,
GatewayVoiceChannelStartTimeUpdateDispatchData
>;
/**
* @see {@link https://docs.discord.com/developers/events/gateway-events#voice-channel-start-time-update}
*/
export interface GatewayVoiceChannelStartTimeUpdateDispatchData {
/**
* The channel id
*/
id: Snowflake;
/**
* The guild id
*/
guild_id: Snowflake;
/**
* Unix timestamp (in seconds) of when the voice session started
*/
voice_start_time?: number | null;
}
/**
* @see {@link https://discord.com/developers/docs/topics/gateway-events#voice-state-update}
*/
@@ -2550,6 +2653,33 @@ export interface GatewayRequestSoundboardSoundsData {
guild_ids: Snowflake[];
}
/**
* @see {@link https://docs.discord.com/developers/events/gateway-events#request-channel-info}
*/
export interface GatewayRequestChannelInfo {
op: GatewayOpcodes.RequestChannelInfo;
d: GatewayRequestChannelInfoData;
}
export enum GatewayRequestChannelInfoField {
Status = 'status',
VoiceStartTime = 'voice_start_time',
}
/**
* @see {@link https://docs.discord.com/developers/events/gateway-events#request-channel-info}
*/
export interface GatewayRequestChannelInfoData {
/**
* The guild id to request channel info for
*/
guild_id: Snowflake;
/**
* The fields to request. The current available fields are `status` and `voice_start_time`
*/
fields: (GatewayRequestChannelInfoField | (string & {}))[];
}
/**
* @see {@link https://discord.com/developers/docs/topics/gateway-events#update-voice-state}
*/
+6
View File
@@ -275,6 +275,12 @@ export const PermissionFlagsBits = {
* Applies to channel types: Text, Voice, Stage
*/
SendVoiceMessages: 1n << 46n,
/**
* Allows setting voice channel status
*
* Applies to channel types: Voice
*/
SetVoiceChannelStatus: 1n << 48n,
/**
* Allows sending polls
*
+11
View File
@@ -226,6 +226,8 @@ export enum AuditLogEvent {
HomeSettingsCreate = 190,
HomeSettingsUpdate,
VoiceChannelStatusCreate,
VoiceChannelStatusDelete,
}
/**
@@ -282,6 +284,8 @@ export interface APIAuditLogOptions {
* - AUTO_MODERATION_FLAG_TO_CHANNEL
* - AUTO_MODERATION_USER_COMMUNICATION_DISABLED
* - AUTO_MODERATION_QUARANTINE_USER
* - VOICE_CHANNEL_STATUS_CREATE
* - VOICE_CHANNEL_STATUS_DELETE
*/
channel_id?: Snowflake;
@@ -354,6 +358,13 @@ export interface APIAuditLogOptions {
* - APPLICATION_COMMAND_PERMISSION_UPDATE
*/
application_id?: Snowflake;
/**
* The new voice channel status
*
* Present from:
* - VOICE_CHANNEL_STATUS_CREATE
*/
status?: string;
}
export enum AuditLogOptionsType {
+11
View File
@@ -226,6 +226,8 @@ export enum AuditLogEvent {
HomeSettingsCreate = 190,
HomeSettingsUpdate,
VoiceChannelStatusCreate,
VoiceChannelStatusDelete,
}
/**
@@ -282,6 +284,8 @@ export interface APIAuditLogOptions {
* - AUTO_MODERATION_FLAG_TO_CHANNEL
* - AUTO_MODERATION_USER_COMMUNICATION_DISABLED
* - AUTO_MODERATION_QUARANTINE_USER
* - VOICE_CHANNEL_STATUS_CREATE
* - VOICE_CHANNEL_STATUS_DELETE
*/
channel_id?: Snowflake;
@@ -354,6 +358,13 @@ export interface APIAuditLogOptions {
* - APPLICATION_COMMAND_PERMISSION_UPDATE
*/
application_id?: Snowflake;
/**
* The new voice channel status
*
* Present from:
* - VOICE_CHANNEL_STATUS_CREATE
*/
status?: string;
}
export enum AuditLogOptionsType {
+15
View File
@@ -897,3 +897,18 @@ export interface RESTGetAPIChannelUsersThreadsArchivedResult extends APIThreadLi
*/
has_more: boolean;
}
/**
* @see {@link https://docs.discord.com/developers/resources/channel#set-voice-channel-status}
*/
export interface RESTPutAPIChannelVoiceStatusJSONBody {
/**
* New voice channel status (up to 500 characters)
*/
status: string | null;
}
/**
* @see {@link https://docs.discord.com/developers/resources/channel#set-voice-channel-status}
*/
export type RESTPutAPIChannelVoiceStatusResult = undefined;
+8
View File
@@ -228,6 +228,14 @@ export const Routes = {
return `/channels/${channelId}/recipients/${userId}` as const;
},
/**
* Route for:
* - PUT `/channels/{channel.id}/voice-status`
*/
channelVoiceStatus(channelId: Snowflake) {
return `/channels/${channelId}/voice-status` as const;
},
/**
* Route for:
* - GET `/guilds/{guild.id}/emojis`
+15
View File
@@ -911,3 +911,18 @@ export type RESTGetAPIChannelThreadsResult = APIThreadList;
* @see {@link https://discord.com/developers/docs/resources/channel#list-joined-private-archived-threads}
*/
export type RESTGetAPIChannelUsersThreadsArchivedResult = APIThreadList;
/**
* @see {@link https://docs.discord.com/developers/resources/channel#set-voice-channel-status}
*/
export interface RESTPutAPIChannelVoiceStatusJSONBody {
/**
* New voice channel status (up to 500 characters)
*/
status: string | null;
}
/**
* @see {@link https://docs.discord.com/developers/resources/channel#set-voice-channel-status}
*/
export type RESTPutAPIChannelVoiceStatusResult = undefined;
+8
View File
@@ -228,6 +228,14 @@ export const Routes = {
return `/channels/${channelId}/recipients/${userId}` as const;
},
/**
* Route for:
* - PUT `/channels/{channel.id}/voice-status`
*/
channelVoiceStatus(channelId: Snowflake) {
return `/channels/${channelId}/voice-status` as const;
},
/**
* Route for:
* - GET `/guilds/{guild.id}/emojis`