Skip to content

Commit

Permalink
feat(GatewayDispatchEvents): add VoiceChannelStatusUpdate
Browse files Browse the repository at this point in the history
feat(GatewayDispatchEvents): add `VoiceChannelStatusUpdate`
  • Loading branch information
sdanialraza committed Mar 22, 2024
1 parent 19327a5 commit 2d980fa
Show file tree
Hide file tree
Showing 14 changed files with 184 additions and 0 deletions.
27 changes: 27 additions & 0 deletions deno/gateway/v10.ts
Original file line number Diff line number Diff line change
Expand Up @@ -270,6 +270,7 @@ export enum GatewayDispatchEvents {
AutoModerationRuleDelete = 'AUTO_MODERATION_RULE_DELETE',
AutoModerationActionExecution = 'AUTO_MODERATION_ACTION_EXECUTION',
GuildAuditLogEntryCreate = 'GUILD_AUDIT_LOG_ENTRY_CREATE',
VoiceChannelStatusUpdate = 'VOICE_CHANNEL_STATUS_UPDATE',
EntitlementCreate = 'ENTITLEMENT_CREATE',
EntitlementUpdate = 'ENTITLEMENT_UPDATE',
EntitlementDelete = 'ENTITLEMENT_DELETE',
Expand Down Expand Up @@ -1813,6 +1814,32 @@ export interface GatewayGuildAuditLogEntryCreateDispatchData extends APIAuditLog
guild_id: Snowflake;
}

/**
* https://discord.com/developers/docs/topics/gateway-events#voice-channel-status-update
*/
export type GatewayVoiceChannelStatusUpdateDispatch = DataPayload<
GatewayDispatchEvents.VoiceChannelStatusUpdate,
GatewayVoiceChannelStatusUpdateDispatchDate
>;

/**
* https://discord.com/developers/docs/topics/gateway-events#voice-channel-status-update
*/
export interface GatewayVoiceChannelStatusUpdateDispatchDate {
/**
* The id of the channel
*/
id: Snowflake;
/**
* The id of the guild
*/
guild_id: Snowflake;
/**
* The new voice channel status
*/
status: string | null;
}

// #endregion Dispatch Payloads

// #region Sendable Payloads
Expand Down
27 changes: 27 additions & 0 deletions deno/gateway/v9.ts
Original file line number Diff line number Diff line change
Expand Up @@ -269,6 +269,7 @@ export enum GatewayDispatchEvents {
AutoModerationRuleDelete = 'AUTO_MODERATION_RULE_DELETE',
AutoModerationActionExecution = 'AUTO_MODERATION_ACTION_EXECUTION',
GuildAuditLogEntryCreate = 'GUILD_AUDIT_LOG_ENTRY_CREATE',
VoiceChannelStatusUpdate = 'VOICE_CHANNEL_STATUS_UPDATE',
EntitlementCreate = 'ENTITLEMENT_CREATE',
EntitlementUpdate = 'ENTITLEMENT_UPDATE',
EntitlementDelete = 'ENTITLEMENT_DELETE',
Expand Down Expand Up @@ -1812,6 +1813,32 @@ export interface GatewayGuildAuditLogEntryCreateDispatchData extends APIAuditLog
guild_id: Snowflake;
}

/**
* https://discord.com/developers/docs/topics/gateway-events#voice-channel-status-update
*/
export type GatewayVoiceChannelStatusUpdateDispatch = DataPayload<
GatewayDispatchEvents.VoiceChannelStatusUpdate,
GatewayVoiceChannelStatusUpdateDispatchDate
>;

/**
* https://discord.com/developers/docs/topics/gateway-events#voice-channel-status-update
*/
export interface GatewayVoiceChannelStatusUpdateDispatchDate {
/**
* The id of the channel
*/
id: Snowflake;
/**
* The id of the guild
*/
guild_id: Snowflake;
/**
* The new voice channel status
*/
status: string | null;
}

// #endregion Dispatch Payloads

// #region Sendable Payloads
Expand Down
6 changes: 6 additions & 0 deletions deno/payloads/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -276,6 +276,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,
} as const;

/**
Expand Down
12 changes: 12 additions & 0 deletions deno/payloads/v10/auditLog.ts
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,9 @@ export enum AuditLogEvent {

CreatorMonetizationRequestCreated = 150,
CreatorMonetizationTermsAccepted,

VoiceChannelStatusUpdate = 192,
VoiceChannelStatusDelete,
}

/**
Expand Down Expand Up @@ -257,6 +260,8 @@ export interface APIAuditLogOptions {
* - AUTO_MODERATION_BLOCK_MESSAGE
* - AUTO_MODERATION_FLAG_TO_CHANNEL
* - AUTO_MODERATION_USER_COMMUNICATION_DISABLED
* - VOICE_CHANNEL_STATUS_UPDATE
* - VOICE_CHANNEL_STATUS_DELETE
*/
channel_id?: Snowflake;

