Class

Channel

Base class for all channel types.

Extends Base

Constructor

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

Properties

NameTypeDescription
clientread-onlyClientThe Client that instantiated this channel.
iconstring | nullChannel icon hash (null for most channel types).
idread-onlystringSnowflake ID of this channel.
lastPinTimestampstring | nullISO8601 timestamp of the last pinned message update.
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.

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

Check if the bot can send messages in this channel.

channel.canSendMessage();

.clearReadState()

→ Promise<void>

Clear the read state for this channel.

await channel.clearReadState();

.isDM()

→ boolean

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

channel.isDM();

.isPersonalNotes()

→ boolean

Check if this is a personal notes channel.

channel.isPersonalNotes();

.isTextBased()

→ boolean

Check if this channel supports sending messages (text/DM).

channel.isTextBased();

.isVoice()

→ boolean

Check if this is a voice channel.

channel.isVoice();

.sendTyping()

→ Promise<void>

Trigger the typing indicator in this channel.

await channel.sendTyping();