Channel

class Channel

Shared channel data available before narrowing to a concrete channel class. Prefer the discord.is*Channel() guards or a ChannelType comparison before calling methods that only exist on text, voice, forum, or thread channels.

Implements:

Properties

Property

Type

Description

createdAt

Date | null

When this channel was created, decoded from the channel snowflake.

id

string

Channel ID.

type

ChannelType

The type of this channel. Check it to narrow the channel to its subclass.

Methods

async Channel.delete(reason: string) → Promise<void>

Delete this channel.

async Channel.fetch() → Promise<AnyChannel>

Requests the latest channel data from Discord instead of relying on cached state.

Channel.toMention() → string

Returns <#channelId> mention syntax.