fix(DirectoryChannel): Type name and handle url (#8023)

This commit is contained in:
Jiralite
2022-06-06 14:47:13 +01:00
committed by GitHub
parent fba9710fc9
commit 86d8fbc023
3 changed files with 22 additions and 2 deletions

View File

@@ -193,7 +193,7 @@ class Channel extends Base {
break; break;
} }
case ChannelType.GuildDirectory: case ChannelType.GuildDirectory:
channel = new DirectoryChannel(client, data); channel = new DirectoryChannel(guild, data, client);
break; break;
} }
if (channel && !allowUnknownGuild) guild.channels?.cache.set(channel.id, channel); if (channel && !allowUnknownGuild) guild.channels?.cache.set(channel.id, channel);

View File

@@ -7,6 +7,22 @@ const { Channel } = require('./Channel');
* @extends {Channel} * @extends {Channel}
*/ */
class DirectoryChannel extends Channel { class DirectoryChannel extends Channel {
constructor(guild, data, client) {
super(client, data);
/**
* The guild the channel is in
* @type {InviteGuild}
*/
this.guild = guild;
/**
* The id of the guild the channel is in
* @type {Snowflake}
*/
this.guildId = guild.id;
}
_patch(data) { _patch(data) {
super._patch(data); super._patch(data);
/** /**

View File

@@ -2269,7 +2269,11 @@ export class StageChannel extends BaseGuildVoiceChannel {
public setTopic(topic: string): Promise<StageChannel>; public setTopic(topic: string): Promise<StageChannel>;
} }
export class DirectoryChannel extends Channel {} export class DirectoryChannel extends Channel {
public guild: InviteGuild;
public guildId: Snowflake;
public name: string;
}
export class StageInstance extends Base { export class StageInstance extends Base {
private constructor(client: Client, data: RawStageInstanceData, channel: StageChannel); private constructor(client: Client, data: RawStageInstanceData, channel: StageChannel);