GuildChannelsManager

GuildChannelsManager

Manages all channels within a guild.

Constructor

new GuildChannelsManager(client, guild)

Description:
  • Creates a guild channel manager.

Source:
Parameters:
Name Type Description
client Client

The client instance.

guild Guild

The guild that this channel manager belongs to.

Methods

(async, static) fetchChannel(client, guildId, channelId) → {Promise.<(TextChannel|VoiceChannel)>}

Description:
  • Fetches a channel, checking the cache first.

Source:
Parameters:
Name Type Description
client Client

The client instance.

guildId String

The id of the guild the channel belongs to.

channelId String

The id of the channel to fetch.

Throws:
TypeError
Returns:
Type
Promise.<(TextChannel|VoiceChannel)>

(static) getCacheManager(client, guildId) → {GuildChannelsManager}

Description:
  • Returns the cache manager for a guild.

Source:
Parameters:
Name Type Description
client Client

The client instance.

guildId String

The ID of the guild the cache manager belongs to.

Throws:
TypeError
Returns:
Type
GuildChannelsManager

(static) getChannel(client, guildId, channelId) → {VoiceChannel|TextChannel|Thread|CategoryChannel}

Description:
  • Returns the channel for a guild.

Source:
Parameters:
Name Type Description
client Client

The client instance.

guildId String

The ID of the guild to get the channel from.

channelId String

The ID of the channel to get.

Returns:
Type
VoiceChannel | TextChannel | Thread | CategoryChannel

(async) fetch(channel_id) → {Promise.<VoiceChannel>|Promise.<Thread>|Promise.<TextChannel>}

Description:
  • Fetches a particular channel belonging to this guild.

Source:
Parameters:
Name Type Description
channel_id String

The id of the channel to fetch.

Throws:
TypeError | Error
Returns:

The fetched channel.

Type
Promise.<VoiceChannel> | Promise.<Thread> | Promise.<TextChannel>

set(id, channel) → {VoiceChannel|TextChannel|Thread|Channel|CategoryChannel}

Description:
  • Adds a channel to the cache.

Source:
Parameters:
Name Type Description
id String

The ID of the channel to cache.

channel VoiceChannel | TextChannel | Thread | Channel | CategoryChannel

The channel to cache.

Throws:
TypeError
Returns:
Type
VoiceChannel | TextChannel | Thread | Channel | CategoryChannel