mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-15 19:13:31 +01:00
fix(DirectoryChannel): Type name and handle url (#8023)
This commit is contained in:
@@ -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);
|
||||||
|
|||||||
@@ -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);
|
||||||
/**
|
/**
|
||||||
|
|||||||
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>;
|
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);
|
||||||
|
|||||||
Reference in New Issue
Block a user