mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-12 17:43:30 +01:00
Remove useless SecretKey class
This commit is contained in:
@@ -1,5 +1,4 @@
|
||||
const { OPCodes, VoiceOPCodes } = require('../../util/Constants');
|
||||
const SecretKey = require('./util/SecretKey');
|
||||
const EventEmitter = require('events');
|
||||
const { Error } = require('../../errors');
|
||||
const WebSocket = require('../../WebSocket');
|
||||
@@ -164,14 +163,17 @@ class VoiceWebSocket extends EventEmitter {
|
||||
*/
|
||||
this.emit('ready', packet.d);
|
||||
break;
|
||||
/* eslint-disable no-case-declarations */
|
||||
case VoiceOPCodes.SESSION_DESCRIPTION:
|
||||
const key = new Uint8Array(new ArrayBuffer(packet.d.secret_key.length));
|
||||
for (const i in packet.d.secret_key) key[i] = packet.d.secret_key[i];
|
||||
/**
|
||||
* Emitted once the Voice Websocket receives a description of this voice session.
|
||||
* @param {string} encryptionMode The type of encryption being used
|
||||
* @param {SecretKey} secretKey The secret key used for encryption
|
||||
* @param {Uint8Array} secretKey The secret key used for encryption
|
||||
* @event VoiceWebSocket#sessionDescription
|
||||
*/
|
||||
this.emit('sessionDescription', packet.d.mode, new SecretKey(packet.d.secret_key));
|
||||
this.emit('sessionDescription', packet.d.mode, key);
|
||||
break;
|
||||
case VoiceOPCodes.SPEAKING:
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user