mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-12 01:23:31 +01:00
feat: allow channels from uncached guilds to be returned from fetch (#6034)
Co-authored-by: Antonio Román <kyradiscord@gmail.com>
This commit is contained in:
@@ -24,9 +24,10 @@ class GuildChannel extends Channel {
|
||||
/**
|
||||
* @param {Guild} guild The guild the guild channel is part of
|
||||
* @param {APIChannel} data The data for the guild channel
|
||||
* @param {Client} [client] A safety parameter for the client that instantiated this
|
||||
*/
|
||||
constructor(guild, data) {
|
||||
super(guild.client, data, false);
|
||||
constructor(guild, data, client) {
|
||||
super(guild?.client ?? client, data, false);
|
||||
|
||||
/**
|
||||
* The guild the channel is in
|
||||
@@ -34,6 +35,12 @@ class GuildChannel extends Channel {
|
||||
*/
|
||||
this.guild = guild;
|
||||
|
||||
/**
|
||||
* The id of the guild the channel is in
|
||||
* @type {Snowflake}
|
||||
*/
|
||||
this.guildId = guild?.id ?? data.guild_id;
|
||||
|
||||
this.parentId = this.parentId ?? null;
|
||||
/**
|
||||
* A manager of permission overwrites that belong to this channel
|
||||
@@ -63,6 +70,10 @@ class GuildChannel extends Channel {
|
||||
this.rawPosition = data.position;
|
||||
}
|
||||
|
||||
if ('guild_id' in data) {
|
||||
this.guildId = data.guild_id;
|
||||
}
|
||||
|
||||
if ('parent_id' in data) {
|
||||
/**
|
||||
* The id of the category parent of this channel
|
||||
|
||||
Reference in New Issue
Block a user