Class: ChannelManager

ChannelManager

A manager of channels belonging to a client

Constructor

new ChannelManager()

Source:

Extends

Members

cache :Collection.<Snowflake, Channel>

The cache of Channels
Type:
Overrides:
Source:

cacheType :Collection

The type of Collection of the Manager
Type:
  • Collection
Overrides:
Source:

(readonly) client :Client

The client that instantiated this Manager
Type:
Overrides:
Source:

(private, readonly) holds :function

The data structure belonging to this manager
Type:
  • function
Overrides:
Source:

Methods

(async) fetch(id, cacheopt, forceopt) → {Promise.<Channel>}

Obtains a channel from Discord, or the channel cache if it's already available.
Parameters:
Name Type Attributes Default Description
id Snowflake ID of the channel
cache boolean <optional>
true Whether to cache the new channel object if it isn't already
force boolean <optional>
false Whether to skip the cache check and request the API
Source:
Returns:
Type
Promise.<Channel>
Example
// Fetch a channel by its id
client.channels.fetch('222109930545610754')
  .then(channel => console.log(channel.name))
  .catch(console.error);

resolve(channel) → {Channel}

Resolves a ChannelResolvable to a Channel object.
Parameters:
Name Type Description
channel ChannelResolvable The channel resolvable to resolve
Overrides:
Source:
Returns:
Type
Channel

resolveID(channel) → {Snowflake}

Resolves a ChannelResolvable to a channel ID string.
Parameters:
Name Type Description
channel ChannelResolvable The channel resolvable to resolve
Overrides:
Source:
Returns:
Type
Snowflake