Skip to content

ChannelManager

classe · Source

A manager of channels belonging to a client

Extends: CachedManager

Properties

cache

cache: Collection<Snowflake, Channel>

The cache of Channels Source

_cache

readonly · private

_cache: Collection

The private cache of items for this manager. Source

holds

readonly · private

holds: function

The data structure belonging to this manager. Source

client

readonly

client: Client

The client that instantiated this Manager Source

Methods

resolve

resolve(channel: ChannelResolvable): Channel

Resolves a ChannelResolvable to a Channel object. Parameters

NameTypeDescription
channelChannelResolvableThe channel resolvable to resolve

Returns: ChannelSource

resolveId

resolveId(channel: ChannelResolvable): Snowflake

Resolves a ChannelResolvable to a channel id string. Parameters

NameTypeDescription
channelChannelResolvableThe channel resolvable to resolve

Returns: SnowflakeSource

fetch

async

async fetch(id: Snowflake, options?: FetchChannelOptions): Promise<?Channel>

Obtains a channel from Discord, or the channel cache if it's already available. Parameters

NameTypeDescription
idSnowflakeThe channel's id
options?FetchChannelOptionsAdditional options for this fetch

Returns: Promise<?Channel>

js
// Fetch a channel by its id
client.channels.fetch('222109930545610754')
  .then(channel => console.log(channel.name))
  .catch(console.error);

Source

createGroupDM

async

async createGroupDM(recipients?: Array<UserResolvable>): Promise<GroupDMChannel>

Create Group DM Parameters

NameTypeDescription
recipients?Array<UserResolvable>Array of recipients Default: [].

Returns: Promise<GroupDMChannel> — Channel

js
client.channels.createGroupDM();

Source

Unofficial software. Not affiliated with or supported by Discord.