mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-11 09:03:29 +01:00
voice: Guild.voiceConnection => Guild.voice.connection
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
'use strict';
|
||||
|
||||
const Base = require('./Base');
|
||||
const { browser } = require('../util/Constants');
|
||||
|
||||
/**
|
||||
* Represents the voice state for a Guild Member.
|
||||
@@ -77,6 +78,16 @@ class VoiceState extends Base {
|
||||
return this.guild.channels.get(this.channelID) || null;
|
||||
}
|
||||
|
||||
/**
|
||||
* If this is a voice state of the client user, then this will refer to the active VoiceConnection for this guild
|
||||
* @type {?VoiceConnection}
|
||||
* @readonly
|
||||
*/
|
||||
get connection() {
|
||||
if (browser || this.id !== this.guild.me.id) return null;
|
||||
return this.client.voice.connections.get(this.guild.id) || null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Whether this member is either self-deafened or server-deafened
|
||||
* @type {?boolean}
|
||||
|
||||
Reference in New Issue
Block a user