Class

ChannelManager

Channel cache + fetch/send helpers. Extends LimitedCollection (`.get()`, `.set()`, `.filter()`, …). FIFO-evicts (and keeps guild indexes / message caches aligned) at `cache.channels`.

Extends LimitedCollection

Constructor

new ChannelManager(client: Client)
ParamTypeDescription
clientClient

Methods

delete(key: string): boolean
ParamTypeDescription
keystring
fetch(channelId: string, options?: { force?: boolean; }): Promise<Channel>

Fetch a channel by ID. Returns the cached channel unless `force` is set, in which case REST metadata is applied.

ParamTypeDescription
channelIdstring
options?{ force?: boolean; }
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