Expand Down Expand Up @@ -322,6 +327,13 @@ export interface APIAuditLogOptions {
* - MEMBER_ROLE_UPDATE
*/
integration_type?: APIGuildIntegrationType;
/**
* The new voice channel status
*
* Present from:
* - VOICE_CHANNEL_STATUS_UPDATE
*/
status?: string;
}

export enum AuditLogOptionsType {
Expand Down
4 changes: 4 additions & 0 deletions deno/payloads/v10/channel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,10 @@ export interface APIGuildTextChannel<T extends ChannelType.GuildForum | ChannelT
* The channel topic (0-1024 characters)
*/
topic?: string | null;
/**
* The voice channel status (0-500 characters)
*/
status?: string | null;
}

export type APITextChannel = APIGuildTextChannel<ChannelType.GuildText>;
Expand Down
12 changes: 12 additions & 0 deletions deno/payloads/v9/auditLog.ts
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,9 @@ export enum AuditLogEvent {

CreatorMonetizationRequestCreated = 150,
CreatorMonetizationTermsAccepted,

VoiceChannelStatusUpdate = 192,
VoiceChannelStatusDelete,
}

/**
Expand Down Expand Up @@ -257,6 +260,8 @@ export interface APIAuditLogOptions {
* - AUTO_MODERATION_BLOCK_MESSAGE
* - AUTO_MODERATION_FLAG_TO_CHANNEL
* - AUTO_MODERATION_USER_COMMUNICATION_DISABLED
* - VOICE_CHANNEL_STATUS_UPDATE
* - VOICE_CHANNEL_STATUS_DELETE
*/
channel_id?: Snowflake;

Expand Down Expand Up @@ -322,6 +327,13 @@ export interface APIAuditLogOptions {
* - MEMBER_ROLE_UPDATE
*/
integration_type?: APIGuildIntegrationType;
/**
* The new voice channel status
*
* Present from:
* - VOICE_CHANNEL_STATUS_UPDATE
*/
status?: string;
}

export enum AuditLogOptionsType {
Expand Down
4 changes: 4 additions & 0 deletions deno/payloads/v9/channel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,10 @@ export interface APIGuildTextChannel<T extends ChannelType.GuildForum | ChannelT
* The channel topic (0-1024 characters)
*/
topic?: string | null;
/**
* The voice channel status (0-500 characters)
*/
status?: string | null;
}

export type APITextChannel = APIGuildTextChannel<ChannelType.GuildText>;
Expand Down
27 changes: 27 additions & 0 deletions gateway/v10.ts
Original file line number Diff line number Diff line change
Expand Up @@ -270,6 +270,7 @@ export enum GatewayDispatchEvents {
AutoModerationRuleDelete = 'AUTO_MODERATION_RULE_DELETE',
AutoModerationActionExecution = 'AUTO_MODERATION_ACTION_EXECUTION',
GuildAuditLogEntryCreate = 'GUILD_AUDIT_LOG_ENTRY_CREATE',
VoiceChannelStatusUpdate = 'VOICE_CHANNEL_STATUS_UPDATE',
EntitlementCreate = 'ENTITLEMENT_CREATE',
EntitlementUpdate = 'ENTITLEMENT_UPDATE',
EntitlementDelete = 'ENTITLEMENT_DELETE',
Expand Down Expand Up @@ -1813,6 +1814,32 @@ export interface GatewayGuildAuditLogEntryCreateDispatchData extends APIAuditLog
guild_id: Snowflake;
}

/**
* https://discord.com/developers/docs/topics/gateway-events#voice-channel-status-update
*/
export type GatewayVoiceChannelStatusUpdateDispatch = DataPayload<
GatewayDispatchEvents.VoiceChannelStatusUpdate,
GatewayVoiceChannelStatusUpdateDispatchDate
>;

/**
* https://discord.com/developers/docs/topics/gateway-events#voice-channel-status-update
*/
export interface GatewayVoiceChannelStatusUpdateDispatchDate {
/**
* The id of the channel
*/
id: Snowflake;
/**
* The id of the guild
*/
guild_id: Snowflake;
/**
* The new voice channel status
*/
status: string | null;
}

// #endregion Dispatch Payloads

