Class

ChannelManager

Channel cache + fetch/send helpers. Extends Collection (`.get()`, `.set()`, `.filter()`, …).

Extends Collection

Constructor

new ChannelManager(client: Client)
ParamTypeDescription
clientClient

Properties

maxSize: number (readonly)

Methods

fetch(channelId: string): Promise<Channel>

Fetch a channel by ID (returns cache if present).

ParamTypeDescription
channelIdstring
fetchMessage(channelId: string, messageId: string): Promise<Message>

Fetch a message by channel + message ID (no channel resolve required). Prefer `channel.messages.fetch(messageId)` when you already have a text channel.

ParamTypeDescription
channelIdstring
messageIdstring
resolve(channelId: string): Promise<Channel>

Retrieve from cache, otherwise fetch.

ParamTypeDescription
channelIdstring
send(channelId: string, payload: MessagePrepareInput): Promise<Message>

Send to a channel by ID without resolving it first.

ParamTypeDescription
channelIdstring
payloadMessagePrepareInput
set(key: string, value: Channel): this

Set a channel in the cache (evicts oldest if at capacity).

ParamTypeDescription
keystring
valueChannel