From 8218ffc78d23234b32c05a97fde2f4bea64d7aa6 Mon Sep 17 00:00:00 2001 From: Jiralite <33201955+Jiralite@users.noreply.github.com> Date: Thu, 13 Apr 2023 17:10:53 +0100 Subject: [PATCH] types(CategoryChannel): Ensure `parent` and `parentId` are `null` (#9327) types: ensure categories' parents are `null` --- .../discord.js/src/structures/CategoryChannel.js | 15 ++++++++++++++- packages/discord.js/typings/index.d.ts | 2 ++ 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/packages/discord.js/src/structures/CategoryChannel.js b/packages/discord.js/src/structures/CategoryChannel.js index df3621f4e138..d03804466b2b 100644 --- a/packages/discord.js/src/structures/CategoryChannel.js +++ b/packages/discord.js/src/structures/CategoryChannel.js @@ -8,9 +8,22 @@ const CategoryChannelChildManager = require('../managers/CategoryChannelChildMan * @extends {GuildChannel} */ class CategoryChannel extends GuildChannel { + /** + * The id of the parent of this channel. + * @name CategoryChannel#parentId + * @type {null} + */ + + /** + * The parent of this channel. + * @name CategoryChannel#parent + * @type {null} + * @readonly + */ + /** * Sets the category parent of this channel. - * It is not currently possible to set the parent of a CategoryChannel. + * It is not possible to set the parent of a CategoryChannel. * @method setParent * @memberof CategoryChannel * @instance diff --git a/packages/discord.js/typings/index.d.ts b/packages/discord.js/typings/index.d.ts index c6882f8020b4..5def0d151c20 100644 --- a/packages/discord.js/typings/index.d.ts +++ b/packages/discord.js/typings/index.d.ts @@ -892,6 +892,8 @@ export type CategoryChannelType = Exclude< export class CategoryChannel extends GuildChannel { public get children(): CategoryChannelChildManager; public type: ChannelType.GuildCategory; + public get parent(): null; + public parentId: null; } export type CategoryChannelResolvable = Snowflake | CategoryChannel;