CategoryChannel

export class CategoryChannel extends GuildChannel
export class CategoryChannel extends GuildChannel
Represents a guild category channel on Discord.
A manager of the channels belonging to this category
Readonly
client:Client<true>
The client that instantiated this
Inherited from Base
Readonly
createdAt:Date
The time the channel was created at
Inherited from GuildChannel
Readonly
createdTimestamp:number
The timestamp the channel was created at
Inherited from GuildChannel
Readonly
deletable:boolean
Whether the channel is deletable by the client user
Inherited from GuildChannel
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
guild:Guild
The guild the channel is in
Inherited from GuildChannel
guildId:Snowflake
The id of the guild the channel is in
Inherited from GuildChannel
The channel's id
Inherited from BaseChannel
Readonly
manageable:boolean
Whether the channel is manageable by the client user
Inherited from GuildChannel
Readonly
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
name:string
The name of the guild channel
Inherited from GuildChannel
Readonly
parent:null
The parent of this channel.
parentId:null
The id of the parent of this channel.
Readonly
partial:false
Whether this Channel is a partial This is always false outside of DM channels.
Inherited from BaseChannel
permissionOverwrites:PermissionOverwriteManager
A manager of permission overwrites that belong to this channel
Inherited from GuildChannel
Readonly
permissionsLocked:boolean | null
If the permissionOverwrites match the parent channel, null if no parent
Inherited from GuildChannel
Readonly
position:number
The position of the channel
Inherited from GuildChannel
rawPosition:number
The raw position of the channel from Discord
Inherited from GuildChannel
The type of the channel
Readonly
url:string
The URL to the channel
Inherited from BaseChannel
Readonly
viewable:boolean
Whether the channel is viewable by the client user
Inherited from GuildChannel
clone(options?):Promise<this>
Clones this channel.
NameTypeOptionalDescription
optionsGuildChannelCloneOptionsYesThe options for cloning this channel
Inherited from GuildChannel
delete(reason?):Promise<this>
Deletes this channel.
Example
// Delete the channel
channel.delete('making room for new channels')
.then(console.log)
.catch(console.error);
// Delete the channel
channel.delete('making room for new channels')
.then(console.log)
.catch(console.error);
NameTypeOptionalDescription
reasonstringYesReason for deleting this channel
Inherited from GuildChannel
edit(options):Promise<this>
Edits the channel.
Example
// Edit a channel
channel.edit({ name: 'new-channel' })
.then(console.log)
.catch(console.error);
// Edit a channel
channel.edit({ name: 'new-channel' })
.then(console.log)
.catch(console.error);
NameTypeOptionalDescription
optionsGuildChannelEditOptionsNoThe options to provide
Inherited from GuildChannel
equals(channel):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.
NameTypeOptionalDescription
channelGuildChannelNoChannel to compare with
Inherited from GuildChannel
fetch(force?):Promise<this>
Fetches this channel.
NameTypeOptionalDescription
forcebooleanYesWhether to skip the cache check and request the API
Inherited from BaseChannel
Indicates whether this channel is DM-based (either a or a PartialGroupDMChannel).
Inherited from BaseChannel
isSendable():this is SendableChannels
Indicates whether this channel is sendable.
Inherited from BaseChannel
isTextBased():this is GuildBasedChannel & TextBasedChannel
Indicates whether this channel is text-based.
Inherited from GuildChannel
isThread():this is AnyThreadChannel
Indicates whether this channel is a .
Inherited from BaseChannel
isThreadOnly():this is ThreadOnlyChannel
Indicates whether this channel is .
Inherited from BaseChannel
isVoiceBased():this is VoiceBasedChannel
Indicates whether this channel is .
Inherited from BaseChannel
lockPermissions():Promise<this>
Locks in the permission overwrites from the parent channel.
Inherited from GuildChannel
permissionsFor(memberOrRole, checkAdmin?):Readonly<PermissionsBitField>
Gets the overall set of permissions for a member or role in this channel, taking into account channel overwrites.
Returns
NameTypeOptionalDescription
memberOrRoleGuildMember | RoleNoThe member or role to obtain the overall permissions for
checkAdminbooleanYesWhether having the PermissionFlagsBits.Administrator permission will return all permissions
setName(name, reason?):Promise<this>
Sets a new name for the guild channel.
Example
// Set a new channel name
channel.setName('not_general')
.then(newChannel => console.log(`Channel's new name is ${newChannel.name}`))
.catch(console.error);
// Set a new channel name
channel.setName('not_general')
.then(newChannel => console.log(`Channel's new name is ${newChannel.name}`))
.catch(console.error);
NameTypeOptionalDescription
namestringNoThe new name for the guild channel
reasonstringYesReason for changing the guild channel's name
Inherited from GuildChannel
setParent(channel, options?):Promise<GuildChannel>
Sets the category parent of this channel. It is not possible to set the parent of a CategoryChannel.
NameTypeOptionalDescription
channelCategoryChannelResolvableNoThe channel to set as parent
optionsSetParentOptionsYesThe options for setting the parent
setPosition(position, options?):Promise<this>
Sets a new position for the guild channel.
Example
// Set a new channel position
channel.setPosition(2)
.then(newChannel => console.log(`Channel's new position is ${newChannel.position}`))
.catch(console.error);
// Set a new channel position
channel.setPosition(2)
.then(newChannel => console.log(`Channel's new position is ${newChannel.position}`))
.catch(console.error);
NameTypeOptionalDescription
positionnumberNoThe new position for the guild channel
optionsSetChannelPositionOptionsYesOptions for setting position
Inherited from GuildChannel
toJSON(...props):unknown
NameTypeOptionalDescription
...propsRecord<string, boolean | string>[]NoNone
Inherited from Base
toString():ChannelMention
When concatenated with a string, this automatically returns the channel's mention instead of the Channel object.
Example
// Logs: Hello from <#123456789012345678>!
console.log(`Hello from ${channel}!`);
// Logs: Hello from <#123456789012345678>!
console.log(`Hello from ${channel}!`);
Inherited from GuildChannel
valueOf():string