voice: start using provided IP rather than manually resolving

This commit is contained in:
Amish Shah
2018-04-27 15:11:37 +01:00
parent 64caa33594
commit 299fc001d5
3 changed files with 8 additions and 30 deletions

View File

@@ -1,5 +1,4 @@
const udp = require('dgram');
const dns = require('dns');
const { VoiceOPCodes } = require('../../../util/Constants');
const EventEmitter = require('events');
const { Error } = require('../../../errors');
@@ -66,23 +65,6 @@ class VoiceConnectionUDPClient extends EventEmitter {
return this.voiceConnection.authentication.port;
}
/**
* Tries to resolve the voice server endpoint to an address.
* @returns {Promise<string>}
*/
findEndpointAddress() {
return new Promise((resolve, reject) => {
dns.lookup(this.voiceConnection.authentication.endpoint, (error, address) => {
if (error) {
reject(error);
return;
}
this.discordAddress = address;
resolve(address);
});
});
}
/**
* Send a packet to the UDP client.
* @param {Object} packet The packet to send