mirror of
https://github.com/discordjs/discord.js.git
synced 2024-08-21 18:14:43 +12:00
fix(DirectoryChannel): Type name
and handle url
(#8023)
This commit is contained in:
parent
fba9710fc9
commit
86d8fbc023
3 changed files with 22 additions and 2 deletions
|
@ -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);
|
||||
|
|
|
@ -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);
|
||||
/**
|
||||
|
|
6
packages/discord.js/typings/index.d.ts
vendored
6
packages/discord.js/typings/index.d.ts
vendored
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue