fix: remove GuildChannel fallback, and remove GuildChannel as extendable (#3165)

* remake pr

* typings
This commit is contained in:
bdistin
2019-04-03 16:02:19 -05:00
committed by SpaceEEC
parent 089f65fd2a
commit bb92289e45
4 changed files with 2 additions and 8 deletions

View File

@@ -60,7 +60,7 @@ class ChannelStore extends DataStore {
const channel = Channel.create(this.client, data, guild);
if (!channel) {
this.client.emit(Events.DEBUG, `Failed to find guild for channel ${data.id} ${data.type}`);
this.client.emit(Events.DEBUG, `Failed to find guild, or unknown type for channel ${data.id} ${data.type}`);
return null;
}

View File

@@ -116,12 +116,8 @@ class Channel extends Base {
channel = new CategoryChannel(guild, data);
break;
}
default: {
const GuildChannel = Structures.get('GuildChannel');
channel = new GuildChannel(guild, data);
}
}
guild.channels.set(channel.id, channel);
if (channel) guild.channels.set(channel.id, channel);
}
}
return channel;

View File

@@ -75,7 +75,6 @@ const structures = {
TextChannel: require('../structures/TextChannel'),
VoiceChannel: require('../structures/VoiceChannel'),
CategoryChannel: require('../structures/CategoryChannel'),
GuildChannel: require('../structures/GuildChannel'),
GuildMember: require('../structures/GuildMember'),
Guild: require('../structures/Guild'),
Message: require('../structures/Message'),

1
typings/index.d.ts vendored
View File

@@ -1735,7 +1735,6 @@ declare module 'discord.js' {
TextChannel: typeof TextChannel;
VoiceChannel: typeof VoiceChannel;
CategoryChannel: typeof CategoryChannel;
GuildChannel: typeof GuildChannel;
GuildMember: typeof GuildMember;
Guild: typeof Guild;
Message: typeof Message;