mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-18 12:33:30 +01:00
Make ServerChannel GuildChannel
This commit is contained in:
@@ -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;
|
||||||
@@ -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);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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);
|
||||||
|
|||||||
@@ -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();
|
||||||
|
|||||||
@@ -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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user