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
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 22 additions and 2 deletions

View file

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

View file

@ -7,6 +7,22 @@ const { Channel } = require('./Channel');
* @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) {
super._patch(data);
/**

View file

@ -2269,7 +2269,11 @@ export class StageChannel extends BaseGuildVoiceChannel {
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 {
private constructor(client: Client, data: RawStageInstanceData, channel: StageChannel);