mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-09 16:13:31 +01:00
Fix some documentation about the category channels (#1917)
* Document CategoryChannel * More fixes * Sorry Crawl * createChannel can return CategoryChannel * Did senks requests * I can't grammar * Other snek request
This commit is contained in:
@@ -1,6 +1,15 @@
|
||||
const GuildChannel = require('./GuildChannel');
|
||||
|
||||
/**
|
||||
* Represents a guild category channel on Discord.
|
||||
* @extends {GuildChannel}
|
||||
*/
|
||||
class CategoryChannel extends GuildChannel {
|
||||
/**
|
||||
* The channels that are part of this category
|
||||
* @type {?Collection}
|
||||
* @readonly
|
||||
*/
|
||||
get children() {
|
||||
return this.guild.channels.filter(c => c.parentID === this.id);
|
||||
}
|
||||
|
||||
@@ -895,7 +895,7 @@ class Guild extends Base {
|
||||
* @param {Object} [options] Options
|
||||
* @param {Array<PermissionOverwrites|ChannelCreationOverwrites>} [options.overwrites] Permission overwrites
|
||||
* @param {string} [options.reason] Reason for creating this channel
|
||||
* @returns {Promise<TextChannel|VoiceChannel>}
|
||||
* @returns {Promise<GuildChannel>}
|
||||
* @example
|
||||
* // Create a new text channel
|
||||
* guild.createChannel('new-general', 'text')
|
||||
|
||||
@@ -9,7 +9,7 @@ const Constants = require('../util/Constants');
|
||||
const { TypeError } = require('../errors');
|
||||
|
||||
/**
|
||||
* Represents a guild channel (i.e. text channels and voice channels).
|
||||
* Represents a guild channel (e.g. text channels and voice channels).
|
||||
* @extends {Channel}
|
||||
*/
|
||||
class GuildChannel extends Channel {
|
||||
@@ -58,7 +58,8 @@ class GuildChannel extends Channel {
|
||||
|
||||
/**
|
||||
* The category parent of this channel
|
||||
* @type {?GuildChannel}
|
||||
* @type {?CategoryChannel}
|
||||
* @readonly
|
||||
*/
|
||||
get parent() {
|
||||
return this.guild.channels.get(this.parentID);
|
||||
@@ -232,6 +233,8 @@ class GuildChannel extends Channel {
|
||||
* @property {string} [topic] The topic of the text channel
|
||||
* @property {number} [bitrate] The bitrate of the voice channel
|
||||
* @property {number} [userLimit] The user limit of the voice channel
|
||||
* @property {Snowflake} [parentID] The parent ID of the channel
|
||||
* @property {boolean} [lockPermissions] Lock the permissions of the channel to what the parent's permissions are
|
||||
*/
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user