Added VoiceStateUpdate handler and DataStore for VoiceChannels. Also added toString methods to Guilds, DMChannels, ServerChannels and Users.

This commit is contained in:
hydrabolt
2016-04-17 19:12:29 +01:00
parent 685d7b622c
commit d1d13f5c85
11 changed files with 111 additions and 2 deletions

View File

@@ -13,8 +13,12 @@ class GuildMember {
setup(data) {
this.user = data.user;
this.deaf = data.deaf;
this.mute = data.mute;
this.serverDeaf = data.deaf;
this.serverMute = data.mute;
this.selfMute = data.self_mute;
this.selfDeaf = data.self_deaf;
this.voiceSessionID = data.session_id;
this.voiceChannelID = data.channel_id;
this.joinDate = new Date(data.joined_at);
this._roles = data.roles;
}
@@ -31,6 +35,18 @@ class GuildMember {
return list;
}
get mute() {
return this.selfMute || this.serverMute;
}
get deaf() {
return this.selfDeaf || this.serverDeaf;
}
get voiceChannel() {
return this.guild.store.get('channels', this.voiceChannelID);
}
get id() {
return this.user.id;
}