mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-17 20:13:30 +01:00
fix: voice websocket sending
This commit is contained in:
@@ -69,7 +69,7 @@ class VoiceWebSocket extends EventEmitter {
|
|||||||
* The actual WebSocket used to connect to the Voice WebSocket Server.
|
* The actual WebSocket used to connect to the Voice WebSocket Server.
|
||||||
* @type {WebSocket}
|
* @type {WebSocket}
|
||||||
*/
|
*/
|
||||||
this.ws = WebSocket.create(`wss://${this.voiceConnection.authentication.endpoint}`, { v: 3 });
|
this.ws = WebSocket.create(`wss://${this.voiceConnection.authentication.endpoint}/`, { v: 3 });
|
||||||
this.ws.onopen = this.onOpen.bind(this);
|
this.ws.onopen = this.onOpen.bind(this);
|
||||||
this.ws.onmessage = this.onMessage.bind(this);
|
this.ws.onmessage = this.onMessage.bind(this);
|
||||||
this.ws.onclose = this.onClose.bind(this);
|
this.ws.onclose = this.onClose.bind(this);
|
||||||
@@ -97,7 +97,7 @@ class VoiceWebSocket extends EventEmitter {
|
|||||||
*/
|
*/
|
||||||
sendPacket(packet) {
|
sendPacket(packet) {
|
||||||
try {
|
try {
|
||||||
packet = WebSocket.pack(packet);
|
packet = JSON.stringify(packet);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
return Promise.reject(error);
|
return Promise.reject(error);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user