mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-12 01:23:31 +01:00
Minor inconsistencies
This commit is contained in:
@@ -84,6 +84,10 @@ var _StructuresInvite = require("../../Structures/Invite");
|
||||
|
||||
var _StructuresInvite2 = _interopRequireDefault(_StructuresInvite);
|
||||
|
||||
var _VoiceVoiceConnection = require("../../Voice/VoiceConnection");
|
||||
|
||||
var _VoiceVoiceConnection2 = _interopRequireDefault(_VoiceVoiceConnection);
|
||||
|
||||
var Resolver = (function () {
|
||||
function Resolver(internal) {
|
||||
_classCallCheck(this, Resolver);
|
||||
@@ -221,12 +225,11 @@ var Resolver = (function () {
|
||||
// accepts Array, Channel, Server, User, Message, String and anything
|
||||
// toString()-able
|
||||
|
||||
var final = resource;
|
||||
if (resource instanceof Array) {
|
||||
final = resource.join("\n");
|
||||
resource = resource.join("\n");
|
||||
}
|
||||
|
||||
return final.toString();
|
||||
return resource.toString();
|
||||
};
|
||||
|
||||
Resolver.prototype.resolveUser = function resolveUser(resource) {
|
||||
@@ -273,7 +276,7 @@ var Resolver = (function () {
|
||||
|
||||
Resolver.prototype.resolveChannel = function resolveChannel(resource) {
|
||||
/*
|
||||
accepts a Message, Channel, Server, String ID, User
|
||||
accepts a Message, Channel, VoiceConnection, Server, String ID, User
|
||||
*/
|
||||
|
||||
if (resource instanceof _StructuresMessage2["default"]) {
|
||||
@@ -282,6 +285,9 @@ var Resolver = (function () {
|
||||
if (resource instanceof _StructuresChannel2["default"]) {
|
||||
return Promise.resolve(resource);
|
||||
}
|
||||
if (resource instanceof _VoiceVoiceConnection2["default"]) {
|
||||
return Promise.resolve(resource.voiceChannel);
|
||||
}
|
||||
if (resource instanceof _StructuresServer2["default"]) {
|
||||
return Promise.resolve(resource.defaultChannel);
|
||||
}
|
||||
|
||||
@@ -78,7 +78,9 @@ var VoiceConnection = (function (_EventEmitter) {
|
||||
|
||||
VoiceConnection.prototype.destroy = function destroy() {
|
||||
this.stopPlaying();
|
||||
if (this.KAI) clearInterval(this.KAI);
|
||||
if (this.KAI) {
|
||||
clearInterval(this.KAI);
|
||||
}
|
||||
this.vWS.close();
|
||||
this.udp.close();
|
||||
this.client.internal.sendWS({
|
||||
@@ -350,7 +352,7 @@ var VoiceConnection = (function (_EventEmitter) {
|
||||
}
|
||||
discordPort = msg.readUIntLE(msg.length - 2, 2).toString(10);
|
||||
|
||||
var wsDiscPayload = {
|
||||
vWS.send(JSON.stringify({
|
||||
"op": 1,
|
||||
"d": {
|
||||
"protocol": "udp",
|
||||
@@ -360,8 +362,7 @@ var VoiceConnection = (function (_EventEmitter) {
|
||||
"mode": self.vWSData.modes[0] //Plain
|
||||
}
|
||||
}
|
||||
};
|
||||
vWS.send(JSON.stringify(wsDiscPayload));
|
||||
}));
|
||||
firstPacket = false;
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user