Downgrade to v13
[vi] cảm giác đau khổ
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
'use strict';
|
||||
|
||||
const GuildChannel = require('./GuildChannel');
|
||||
const CategoryChannelChildManager = require('../managers/CategoryChannelChildManager');
|
||||
|
||||
/**
|
||||
* Represents a guild category channel on Discord.
|
||||
@@ -9,12 +8,12 @@ const CategoryChannelChildManager = require('../managers/CategoryChannelChildMan
|
||||
*/
|
||||
class CategoryChannel extends GuildChannel {
|
||||
/**
|
||||
* A manager of the channels belonging to this category
|
||||
* @type {CategoryChannelChildManager}
|
||||
* Channels that are a part of this category
|
||||
* @type {Collection<Snowflake, GuildChannel>}
|
||||
* @readonly
|
||||
*/
|
||||
get children() {
|
||||
return new CategoryChannelChildManager(this);
|
||||
return this.guild.channels.cache.filter(c => c.parentId === this.id);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -27,6 +26,36 @@ class CategoryChannel extends GuildChannel {
|
||||
* @param {SetParentOptions} [options={}] The options for setting the parent
|
||||
* @returns {Promise<GuildChannel>}
|
||||
*/
|
||||
|
||||
/**
|
||||
* Options for creating a channel using {@link CategoryChannel#createChannel}.
|
||||
* @typedef {Object} CategoryCreateChannelOptions
|
||||
* @property {ChannelType|number} [type='GUILD_TEXT'] The type of the new channel.
|
||||
* @property {string} [topic] The topic for the new channel
|
||||
* @property {boolean} [nsfw] Whether the new channel is NSFW
|
||||
* @property {number} [bitrate] Bitrate of the new channel in bits (only voice)
|
||||
* @property {number} [userLimit] Maximum amount of users allowed in the new channel (only voice)
|
||||
* @property {OverwriteResolvable[]|Collection<Snowflake, OverwriteResolvable>} [permissionOverwrites]
|
||||
* Permission overwrites of the new channel
|
||||
* @property {number} [position] Position of the new channel
|
||||
* @property {number} [rateLimitPerUser] The rate limit per user (slowmode) for the new channel in seconds
|
||||
* @property {string} [rtcRegion] The specific region of the new channel.
|
||||
* @property {string} [reason] Reason for creating the new channel
|
||||
*/
|
||||
|
||||
/**
|
||||
* Creates a new channel within this category.
|
||||
* <info>You cannot create a channel of type `GUILD_CATEGORY` inside a CategoryChannel.</info>
|
||||
* @param {string} name The name of the new channel
|
||||
* @param {CategoryCreateChannelOptions} options Options for creating the new channel
|
||||
* @returns {Promise<GuildChannel>}
|
||||
*/
|
||||
createChannel(name, options) {
|
||||
return this.guild.channels.create(name, {
|
||||
...options,
|
||||
parent: this.id,
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = CategoryChannel;
|
||||
|
||||
Reference in New Issue
Block a user