feat: Obfuscation (#1718)

* feat: obfuscation

* docs: sync obfuscation documentation
This commit is contained in:
Jiralite
2026-08-28 12:53:15 +03:00
committed by GitHub
parent 7134baa6e9
commit e031a8d4de
8 changed files with 108 additions and 0 deletions
+21
View File
@@ -232,6 +232,20 @@ export enum GatewayIntentBits {
DirectMessagePolls = 1 << 25,
}
/**
* @see {@link https://docs.discord.com/developers/events/gateway-events#identify-gateway-capabilities}
*/
export enum GatewayCapabilityBits {
/**
* Opts the client into receiving {@link https://docs.discord.com/developers/resources/channel#channel-object-obfuscated-channels | obfuscated channel metadata} over the Gateway for channels it can't view
*
* @unstable `CHANNEL_OBFUSCATION` is a temporary, testing-only opt-in for channel obfuscation. This opt-in mechanism
* will change before the feature reaches general availability. Obfuscation is then planned to apply to all bots
* automatically, even when they don't provide this capability.
*/
ChannelObfuscation = 1 << 15,
}
/**
* @see {@link https://discord.com/developers/docs/topics/gateway-events#receive-events}
*/
@@ -2528,6 +2542,13 @@ export interface GatewayIdentifyData {
* @see {@link https://discord.com/developers/docs/topics/gateway#gateway-intents}
*/
intents: number;
/**
* Bitfield representing {@link https://docs.discord.com/developers/events/gateway-events#identify-gateway-capabilities | capabilities} of your gateway client
*
* @defaultValue `0`
* @see {@link https://docs.discord.com/developers/events/gateway-events#identify-gateway-capabilities}
*/
capabilities?: number;
}
/**
+21
View File
@@ -231,6 +231,20 @@ export enum GatewayIntentBits {
DirectMessagePolls = 1 << 25,
}
/**
* @see {@link https://docs.discord.com/developers/events/gateway-events#identify-gateway-capabilities}
*/
export enum GatewayCapabilityBits {
/**
* Opts the client into receiving {@link https://docs.discord.com/developers/resources/channel#channel-object-obfuscated-channels | obfuscated channel metadata} over the Gateway for channels it can't view
*
* @unstable `CHANNEL_OBFUSCATION` is a temporary, testing-only opt-in for channel obfuscation. This opt-in mechanism
* will change before the feature reaches general availability. Obfuscation is then planned to apply to all bots
* automatically, even when they don't provide this capability.
*/
ChannelObfuscation = 1 << 15,
}
/**
* @see {@link https://discord.com/developers/docs/topics/gateway-events#receive-events}
*/
@@ -2527,6 +2541,13 @@ export interface GatewayIdentifyData {
* @see {@link https://discord.com/developers/docs/topics/gateway#gateway-intents}
*/
intents: number;
/**
* Bitfield representing {@link https://docs.discord.com/developers/events/gateway-events#identify-gateway-capabilities | capabilities} of your gateway client
*
* @defaultValue `0`
* @see {@link https://docs.discord.com/developers/events/gateway-events#identify-gateway-capabilities}
*/
capabilities?: number;
}
/**
+6
View File
@@ -723,6 +723,12 @@ export enum ChannelFlags {
* Whether media download options are hidden.
*/
HideMediaDownloadOptions = 1 << 15,
/**
* This channel's metadata has been obfuscated because the current user cannot view it. Only ever set on channels
* received over the {@link https://docs.discord.com/developers/events/gateway | Gateway}; the HTTP API never sets this flag. See
* {@link https://docs.discord.com/developers/resources/channel#channel-object-obfuscated-channels | Obfuscated Channels}.
*/
ChannelObfuscated = 1 << 17,
/**
* This channel is a Spoiler Channel i.e. users must opt in to view its contents.
*/
+6
View File
@@ -725,6 +725,12 @@ export enum ChannelFlags {
* Whether media download options are hidden.
*/
HideMediaDownloadOptions = 1 << 15,
/**
* This channel's metadata has been obfuscated because the current user cannot view it. Only ever set on channels
* received over the {@link https://docs.discord.com/developers/events/gateway | Gateway}; the HTTP API never sets this flag. See
* {@link https://docs.discord.com/developers/resources/channel#channel-object-obfuscated-channels | Obfuscated Channels}.
*/
ChannelObfuscated = 1 << 17,
/**
* This channel is a Spoiler Channel i.e. users must opt in to view its contents.
*/
+21
View File
@@ -232,6 +232,20 @@ export enum GatewayIntentBits {
DirectMessagePolls = 1 << 25,
}
/**
* @see {@link https://docs.discord.com/developers/events/gateway-events#identify-gateway-capabilities}
*/
export enum GatewayCapabilityBits {
/**
* Opts the client into receiving {@link https://docs.discord.com/developers/resources/channel#channel-object-obfuscated-channels | obfuscated channel metadata} over the Gateway for channels it can't view
*
* @unstable `CHANNEL_OBFUSCATION` is a temporary, testing-only opt-in for channel obfuscation. This opt-in mechanism
* will change before the feature reaches general availability. Obfuscation is then planned to apply to all bots
* automatically, even when they don't provide this capability.
*/
ChannelObfuscation = 1 << 15,
}
/**
* @see {@link https://discord.com/developers/docs/topics/gateway-events#receive-events}
*/
@@ -2528,6 +2542,13 @@ export interface GatewayIdentifyData {
* @see {@link https://discord.com/developers/docs/topics/gateway#gateway-intents}
*/
intents: number;
/**
* Bitfield representing {@link https://docs.discord.com/developers/events/gateway-events#identify-gateway-capabilities | capabilities} of your gateway client
*
* @defaultValue `0`
* @see {@link https://docs.discord.com/developers/events/gateway-events#identify-gateway-capabilities}
*/
capabilities?: number;
}
/**
+21
View File
@@ -231,6 +231,20 @@ export enum GatewayIntentBits {
DirectMessagePolls = 1 << 25,
}
/**
* @see {@link https://docs.discord.com/developers/events/gateway-events#identify-gateway-capabilities}
*/
export enum GatewayCapabilityBits {
/**
* Opts the client into receiving {@link https://docs.discord.com/developers/resources/channel#channel-object-obfuscated-channels | obfuscated channel metadata} over the Gateway for channels it can't view
*
* @unstable `CHANNEL_OBFUSCATION` is a temporary, testing-only opt-in for channel obfuscation. This opt-in mechanism
* will change before the feature reaches general availability. Obfuscation is then planned to apply to all bots
* automatically, even when they don't provide this capability.
*/
ChannelObfuscation = 1 << 15,
}
/**
* @see {@link https://discord.com/developers/docs/topics/gateway-events#receive-events}
*/
@@ -2527,6 +2541,13 @@ export interface GatewayIdentifyData {
* @see {@link https://discord.com/developers/docs/topics/gateway#gateway-intents}
*/
intents: number;
/**
* Bitfield representing {@link https://docs.discord.com/developers/events/gateway-events#identify-gateway-capabilities | capabilities} of your gateway client
*
* @defaultValue `0`
* @see {@link https://docs.discord.com/developers/events/gateway-events#identify-gateway-capabilities}
*/
capabilities?: number;
}
/**
+6
View File
@@ -723,6 +723,12 @@ export enum ChannelFlags {
* Whether media download options are hidden.
*/
HideMediaDownloadOptions = 1 << 15,
/**
* This channel's metadata has been obfuscated because the current user cannot view it. Only ever set on channels
* received over the {@link https://docs.discord.com/developers/events/gateway | Gateway}; the HTTP API never sets this flag. See
* {@link https://docs.discord.com/developers/resources/channel#channel-object-obfuscated-channels | Obfuscated Channels}.
*/
ChannelObfuscated = 1 << 17,
/**
* This channel is a Spoiler Channel i.e. users must opt in to view its contents.
*/
+6
View File
@@ -725,6 +725,12 @@ export enum ChannelFlags {
* Whether media download options are hidden.
*/
HideMediaDownloadOptions = 1 << 15,
/**
* This channel's metadata has been obfuscated because the current user cannot view it. Only ever set on channels
* received over the {@link https://docs.discord.com/developers/events/gateway | Gateway}; the HTTP API never sets this flag. See
* {@link https://docs.discord.com/developers/resources/channel#channel-object-obfuscated-channels | Obfuscated Channels}.
*/
ChannelObfuscated = 1 << 17,
/**
* This channel is a Spoiler Channel i.e. users must opt in to view its contents.
*/