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; return b.length === 0;
} }
class ServerChannel extends Channel { class GuildChannel extends Channel {
constructor(guild, data) { constructor(guild, data) {
super(guild.client, data, guild); 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 { class PermissionOverwrites {
constructor(serverChannel, data) { constructor(guildChannel, data) {
this.channel = serverChannel; this.channel = guildChannel;
if (data) { if (data) {
this.setup(data); this.setup(data);
} }

View File

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

View File

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

View File

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