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:
Frangu Vlad
2017-09-09 21:18:41 +03:00
committed by Crawl
parent c46c092d0d
commit 5b46ae59bd
3 changed files with 15 additions and 3 deletions

View File

@@ -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);
}

View File

@@ -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')

View File

@@ -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
*/
/**