mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-10 00:23:30 +01:00
Add a backwards-compatible getter for the first voice connection, thanks @qeled
This commit is contained in:
@@ -165,6 +165,14 @@ export default class Client extends EventEmitter {
|
||||
return this.internal.voiceConnections;
|
||||
}
|
||||
|
||||
/**
|
||||
* The first voice connection the bot has connected to. Available for backwards compatibility.
|
||||
* @type {VoiceConnection} first voice connection
|
||||
*/
|
||||
get voiceConnection() {
|
||||
return this.internal.voiceConnection;
|
||||
}
|
||||
|
||||
/**
|
||||
* Unix timestamp of when the Client first emitted the `ready `event. Only available after `ready` event has been emitted.
|
||||
* @type {Number} timestamp of ready time
|
||||
|
||||
@@ -305,6 +305,12 @@ export default class InternalClient {
|
||||
});
|
||||
}
|
||||
|
||||
// Backwards-compatible utility getter method for the first voice connection
|
||||
// Thanks to #q (@qeled) for suggesting this
|
||||
get voiceConnection() {
|
||||
return this.voiceConnections[0];
|
||||
}
|
||||
|
||||
// def forceFetchUsers
|
||||
forceFetchUsers() {
|
||||
this.sendWS({
|
||||
|
||||
Reference in New Issue
Block a user