mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-09 16:13:31 +01:00
chore(Threads): general fixup and catch up on features (#5959)
Co-authored-by: Vlad Frangu <kingdgrizzle@gmail.com>
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
const BaseManager = require('./BaseManager');
|
||||
const GuildChannel = require('../structures/GuildChannel');
|
||||
const PermissionOverwrites = require('../structures/PermissionOverwrites');
|
||||
const ThreadChannel = require('../structures/ThreadChannel');
|
||||
const Collection = require('../util/Collection');
|
||||
const { ChannelTypes, ThreadChannelTypes } = require('../util/Constants');
|
||||
|
||||
@@ -36,7 +37,7 @@ class GuildChannelManager extends BaseManager {
|
||||
|
||||
/**
|
||||
* The cache of this Manager
|
||||
* @type {Collection<Snowflake, GuildChannel>}
|
||||
* @type {Collection<Snowflake, GuildChannel|ThreadChannel>}
|
||||
* @name GuildChannelManager#cache
|
||||
*/
|
||||
|
||||
@@ -50,27 +51,30 @@ class GuildChannelManager extends BaseManager {
|
||||
/**
|
||||
* Data that can be resolved to give a Guild Channel object. This can be:
|
||||
* * A GuildChannel object
|
||||
* * A ThreadChannel object
|
||||
* * A Snowflake
|
||||
* @typedef {GuildChannel|Snowflake} GuildChannelResolvable
|
||||
* @typedef {GuildChannel|ThreadChannel|Snowflake} GuildChannelResolvable
|
||||
*/
|
||||
|
||||
/**
|
||||
* Resolves a GuildChannelResolvable to a Channel object.
|
||||
* @method resolve
|
||||
* @memberof GuildChannelManager
|
||||
* @instance
|
||||
* @param {GuildChannelResolvable} channel The GuildChannel resolvable to resolve
|
||||
* @returns {?GuildChannel}
|
||||
* @returns {?(GuildChannel|ThreadChannel)}
|
||||
*/
|
||||
resolve(channel) {
|
||||
if (channel instanceof ThreadChannel) return super.resolve(channel.id);
|
||||
return super.resolve(channel);
|
||||
}
|
||||
|
||||
/**
|
||||
* Resolves a GuildChannelResolvable to a channel ID string.
|
||||
* @method resolveID
|
||||
* @memberof GuildChannelManager
|
||||
* @instance
|
||||
* @param {GuildChannelResolvable} channel The GuildChannel resolvable to resolve
|
||||
* @returns {?Snowflake}
|
||||
*/
|
||||
resolveID(channel) {
|
||||
if (channel instanceof ThreadChannel) return super.resolveID(channel.id);
|
||||
return super.resolveID(channel);
|
||||
}
|
||||
|
||||
/**
|
||||
* Options used to create a new channel in a guild.
|
||||
|
||||
Reference in New Issue
Block a user