Class

Channel

Base class for all channel types.

Extends Base

Constructor

new Channel(client: Client, data: APIChannelPartial)
ParamTypeDescription
clientClient
dataAPIChannelPartial

Properties

client: Client (readonly)

The Client that instantiated this channel.

icon: string | null

Channel icon hash (null for most channel types).

id: string (readonly)

Snowflake ID of this channel.

lastPinTimestamp: string | null

ISO8601 timestamp of the last pinned message update.

name: string | null

Channel name (null for some channel types).

Channel type (text, voice, category, etc.).

Methods

acknowledgePins(): Promise<void>

Mark all pinned messages as read in this channel.

bulkDelete(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

ParamTypeDescription
countOrIdsnumber | readonly string[]
bulkDeleteMyMessages(options?: SudoVerificationOptions): Promise<void>

Delete all messages sent by the bot in this channel (user account feature).

ParamTypeDescription
options?SudoVerificationOptions
canSendMessage(): boolean

Check if the bot can send messages in this channel.

clearReadState(): Promise<void>

Clear the read state for this channel.

completeAttachmentUploads(uploads: AttachmentUploadCompleteItem[]): Promise<AttachmentUploadCompleteResponse>

Complete the attachment upload flow after uploading to the CDN.

ParamTypeDescription
uploadsAttachmentUploadCompleteItem[]
ParamTypeDescription
_cClient
_dAPIChannelPartial
fetchRtcRegions(): Promise<RtcRegionPayload[]>

Fetch available RTC regions for voice channels.

fetchSlowmode(): Promise<ChannelSlowmodePayload>

Fetch slowmode state for this channel.

Wired in `structures/Channel.ts` after subclasses load.

ParamTypeDescription
_cClient
_dAPIChannel | APIChannelPartial
isDM(): boolean

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

isPersonalNotes(): boolean

Check if this is a personal notes channel.

isTextBased(): boolean

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

isVoice(): boolean

Check if this is a voice channel.

requestAttachmentUploads(attachments: AttachmentUploadPlanItem[]): Promise<AttachmentUploadPlanResponse>

Request upload URLs for attachments before sending a message.

ParamTypeDescription
attachmentsAttachmentUploadPlanItem[]
sendTyping(): Promise<void>

Trigger the typing indicator in this channel.

uploadAttachmentsForSend(files: UploadFileForSend[]): Promise<RESTPostAPIMessageUploadedAttachment[]>

Upload files for sending in a message (helper).

ParamTypeDescription
filesUploadFileForSend[]