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:20EncodingTypes
enum src/constants.ts:31GatewayActivityActionTypes
enum src/constants.ts:36GatewayActivityFlags
enum src/constants.ts:44GatewayActivityTypes
enum src/constants.ts:56GatewayDispatchEvents
enum src/constants.ts:64GatewayIntents
enum src/constants.ts:163GatewayOpCodes
enum src/constants.ts:261GatewayPresenceStatuses
enum src/constants.ts:303MediaCodecs
enum src/constants.ts:322MediaCodecTypes
enum src/constants.ts:317MediaDaveProposalsOperationTypes
enum src/constants.ts:364MediaEncryptionModes
enum src/constants.ts:340MediaOpCodes
enum src/constants.ts:369MediaProtocols
enum src/constants.ts:405MediaSpeakingFlags
enum src/constants.ts:419MediaSSRCTypes
enum src/constants.ts:426RTCPPacketTypes
enum src/constants.ts:561RTPPayloadTypes
enum src/constants.ts:550SocketCloseCodes
enum src/constants.ts:455SocketEvents
enum src/constants.ts:431SocketEventsBase
enum src/constants.ts:446SocketGatewayCloseCodes
enum src/constants.ts:495SocketInternalCloseCodes
enum src/constants.ts:472SocketMediaCloseCodes
enum src/constants.ts:512SocketStates
enum src/constants.ts:538Variables
Exported values.
ApiVersions
variable const src/constants.ts:7const 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:18const COMPRESS_TYPES: readonly CompressTypes[]DAVE_MODULE
variable const src/constants.ts:25const DAVE_MODULE: "@snazzah/davey" = '@snazzah/davey'DEFAULT_SHARD_COUNT
variable const src/constants.ts:27const DEFAULT_SHARD_COUNT: 1 = 1DEFAULT_SHARD_LAUNCH_DELAY
variable const src/constants.ts:28const DEFAULT_SHARD_LAUNCH_DELAY: 5000 = 5000DEFAULT_VOICE_TIMEOUT
variable const src/constants.ts:29const DEFAULT_VOICE_TIMEOUT: 30000 = 30000GATEWAY_INTENTS_ALL
variable const src/constants.ts:189const 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:234const 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:241const 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:213const 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:311const 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:330const MEDIA_CODECS_AUDIO: MediaCodecs[]Show definition (3 lines)
export const MEDIA_CODECS_AUDIO = [
MediaCodecs.OPUS,
];MEDIA_CODECS_VIDEO
variable const src/constants.ts:334const 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:351const 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:410const MEDIA_PROTOCOLS: readonly MediaProtocols[]MediaDaveTransition
variable const src/constants.ts:356const 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:412const 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:417const MediaSilencePacket: number[]Package
variable const src/constants.ts:1const Package: Readonly<{ URL: "https://github.com/detritusjs/client-socket"; VERSION: "0.9.0-beta.16" }>Show definition (4 lines)
export const Package = Object.freeze({
URL: 'https://github.com/detritusjs/client-socket',
VERSION: '0.9.0-beta.16',
});RTCP_HEADER_VERSION
variable const src/constants.ts:559const RTCP_HEADER_VERSION: 128 = 0x80RTCP_PACKET_TYPES
variable const src/constants.ts:571const RTCP_PACKET_TYPES: readonly (string | SENDER_REPORT | RECEIVER_REPORT | SOURCE_DESCRIPTION | BYE | APP | RTPFB | PSFB)[]RTP_HEADER_VERSION
variable const src/constants.ts:548const RTP_HEADER_VERSION: 128 = 0x80RTP_PAYLOAD_TYPES
variable const src/constants.ts:557RTPHeaderExtensionOneByte
variable const src/constants.ts:573const 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:578const RTPHeaderExtensionTwoByte: Readonly<{ HEADER: number[] }>Show definition (3 lines)
export const RTPHeaderExtensionTwoByte = Object.freeze({
HEADER: [0x10, 0x00],
});SocketInternalCloseReasons
variable const src/constants.ts:484const 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:582const ZLIB_SUFFIX: number[]