GuildChannelManager

export class GuildChannelManager extends CachedManager<Snowflake, GuildBasedChannel, GuildChannelResolvable>
export class GuildChannelManager extends CachedManager<Snowflake, GuildBasedChannel, GuildChannelResolvable>
Manages API methods for GuildChannels and stores their cache.
Readonly
cache:Collection<K, Holds>
The cache of items for this manager.
Inherited from DataManager
Readonly
channelCountWithoutThreads:number
The number of channels in this managers cache excluding thread channels that do not count towards a guild's maximum channels restriction.
Readonly
client:Client
The client that instantiated this Manager
Inherited from BaseManager
guild:Guild
The guild this Manager belongs to
Readonly
holds:Constructable<Holds>
The data structure belonging to this manager.
Inherited from DataManager
addFollower(channel, targetChannel, reason?):Promise<Snowflake>
Adds the target channel to a channel's followers.
Returns
Returns created target webhook id.
NameTypeOptionalDescription
channelNewsChannel | SnowflakeNoThe channel to follow
targetChannelTextChannelResolvableNoThe channel where published announcements will be posted at
reasonstringYesReason for creating the webhook
create(options):Promise<MappedGuildChannelTypes[T]>
Creates a new channel in the guild.
NameTypeOptionalDescription
optionsGuildChannelCreateOptions & { type: T }NoOptions for creating the new channel
createWebhook(options):Promise<Webhook>
Creates a webhook for the channel.
Returns
Returns the created Webhook
NameTypeOptionalDescription
optionsWebhookCreateOptionsNoOptions for creating the webhook
delete(channel, reason?):Promise<void>
Deletes the channel.
NameTypeOptionalDescription
channelGuildChannelResolvableNoThe channel to delete
reasonstringYesReason for deleting this channel
edit(channel, options):Promise<GuildChannel>
Edits the channel.
NameTypeOptionalDescription
channelGuildChannelResolvableNoThe channel to edit
optionsGuildChannelEditOptionsNoOptions for editing the channel
fetch(id, options?):Promise<GuildBasedChannel | null>
Obtains one or more guild channels from Discord, or the channel cache if they're already available.
NameTypeOptionalDescription
idSnowflakeNoThe channel's id
optionsBaseFetchOptionsYesAdditional options for this fetch
fetchActiveThreads(cache?):Promise<FetchedThreads>
Obtains all active thread channels in the guild.
NameTypeOptionalDescription
cachebooleanYesWhether to cache the fetched data
fetchWebhooks(channel):Promise<Collection<Snowflake, Webhook>>
Fetches all webhooks for the channel.
NameTypeOptionalDescription
channelGuildChannelResolvableNoThe channel to fetch webhooks for
resolve(idOrInstance):Holds
Resolves a data entry to a data Object.
Returns
An instance from this Manager
NameTypeOptionalDescription
idOrInstanceHoldsNoThe id or instance of something in this Manager
resolveId(idOrInstance):K
Resolves a data entry to an instance id.
Returns
NameTypeOptionalDescription
idOrInstanceK | HoldsNoThe id or instance of something in this Manager
setPosition(channel, position, options?):Promise<GuildChannel>
Sets a new position for the guild channel.
NameTypeOptionalDescription
channelGuildChannelResolvableNoThe channel to set the position for
positionnumberNoThe new position for the guild channel
optionsSetChannelPositionOptionsYesOptions for setting position
setPositions(channelPositions):Promise<Guild>
Batch-updates the guild's channels' positions. Only one channel's parent can be changed at a time
NameTypeOptionalDescription
channelPositionsreadonly ChannelPosition[]NoChannel positions to update
valueOf():Collection<K, Holds>