Class

Channel

Base class for all channel types. client.channels.fetch and message.resolveChannel return this type; call delete on it. Text-capable channels (isTextBased) also have send. Narrow with isTextBased / isGuild.

Extends Base

Constructor

new Channel(client: Client, data: APIChannelPartial)
client
Client

Properties

NameTypeDescription
clientread-onlyClientThe Client that instantiated this channel.
createdAtread-onlyDateDate when this channel was created, derived from its snowflake ID.
createdTimestampread-onlynumberUnix timestamp (ms) when this channel was created, derived from its snowflake ID.
iconstring | nullChannel icon hash (null for most channel types).
idread-onlystringSnowflake ID of this channel.
lastPinTimestampstring | nullISO8601 timestamp of the last pinned message update.
messagesread-onlyMessageManagerPer-channel message cache + fetch.
namestring | nullChannel name (null for some channel types).
typeChannelTypeChannel type (text, voice, category, etc.).

Methods

.acknowledgePins()

→ Promise<void>

Mark all pinned messages as read in this channel. Session-token helper; bots usually skip this.

await channel.acknowledgePins();

.bulkDelete(countOrIds)

countOrIds: number | readonly string[] → Promise<string[]>

Delete recent messages or an explicit ID list.

  • bulkDelete(5) — fetch last 5 via MessageManager then delete (1–100)
  • bulkDelete(['id1']) — single DELETE; 2–100 uses bulk-delete route
await channel.bulkDelete(countOrIds);

.canSendMessage()

→ boolean

Whether this channel type can carry messages (does not check permissions).

channel.canSendMessage();

.clearReadState()

→ Promise<void>

Clear the read state for this channel. Session-token helper; bots usually skip this.

await channel.clearReadState();

.delete(options?)

options?: SudoVerificationOptions & { silent?: boolean; deleteMessages?: boolean; reason?: string; } → Promise<void>

Delete this channel (or close it if it is a DM). Guild channels require Manage Channels. silent / deleteMessages are Fluxer query params.

const channel = await client.channels.fetch(channelId);
await channel.delete();

.fetchRtcRegions()

→ Promise<RtcRegionPayload[]>

Fetch available RTC regions for voice channels. User-account only (DefaultUserOnly); bots receive AccessDeniedError. Bots should skip this and join voice with @fluxerjs/voice instead.

await channel.fetchRtcRegions();

.isAnnouncement()

→ boolean

Check if this is a guild announcement channel.

channel.isAnnouncement();

.isCategory()

→ boolean

Check if this is a category channel.

channel.isCategory();

.isDM()

→ boolean

Check if this is a DM, group DM, or personal notes channel.

channel.isDM();

.isForum()

→ boolean

Check if this is a forum channel.

channel.isForum();

.isGuild()

→ boolean

Check if this is a guild channel, including threads, forums, and media channels.

channel.isGuild();

.isMedia()

→ boolean

Check if this is a media channel.

channel.isMedia();

.isPersonalNotes()

→ boolean

Check if this is a personal notes channel.

channel.isPersonalNotes();

.isText()

→ boolean

Check if this is a guild text channel.

channel.isText();

.isTextBased()

→ boolean

Whether this channel type can carry messages (text, announcement, voice, threads, DM, group DM, notes). Forum and media channels contain threads and do not accept send. Checks ChannelType, not whether send exists on the instance.

channel.isTextBased();

.isThread()

→ boolean

Check if this is a thread (public, private, or announcement).

channel.isThread();

.isVoice()

→ boolean

Check if this is a voice channel.

channel.isVoice();

.sendTyping()

→ Promise<void>

Trigger the typing indicator in this channel.

await channel.sendTyping();

.toString()

→ string

Channel mention (<#id>).

channel.toString();