mirror of
https://github.com/danbulant/discord.js
synced 2026-05-24 20:42:27 +00:00
Clean up some more
This commit is contained in:
parent
4e6b632d23
commit
cf04b44454
2 changed files with 12 additions and 13 deletions
|
|
@ -17,7 +17,6 @@ const fs = require('fs');
|
|||
* @extends {EventEmitter}
|
||||
*/
|
||||
class VoiceConnection extends EventEmitter {
|
||||
|
||||
constructor(pendingConnection) {
|
||||
super();
|
||||
|
||||
|
|
|
|||
|
|
@ -3,18 +3,6 @@ const dns = require('dns');
|
|||
const Constants = require('../../util/Constants');
|
||||
const EventEmitter = require('events').EventEmitter;
|
||||
|
||||
function parseLocalPacket(message) {
|
||||
try {
|
||||
const packet = new Buffer(message);
|
||||
let address = '';
|
||||
for (let i = 4; i < packet.indexOf(0, i); i++) address += String.fromCharCode(packet[i]);
|
||||
const port = parseInt(packet.readUIntLE(packet.length - 2, 2).toString(10), 10);
|
||||
return { address, port };
|
||||
} catch (error) {
|
||||
return { error };
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Represents a UDP Client for a Voice Connection
|
||||
* @extends {EventEmitter}
|
||||
|
|
@ -142,4 +130,16 @@ class VoiceConnectionUDPClient extends EventEmitter {
|
|||
}
|
||||
}
|
||||
|
||||
function parseLocalPacket(message) {
|
||||
try {
|
||||
const packet = new Buffer(message);
|
||||
let address = '';
|
||||
for (let i = 4; i < packet.indexOf(0, i); i++) address += String.fromCharCode(packet[i]);
|
||||
const port = parseInt(packet.readUIntLE(packet.length - 2, 2).toString(10), 10);
|
||||
return { address, port };
|
||||
} catch (error) {
|
||||
return { error };
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = VoiceConnectionUDPClient;
|
||||
|
|
|
|||
Loading…
Reference in a new issue