feat: try implement djs voice + video (v12)

This commit is contained in:
Elysia
2024-07-24 19:27:50 +07:00
parent 7fa4666df0
commit 26aa85c126
31 changed files with 3768 additions and 9 deletions

View File

@@ -161,6 +161,23 @@ exports.Status = {
RESUMING: 8,
};
/**
* The current status of a voice connection. Here are the available statuses:
* * CONNECTED: 0
* * CONNECTING: 1
* * AUTHENTICATING: 2
* * RECONNECTING: 3
* * DISCONNECTED: 4
* @typedef {number} VoiceStatus
*/
exports.VoiceStatus = {
CONNECTED: 0,
CONNECTING: 1,
AUTHENTICATING: 2,
RECONNECTING: 3,
DISCONNECTED: 4,
};
/**
* The Opcodes sent to the Gateway:
* * DISPATCH: 0
@@ -244,6 +261,28 @@ exports.Opcodes = {
// Updated: 23/1/2024
};
/**
* @typedef {Opject<string, number>} VoiceOpcodes
*/
exports.VoiceOpcodes = {
IDENTIFY: 0,
SELECT_PROTOCOL: 1,
READY: 2,
HEARTBEAT: 3,
SESSION_DESCRIPTION: 4,
SPEAKING: 5,
HEARTBEAT_ACK: 6,
RESUME: 7,
HELLO: 8,
RESUMED: 9,
SOURCES: 12,
CLIENT_DISCONNECT: 13,
SESSION_UPDATE: 14,
MEDIA_SINK_WANTS: 15,
VOICE_BACKEND_VERSION: 16,
CHANNEL_OPTIONS_UPDATE: 17,
};
/**
* The types of events emitted by the Client:
* * RATE_LIMIT: rateLimit
@@ -433,6 +472,9 @@ exports.Events = {
CALL_DELETE: 'callDelete',
MESSAGE_POLL_VOTE_ADD: 'messagePollVoteAdd',
MESSAGE_POLL_VOTE_REMOVE: 'messagePollVoteRemove',
// Djs v12
VOICE_BROADCAST_SUBSCRIBE: 'subscribe',
VOICE_BROADCAST_UNSUBSCRIBE: 'unsubscribe',
};
/**