mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-11 00:53:31 +01:00
Fix & clean up Guild.voiceConnection and VoiceChannel.connection
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user