// #region Sendable Payloads
Expand Down
27 changes: 27 additions & 0 deletions gateway/v9.ts
Original file line number Diff line number Diff line change
Expand Up @@ -269,6 +269,7 @@ export enum GatewayDispatchEvents {
AutoModerationRuleDelete = 'AUTO_MODERATION_RULE_DELETE',
AutoModerationActionExecution = 'AUTO_MODERATION_ACTION_EXECUTION',
GuildAuditLogEntryCreate = 'GUILD_AUDIT_LOG_ENTRY_CREATE',
VoiceChannelStatusUpdate = 'VOICE_CHANNEL_STATUS_UPDATE',
EntitlementCreate = 'ENTITLEMENT_CREATE',
EntitlementUpdate = 'ENTITLEMENT_UPDATE',
EntitlementDelete = 'ENTITLEMENT_DELETE',
Expand Down Expand Up @@ -1812,6 +1813,32 @@ export interface GatewayGuildAuditLogEntryCreateDispatchData extends APIAuditLog
guild_id: Snowflake;
}

/**
* https://discord.com/developers/docs/topics/gateway-events#voice-channel-status-update
*/
export type GatewayVoiceChannelStatusUpdateDispatch = DataPayload<
GatewayDispatchEvents.VoiceChannelStatusUpdate,
GatewayVoiceChannelStatusUpdateDispatchDate
>;

/**
* https://discord.com/developers/docs/topics/gateway-events#voice-channel-status-update
*/
export interface GatewayVoiceChannelStatusUpdateDispatchDate {
/**
* The id of the channel
*/
id: Snowflake;
/**
* The id of the guild
*/
guild_id: Snowflake;
/**
* The new voice channel status
*/
status: string | null;
}

// #endregion Dispatch Payloads

// #region Sendable Payloads
Expand Down
6 changes: 6 additions & 0 deletions payloads/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -276,6 +276,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,
} as const;

/**
Expand Down
12 changes: 12 additions & 0 deletions payloads/v10/auditLog.ts
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,9 @@ export enum AuditLogEvent {

CreatorMonetizationRequestCreated = 150,
CreatorMonetizationTermsAccepted,

VoiceChannelStatusUpdate = 192,
VoiceChannelStatusDelete,
}

/**
Expand Down Expand Up @@ -257,6 +260,8 @@ export interface APIAuditLogOptions {
* - AUTO_MODERATION_BLOCK_MESSAGE
* - AUTO_MODERATION_FLAG_TO_CHANNEL
* - AUTO_MODERATION_USER_COMMUNICATION_DISABLED
* - VOICE_CHANNEL_STATUS_UPDATE
* - VOICE_CHANNEL_STATUS_DELETE
*/
channel_id?: Snowflake;

Expand Down Expand Up @@ -322,6 +327,13 @@ export interface APIAuditLogOptions {
* - MEMBER_ROLE_UPDATE
*/
integration_type?: APIGuildIntegrationType;
/**
* The new voice channel status
*
* Present from:
* - VOICE_CHANNEL_STATUS_UPDATE
*/
status?: string;
}

export enum AuditLogOptionsType {
Expand Down
4 changes: 4 additions & 0 deletions payloads/v10/channel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,10 @@ export interface APIGuildTextChannel<T extends ChannelType.GuildForum | ChannelT
* The channel topic (0-1024 characters)
*/
topic?: string | null;
/**
* The voice channel status (0-500 characters)
*/
status?: string | null;
}

export type APITextChannel = APIGuildTextChannel<ChannelType.GuildText>;
Expand Down
12 changes: 12 additions & 0 deletions payloads/v9/auditLog.ts
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,9 @@ export enum AuditLogEvent {

CreatorMonetizationRequestCreated = 150,
CreatorMonetizationTermsAccepted,

VoiceChannelStatusUpdate = 192,
VoiceChannelStatusDelete,
}

/**
Expand Down Expand Up @@ -257,6 +260,8 @@ export interface APIAuditLogOptions {
* - AUTO_MODERATION_BLOCK_MESSAGE
* - AUTO_MODERATION_FLAG_TO_CHANNEL
* - AUTO_MODERATION_USER_COMMUNICATION_DISABLED
* - VOICE_CHANNEL_STATUS_UPDATE
* - VOICE_CHANNEL_STATUS_DELETE
*/
channel_id?: Snowflake;

Expand Down Expand Up @@ -322,6 +327,13 @@ export interface APIAuditLogOptions {
* - MEMBER_ROLE_UPDATE
*/
integration_type?: APIGuildIntegrationType;
/**
* The new voice channel status
*
* Present from:
* - VOICE_CHANNEL_STATUS_UPDATE
*/
status?: string;
}

export enum AuditLogOptionsType {
Expand Down
4 changes: 4 additions & 0 deletions payloads/v9/channel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,10 @@ export interface APIGuildTextChannel<T extends ChannelType.GuildForum | ChannelT
* The channel topic (0-1024 characters)
*/
topic?: string | null;
/**
* The voice channel status (0-500 characters)
*/
status?: string | null;
}

export type APITextChannel = APIGuildTextChannel<ChannelType.GuildText>;
Expand Down

0 comments on commit 2d980fa

Please sign in to comment.