GuildMember#voice never undefined, improve documentation for VoiceState

This commit is contained in:
Amish Shah
2018-08-10 17:05:26 +01:00
parent 00ac62f975
commit e059581eee
2 changed files with 13 additions and 12 deletions

View File

@@ -3,6 +3,7 @@ const Role = require('./Role');
const Permissions = require('../util/Permissions');
const GuildMemberRoleStore = require('../stores/GuildMemberRoleStore');
const Base = require('./Base');
const VoiceState = require('./VoiceState');
const { Presence } = require('./Presence');
const { Error } = require('../errors');
@@ -96,7 +97,7 @@ class GuildMember extends Base {
}
get voice() {
return this.guild.voiceStates.get(this.id);
return this.guild.voiceStates.get(this.id) || new VoiceState(this.guild, { user_id: this.id });
}
/**