Skip to content

types(CategoryChannel): Ensure parent and parentId are null #9327

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Apr 13, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 14 additions & 1 deletion packages/discord.js/src/structures/CategoryChannel.js
Original file line number Diff line number Diff line change
Expand Up @@ -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.
* <warn>It is not currently possible to set the parent of a CategoryChannel.</warn>
* <warn>It is not possible to set the parent of a CategoryChannel.</warn>
* @method setParent
* @memberof CategoryChannel
* @instance
Expand Down
2 changes: 2 additions & 0 deletions packages/discord.js/typings/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down