Remove VoiceChannel store and add members map

This commit is contained in:
Amish Shah
2016-08-19 21:29:03 +01:00
parent 4400eb1b5c
commit bd50e3c0a5
5 changed files with 7 additions and 24 deletions

File diff suppressed because one or more lines are too long

View File

@@ -15,7 +15,7 @@ class VoiceStateUpdateHandler extends AbstractHandler {
if (member) {
const oldVoiceChannelMember = cloneObject(member);
if (member.voiceChannel && member.voiceChannel.id !== data.channel_id) {
member.voiceChannel.store.remove('members', oldVoiceChannelMember);
member.voiceChannel.members.delete(oldVoiceChannelMember.id);
}
member.serverMute = data.mute;

View File

@@ -1,5 +1,4 @@
const GuildChannel = require('./GuildChannel');
const VoiceChannelDataStore = require('./datastore/VoiceChannelDataStore');
/**
* Represents a Server Voice Channel on Discord.
@@ -8,7 +7,11 @@ const VoiceChannelDataStore = require('./datastore/VoiceChannelDataStore');
class VoiceChannel extends GuildChannel {
constructor(guild, data) {
super(guild, data);
this.store = new VoiceChannelDataStore();
/**
* The members in this Voice Channel.
* @type {Map<String, GuildMember>}
*/
this.members = new Map();
}
setup(data) {

View File

@@ -1,10 +0,0 @@
const AbstractDataStore = require('./AbstractDataStore');
class TextChannelDataStore extends AbstractDataStore {
constructor() {
super();
this.register('messages');
}
}
module.exports = TextChannelDataStore;

View File

@@ -1,10 +0,0 @@
const AbstractDataStore = require('./AbstractDataStore');
class VoiceChannelDataStore extends AbstractDataStore {
constructor() {
super();
this.register('members');
}
}
module.exports = VoiceChannelDataStore;