Constantsnamespace
Opcodes, intents, close codes, activity types and other gateway constants.
On this page
import { Constants } from 'detritus-client-socket';Enums
Named constants.
CryptoModules
enum src/constants.ts:24DaveCodecs
enum src/constants.ts:448DaveMediaTypes
enum src/constants.ts:443EncodingTypes
enum src/constants.ts:35GatewayActivityActionTypes
enum src/constants.ts:40GatewayActivityFlags
enum src/constants.ts:48GatewayActivityTypes
enum src/constants.ts:60GatewayDispatchEvents
enum src/constants.ts:68GatewayIntents
enum src/constants.ts:167GatewayOpCodes
enum src/constants.ts:265GatewayPresenceStatuses
enum src/constants.ts:314MediaCodecs
enum src/constants.ts:333MediaCodecTypes
enum src/constants.ts:328MediaDaveProposalsOperationTypes
enum src/constants.ts:375MediaEncryptionModes
enum src/constants.ts:351MediaOpCodes
enum src/constants.ts:380MediaProtocols
enum src/constants.ts:416MediaSpeakingFlags
enum src/constants.ts:430MediaSSRCTypes
enum src/constants.ts:437MediaStreamTypes
enum src/constants.ts:458RTCPPacketTypes
enum src/constants.ts:615RTCPPayloadFeedbackTypes
enum src/constants.ts:607RTCPTransportFeedbackTypes
enum src/constants.ts:599RTPPayloadTypes
enum src/constants.ts:587SocketCloseCodes
enum src/constants.ts:492SocketEvents
enum src/constants.ts:465SocketEventsBase
enum src/constants.ts:483SocketGatewayCloseCodes
enum src/constants.ts:532SocketInternalCloseCodes
enum src/constants.ts:509SocketMediaCloseCodes
enum src/constants.ts:549SocketStates
enum src/constants.ts:575Variables
Exported values.
ApiVersions
variable const src/constants.ts:11const ApiVersions: Readonly<{ GATEWAY: 10; MEDIA_GATEWAY: 8 }>Show definition (4 lines)
export const ApiVersions = Object.freeze({
GATEWAY: 10,
MEDIA_GATEWAY: 8,
});COMPRESS_TYPES
variable const src/constants.ts:22const COMPRESS_TYPES: readonly CompressTypes[]DAVE_MODULE
variable const src/constants.ts:29const DAVE_MODULE: "@snazzah/davey" = '@snazzah/davey'DEFAULT_SHARD_COUNT
variable const src/constants.ts:31const DEFAULT_SHARD_COUNT: 1 = 1DEFAULT_SHARD_LAUNCH_DELAY
variable const src/constants.ts:32const DEFAULT_SHARD_LAUNCH_DELAY: 5000 = 5000DEFAULT_VOICE_TIMEOUT
variable const src/constants.ts:33const DEFAULT_VOICE_TIMEOUT: 30000 = 30000GATEWAY_INTENTS_ALL
variable const src/constants.ts:193const GATEWAY_INTENTS_ALL: GatewayIntentsShow definition (23 lines)
export const GATEWAY_INTENTS_ALL = [
GatewayIntents.GUILDS,
GatewayIntents.GUILD_MEMBERS,
GatewayIntents.GUILD_BANS,
GatewayIntents.GUILD_EMOJIS,
GatewayIntents.GUILD_INTEGRATIONS,
GatewayIntents.GUILD_WEBHOOKS,
GatewayIntents.GUILD_INVITES,
GatewayIntents.GUILD_VOICE_STATES,
GatewayIntents.GUILD_PRESENCES,
GatewayIntents.GUILD_MESSAGES,
GatewayIntents.GUILD_MESSAGE_REACTIONS,
GatewayIntents.GUILD_MESSAGE_TYPING,
GatewayIntents.DIRECT_MESSAGES,
GatewayIntents.DIRECT_MESSAGE_REACTIONS,
GatewayIntents.DIRECT_MESSAGE_TYPING,
GatewayIntents.MESSAGE_CONTENT,
GatewayIntents.GUILD_SCHEDULED_EVENTS,
GatewayIntents.AUTO_MODERATION_CONFIGURATION,
GatewayIntents.AUTO_MODERATION_EXECUTION,
GatewayIntents.GUILD_MESSAGE_POLLS,
GatewayIntents.DIRECT_MESSAGE_POLLS,
].reduce((x, total) => total | x);GATEWAY_INTENTS_ALL_DIRECT_MESSAGES
variable const src/constants.ts:238const GATEWAY_INTENTS_ALL_DIRECT_MESSAGES: GatewayIntentsShow definition (6 lines)
export const GATEWAY_INTENTS_ALL_DIRECT_MESSAGES = [
GatewayIntents.DIRECT_MESSAGES,
GatewayIntents.DIRECT_MESSAGE_REACTIONS,
GatewayIntents.DIRECT_MESSAGE_TYPING,
GatewayIntents.DIRECT_MESSAGE_POLLS,
].reduce((x, total) => total | x);GATEWAY_INTENTS_ALL_GUILD
variable const src/constants.ts:245const GATEWAY_INTENTS_ALL_GUILD: GatewayIntentsShow definition (18 lines)
export const GATEWAY_INTENTS_ALL_GUILD = [
GatewayIntents.GUILDS,
GatewayIntents.GUILD_MEMBERS,
GatewayIntents.GUILD_BANS,
GatewayIntents.GUILD_EMOJIS,
GatewayIntents.GUILD_INTEGRATIONS,
GatewayIntents.GUILD_WEBHOOKS,
GatewayIntents.GUILD_INVITES,
GatewayIntents.GUILD_VOICE_STATES,
GatewayIntents.GUILD_PRESENCES,
GatewayIntents.GUILD_MESSAGES,
GatewayIntents.GUILD_MESSAGE_REACTIONS,
GatewayIntents.GUILD_MESSAGE_TYPING,
GatewayIntents.GUILD_SCHEDULED_EVENTS,
GatewayIntents.AUTO_MODERATION_CONFIGURATION,
GatewayIntents.AUTO_MODERATION_EXECUTION,
GatewayIntents.GUILD_MESSAGE_POLLS,
].reduce((x, total) => total | x);GATEWAY_INTENTS_ALL_UNPRIVILEGED
variable const src/constants.ts:217const GATEWAY_INTENTS_ALL_UNPRIVILEGED: GatewayIntentsShow definition (20 lines)
export const GATEWAY_INTENTS_ALL_UNPRIVILEGED = [
GatewayIntents.GUILDS,
GatewayIntents.GUILD_BANS,
GatewayIntents.GUILD_EMOJIS,
GatewayIntents.GUILD_INTEGRATIONS,
GatewayIntents.GUILD_WEBHOOKS,
GatewayIntents.GUILD_INVITES,
GatewayIntents.GUILD_VOICE_STATES,
GatewayIntents.GUILD_MESSAGES,
GatewayIntents.GUILD_MESSAGE_REACTIONS,
GatewayIntents.GUILD_MESSAGE_TYPING,
GatewayIntents.DIRECT_MESSAGES,
GatewayIntents.DIRECT_MESSAGE_REACTIONS,
GatewayIntents.DIRECT_MESSAGE_TYPING,
GatewayIntents.GUILD_SCHEDULED_EVENTS,
GatewayIntents.AUTO_MODERATION_CONFIGURATION,
GatewayIntents.AUTO_MODERATION_EXECUTION,
GatewayIntents.GUILD_MESSAGE_POLLS,
GatewayIntents.DIRECT_MESSAGE_POLLS,
].reduce((x, total) => total | x);MaxNumbers
variable const src/constants.ts:322const MaxNumbers: Readonly<{ UINT16: 65535; UINT32: 4294967295; UINT8: 255 }>Show definition (5 lines)
export const MaxNumbers = Object.freeze({
UINT8: 0xFF,
UINT16: 0xFFFF,
UINT32: 0xFFFFFFFF,
});MEDIA_CODECS_AUDIO
variable const src/constants.ts:341const MEDIA_CODECS_AUDIO: MediaCodecs[]Show definition (3 lines)
export const MEDIA_CODECS_AUDIO = [
MediaCodecs.OPUS,
];MEDIA_CODECS_VIDEO
variable const src/constants.ts:345const MEDIA_CODECS_VIDEO: MediaCodecs[]Show definition (5 lines)
export const MEDIA_CODECS_VIDEO = [
MediaCodecs.VP8,
MediaCodecs.VP9,
MediaCodecs.H264,
];MEDIA_ENCRYPTION_MODES
variable const src/constants.ts:362const MEDIA_ENCRYPTION_MODES: readonly MediaEncryptionModes[]Show definition (4 lines)
export const MEDIA_ENCRYPTION_MODES = Object.freeze([
MediaEncryptionModes.AEAD_AES256_GCM_RTPSIZE,
MediaEncryptionModes.AEAD_XCHACHA20_POLY1305_RTPSIZE,
]);MEDIA_PROTOCOLS
variable const src/constants.ts:421const MEDIA_PROTOCOLS: readonly MediaProtocols[]MediaDaveTransition
variable const src/constants.ts:367const MediaDaveTransition: Readonly<{ EXPIRY: 10; EXPIRY_PENDING_DOWNGRADE: 24; FAILURE_TOLERANCE: 36 }>Show definition (7 lines)
export const MediaDaveTransition = Object.freeze({
// seconds
EXPIRY: 10,
EXPIRY_PENDING_DOWNGRADE: 24,
// consecutive decryption failures before we try to recover
FAILURE_TOLERANCE: 36,
});MediaReceivedVideoQuality
variable const src/constants.ts:423const MediaReceivedVideoQuality: Readonly<{ FULL: "full"; OFF: "off" }>Show definition (4 lines)
export const MediaReceivedVideoQuality = Object.freeze({
OFF: 'off',
FULL: 'full',
});MediaSilencePacket
variable const src/constants.ts:428const MediaSilencePacket: number[]Package
variable const src/constants.ts:5const Package: Readonly<{ URL: "https://github.com/detritusjs/client-socket"; VERSION: string }>Show definition (4 lines)
export const Package = Object.freeze({
URL: 'https://github.com/detritusjs/client-socket',
VERSION: version,
});RTCP_HEADER_VERSION
variable const src/constants.ts:596const RTCP_HEADER_VERSION: 128 = 0x80RTCP_PACKET_TYPES
variable const src/constants.ts:625const RTCP_PACKET_TYPES: readonly (string | SENDER_REPORT | RECEIVER_REPORT | SOURCE_DESCRIPTION | BYE | APP | RTPFB | PSFB)[]RTP_HEADER_VERSION
variable const src/constants.ts:585const RTP_HEADER_VERSION: 128 = 0x80RTP_PAYLOAD_TYPES
variable const src/constants.ts:594RTPHeaderExtensionOneByte
variable const src/constants.ts:627const RTPHeaderExtensionOneByte: Readonly<{ HEADER: number[]; LOCAL_IDENTIFER: 15 }>Show definition (4 lines)
export const RTPHeaderExtensionOneByte = Object.freeze({
HEADER: [0xBE, 0xDE],
LOCAL_IDENTIFER: 0xF,
});RTPHeaderExtensionTwoByte
variable const src/constants.ts:632const RTPHeaderExtensionTwoByte: Readonly<{ HEADER: number[] }>Show definition (3 lines)
export const RTPHeaderExtensionTwoByte = Object.freeze({
HEADER: [0x10, 0x00],
});SocketInternalCloseReasons
variable const src/constants.ts:521const SocketInternalCloseReasons: Readonly<{ -1: "Gateway Error, check `warn` listener"; 4900: "Invalid data received, reconnecting"; 4901: "Reconnecting"; 4902: "Heartbeat ACK never arrived"; 4903: "Invalid nonce received by Heartbeat ACK"; 4904: "Received message from not our current socket"; 4905: "Received open from not our current socket"; 4906: "Received Invalid Session that is not resumable" }>Show definition (10 lines)
export const SocketInternalCloseReasons = Object.freeze({
[SocketInternalCloseCodes.CONNECTION_ERROR]: 'Gateway Error, check `warn` listener',
[SocketInternalCloseCodes.INVALID_DATA]: 'Invalid data received, reconnecting',
[SocketInternalCloseCodes.RECONNECTING]: 'Reconnecting',
[SocketInternalCloseCodes.HEARTBEAT_ACK]: 'Heartbeat ACK never arrived',
[SocketInternalCloseCodes.HEARTBEAT_ACK_NONCE]: 'Invalid nonce received by Heartbeat ACK',
[SocketInternalCloseCodes.OTHER_SOCKET_MESSAGE]: 'Received message from not our current socket',
[SocketInternalCloseCodes.OTHER_SOCKET_OPEN]: 'Received open from not our current socket',
[SocketInternalCloseCodes.INVALID_SESSION_NON_RESUMABLE]: 'Received Invalid Session that is not resumable',
});ZLIB_SUFFIX
variable const src/constants.ts:636const ZLIB_SUFFIX: number[]