Make ServerChannel GuildChannel

This commit is contained in:
Amish Shah
2016-08-18 10:27:31 +01:00
parent 46e89f56c7
commit 159233059e
5 changed files with 10 additions and 10 deletions

View File

@@ -18,7 +18,7 @@ function arraysEqual(a, b) {
return b.length === 0;
}
class ServerChannel extends Channel {
class GuildChannel extends Channel {
constructor(guild, data) {
super(guild.client, data, guild);
}
@@ -146,4 +146,4 @@ class ServerChannel extends Channel {
}
}
module.exports = ServerChannel;
module.exports = GuildChannel;

View File

@@ -1,6 +1,6 @@
class PermissionOverwrites {
constructor(serverChannel, data) {
this.channel = serverChannel;
constructor(guildChannel, data) {
this.channel = guildChannel;
if (data) {
this.setup(data);
}

View File

@@ -1,11 +1,11 @@
const ServerChannel = require('./ServerChannel');
const GuildChannel = require('./GuildChannel');
const TextChannelDataStore = require('./datastore/TextChannelDataStore');
const TextBasedChannel = require('./interface/TextBasedChannel');
/**
* Represents a Server Text Channel on Discord.
*/
class TextChannel extends ServerChannel {
class TextChannel extends GuildChannel {
constructor(guild, data) {
super(guild, data);

View File

@@ -1,10 +1,10 @@
const ServerChannel = require('./ServerChannel');
const GuildChannel = require('./GuildChannel');
const VoiceChannelDataStore = require('./datastore/VoiceChannelDataStore');
/**
* Represents a Server Voice Channel on Discord.
*/
class VoiceChannel extends ServerChannel {
class VoiceChannel extends GuildChannel {
constructor(guild, data) {
super(guild, data);
this.store = new VoiceChannelDataStore();

View File

@@ -6,7 +6,7 @@ const User = require('../User');
const DMChannel = require('../DMChannel');
const TextChannel = require('../TextChannel');
const VoiceChannel = require('../VoiceChannel');
const ServerChannel = require('../ServerChannel');
const GuildChannel = require('../GuildChannel');
class ClientDataStore extends AbstractDataStore {
constructor(client) {
@@ -85,7 +85,7 @@ class ClientDataStore extends AbstractDataStore {
killChannel(channel) {
this.remove('channels', channel);
if (channel instanceof ServerChannel) {
if (channel instanceof GuildChannel) {
channel.guild.store.remove('channels', channel);
}
}