mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-14 10:33:30 +01:00
remove console.log and fix endless loop connecting
This commit is contained in:
@@ -84,7 +84,6 @@ class VoiceConnectionUDPClient extends EventEmitter {
|
|||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
if (this.socket) {
|
if (this.socket) {
|
||||||
if (!this.discordAddress || !this.discordPort) {
|
if (!this.discordAddress || !this.discordPort) {
|
||||||
console.log(this);
|
|
||||||
reject(new Error('malformed UDP address or port'));
|
reject(new Error('malformed UDP address or port'));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -96,7 +96,6 @@ class VoiceWebSocket extends EventEmitter {
|
|||||||
* @returns {Promise<string>}
|
* @returns {Promise<string>}
|
||||||
*/
|
*/
|
||||||
sendPacket(packet) {
|
sendPacket(packet) {
|
||||||
console.log('try send', packet);
|
|
||||||
try {
|
try {
|
||||||
packet = JSON.stringify(packet);
|
packet = JSON.stringify(packet);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
@@ -165,7 +164,6 @@ class VoiceWebSocket extends EventEmitter {
|
|||||||
* @param {Object} packet the received packet
|
* @param {Object} packet the received packet
|
||||||
* @event VoiceWebSocket#ready
|
* @event VoiceWebSocket#ready
|
||||||
*/
|
*/
|
||||||
console.log('hi', packet.d);
|
|
||||||
this.emit('ready', packet.d);
|
this.emit('ready', packet.d);
|
||||||
break;
|
break;
|
||||||
case Constants.VoiceOPCodes.SESSION_DESCRIPTION:
|
case Constants.VoiceOPCodes.SESSION_DESCRIPTION:
|
||||||
@@ -233,7 +231,7 @@ class VoiceWebSocket extends EventEmitter {
|
|||||||
* Sends a heartbeat packet
|
* Sends a heartbeat packet
|
||||||
*/
|
*/
|
||||||
sendHeartbeat() {
|
sendHeartbeat() {
|
||||||
this.sendPacket({ op: Constants.VoiceOPCodes.HEARTBEAT })
|
this.sendPacket({ op: Constants.VoiceOPCodes.HEARTBEAT, d: null })
|
||||||
.catch(() => {
|
.catch(() => {
|
||||||
this.emit('warn', 'tried to send heartbeat, but connection is not open');
|
this.emit('warn', 'tried to send heartbeat, but connection is not open');
|
||||||
this.clearHeartbeat();
|
this.clearHeartbeat();
|
||||||
|
|||||||
Reference in New Issue
Block a user