class CategoryChannel
extends
GuildChannelexport class CategoryChannel extends GuildChannel
Represents a guild category channel on Discord.
readonlyCategoryChannelChildManager children :
A manager of the channels belonging to this category
readonlynumber createdTimestamp :
The timestamp the channel was created at
Inherited from: GuildChannel
readonlyboolean deletable :
Whether the channel is deletable by the client user
Inherited from: GuildChannel
Readonly<ChannelFlagsBitField> flags :
The flags that are applied to the channel. This is only null
in a PartialGroupDMChannel. In all other cases, it is not null
.
Inherited from: GuildChannel
readonlyboolean manageable :
Whether the channel is manageable by the client user
Inherited from: GuildChannel
readonlyCollection<Snowflake, GuildMember> members :
A collection of cached members of this channel, mapped by their ids. Members that can view this channel, if the channel is text-based. Members in the channel, if the channel is voice-based.
Inherited from: GuildChannel
readonlynull parent :
The parent of this channel.
null parentId :
The id of the parent of this channel.
Whether this Channel is a partial This is always false outside of DM channels.
Inherited from: BaseChannel
PermissionOverwriteManager permissionOverwrites :
A manager of permission overwrites that belong to this channel
Inherited from: GuildChannel
If the permissionOverwrites match the parent channel, null if no parent
Inherited from: GuildChannel
ChannelType.GuildCategory type :
The type of the channel
readonlyboolean viewable :
Whether the channel is viewable by the client user
Inherited from: GuildChannel
cloneoptions?: GuildChannelCloneOptions) : Promise<this> (
Clones this channel.
Inherited from: GuildChannel
Deletes this channel.
// Delete the channel
channel.delete('making room for new channels')
.then(console.log)
.catch(console.error);
Inherited from: GuildChannel
editoptions: GuildChannelEditOptions) : Promise<this> (
Edits the channel.
// Edit a channel
channel.edit({ name: 'new-channel' })
.then(console.log)
.catch(console.error);
Inherited from: GuildChannel
equalschannel: GuildChannel) : boolean (
Checks if this channel has the same type, topic, position, name, overwrites, and id as another channel. In most cases, a simple channel.id === channel2.id
will do, and is much faster too.
Inherited from: GuildChannel
isDMBasedthis is PartialGroupDMChannel | DMChannel | PartialDMChannel () :
Indicates whether this channel is DM-based (either a DMChannel or a PartialGroupDMChannel).
Inherited from: BaseChannel
isTextBasedthis is GuildBasedChannel & TextBasedChannel () :
Indicates whether this channel is TextBasedChannels.
Inherited from: GuildChannel
isThreadthis is AnyThreadChannel () :
Indicates whether this channel is a ThreadChannel.
Inherited from: BaseChannel
isThreadOnlythis is ThreadOnlyChannel () :
Indicates whether this channel is thread-only.
Inherited from: BaseChannel
isVoiceBasedthis is VoiceBasedChannel () :
Indicates whether this channel is voice-based.
Inherited from: BaseChannel
lockPermissionsPromise<this> () :
Locks in the permission overwrites from the parent channel.
Inherited from: GuildChannel
permissionsFormemberOrRole: GuildMember | RolecheckAdmin?: boolean) : Readonly<PermissionsBitField> (
Gets the overall set of permissions for a member or role in this channel, taking into account channel overwrites.
Sets a new name for the guild channel.
// Set a new channel name
channel.setName('not_general')
.then(newChannel => console.log(`Channel's new name is ${newChannel.name}`))
.catch(console.error);
Inherited from: GuildChannel
setParentchannel: CategoryChannelResolvableoptions?: SetParentOptions) : Promise<GuildChannel> (
Sets the category parent of this channel. It is not possible to set the parent of a CategoryChannel.
setPositionposition: numberoptions?: SetChannelPositionOptions) : Promise<this> (
Sets a new position for the guild channel.
// Set a new channel position
channel.setPosition(2)
.then(newChannel => console.log(`Channel's new position is ${newChannel.position}`))
.catch(console.error);
Inherited from: GuildChannel
toStringChannelMention () :
When concatenated with a string, this automatically returns the channel's mention instead of the Channel object.
// Logs: Hello from <#123456789012345678>!
console.log(`Hello from ${channel}!`);
Inherited from: GuildChannel