Fix & clean up Guild.voiceConnection and VoiceChannel.connection

This commit is contained in:
Schuyler Cebulskie
2016-09-21 16:01:08 -04:00
parent 15d7f8e2fe
commit a27f6c96bb
2 changed files with 22 additions and 24 deletions

View File

@@ -232,6 +232,16 @@ class Guild {
return this.members.get(this.ownerID);
}
/**
* If the client is connected to any voice channel in this guild, this will be the relevant
* VoiceConnection.
* @type {VoiceConnection}
* @readonly
*/
get voiceConnection() {
return this.client.voice.connections.get(this.id) || null;
}
/**
* The `#general` GuildChannel of the server.
* @type {GuildChannel}
@@ -690,16 +700,6 @@ class Guild {
}
}
}
/**
* If the client is connected to any voice channel in this guild, this will be the relevant
* VoiceConnection.
* @type {VoiceConnection}
* @readonly
*/
get voiceConnection() {
return this.client.voice.connections.get(this.id);
}
}
module.exports = Guild;