mirror of
https://github.com/danbulant/discord.js
synced 2026-06-09 01:31:29 +00:00
fix: voice websocket sending
This commit is contained in:
parent
675e1eccb1
commit
2305311ec1
1 changed files with 2 additions and 2 deletions
|
|
@ -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);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue