Remove GuildDataStore and move towards storing data in Maps

This commit is contained in:
Amish Shah
2016-08-19 19:58:32 +01:00
parent 75ff9fb096
commit ed818d6e7f
13 changed files with 44 additions and 88 deletions

View File

@@ -53,10 +53,10 @@ class ClientDataStore extends AbstractDataStore {
if (guild) {
if (data.type === Constants.ChannelTypes.text) {
channel = new TextChannel(guild, data);
guild.store.add('channels', channel);
guild.channels.set(channel.id, channel);
} else if (data.type === Constants.ChannelTypes.voice) {
channel = new VoiceChannel(guild, data);
guild.store.add('channels', channel);
guild.channels.set(channel.id, channel);
}
}
}
@@ -86,7 +86,7 @@ class ClientDataStore extends AbstractDataStore {
killChannel(channel) {
this.remove('channels', channel);
if (channel instanceof GuildChannel) {
channel.guild.store.remove('channels', channel);
channel.guild.channels.delete(channel.id);
}
}