.delete(key)
key: string → boolean
Remove a channel from cache. Does not delete it on the API. Use channel.delete after fetch to delete the channel.
client.channels.delete(key);Class
Channel cache + fetch/send helpers. Extends LimitedCollection (.get(), .set(), .filter(), …). FIFO-evicts (and keeps guild indexes / message caches aligned) at cache.channels.
Extends LimitedCollection
new ChannelManager(client: Client)Clientkey: string → boolean
Remove a channel from cache. Does not delete it on the API. Use channel.delete after fetch to delete the channel.
client.channels.delete(key);channelId: string, options?: { force?: boolean; } → Promise<Channel>
Fetch a channel by ID. The returned Channel has channel.delete and channel.send (send throws if the type is not text-based). Returns the cached channel unless force is set.
const channel = await client.channels.fetch(channelId);
await channel.delete();
await channel.send('hi');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.
await client.channels.fetchMessage(channelId, messageId);channelId: string → Promise<Channel>
Retrieve from cache, otherwise fetch.
await client.channels.resolve(channelId);channelId: string, payload: MessagePrepareInput → Promise<Message>
Send to a channel by ID without resolving it first. Prefer channel.send after fetch when you want the channel object.
await client.channels.send(logChannelId, 'User joined!');