fix(ThreadChannel): better property handling (#6172)

This commit is contained in:
ckohen
2021-07-27 17:29:06 -07:00
committed by GitHub
parent 30a58dc801
commit 9679b90872
8 changed files with 64 additions and 33 deletions

View File

@@ -126,7 +126,7 @@ class Channel extends Base {
return ThreadChannelTypes.includes(this.type);
}
static create(client, data, guild, allowUnknownGuild) {
static create(client, data, guild, { allowUnknownGuild, fromInteraction }) {
if (!CategoryChannel) CategoryChannel = require('./CategoryChannel');
if (!DMChannel) DMChannel = require('./DMChannel');
if (!NewsChannel) NewsChannel = require('./NewsChannel');
@@ -176,7 +176,7 @@ class Channel extends Base {
case ChannelTypes.GUILD_NEWS_THREAD:
case ChannelTypes.GUILD_PUBLIC_THREAD:
case ChannelTypes.GUILD_PRIVATE_THREAD: {
channel = new ThreadChannel(guild, data, client);
channel = new ThreadChannel(guild, data, client, fromInteraction);
if (!allowUnknownGuild) channel.parent?.threads.cache.set(channel.id, channel);
break;
}