ChannelManager

export class ChannelManager extends CachedManager<Snowflake, Channel, ChannelResolvable>
export class ChannelManager extends CachedManager<Snowflake, Channel, ChannelResolvable>
A manager of channels belonging to a client
Readonly
cache:Collection<Key, Holds>
The cache of items for this manager.
Inherited from DataManager
Readonly
client:Client
The client that instantiated this Manager
Inherited from BaseManager
Readonly
holds:Constructable<Holds>
The data structure belonging to this manager.
Inherited from DataManager
fetch(id, options?):Promise<Channel | null>
Obtains a channel from Discord, or the channel cache if it's already available.
Example
// Fetch a channel by its id
client.channels.fetch('222109930545610754')
.then(channel => console.log(channel.name))
.catch(console.error);
// Fetch a channel by its id
client.channels.fetch('222109930545610754')
.then(channel => console.log(channel.name))
.catch(console.error);
NameTypeOptionalDescription
idSnowflakeNo
The channel's id
optionsFetchChannelOptionsYes
Additional options for this fetch
resolve(channel):BaseChannel
Resolves a ChannelResolvable to a Channel object.
NameTypeOptionalDescription
channelChannelResolvableNo
The channel resolvable to resolve
resolveId(channel):Snowflake
Resolves a ChannelResolvable to a channel id string.
NameTypeOptionalDescription
channelChannelResolvableNo
The channel resolvable to resolve
valueOf():Collection<Key, Holds>