From 967f11327e19e3ee12a3a7838ccfc2e83021c8b5 Mon Sep 17 00:00:00 2001
From: Jiralite <33201955+Jiralite@users.noreply.github.com>
Date: Tue, 4 Apr 2023 13:17:44 +0100
Subject: [PATCH] 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 fb06027cefd3..4a60749fb9f5 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;