buddy

node MVC discord bot
Log | Files | Refs | README

CategoryChannel.js (1015B)


      1 'use strict';
      2 
      3 const GuildChannel = require('./GuildChannel');
      4 
      5 /**
      6  * Represents a guild category channel on Discord.
      7  * @extends {GuildChannel}
      8  */
      9 class CategoryChannel extends GuildChannel {
     10   /**
     11    * Channels that are a part of this category
     12    * @type {?Collection<Snowflake, GuildChannel>}
     13    * @readonly
     14    */
     15   get children() {
     16     return this.guild.channels.cache.filter(c => c.parentID === this.id);
     17   }
     18 
     19   /**
     20    * Sets the category parent of this channel.
     21    * <warn>It is not currently possible to set the parent of a CategoryChannel.</warn>
     22    * @method setParent
     23    * @memberof CategoryChannel
     24    * @instance
     25    * @param {?GuildChannel|Snowflake} channel Parent channel
     26    * @param {Object} [options={}] Options to pass
     27    * @param {boolean} [options.lockPermissions=true] Lock the permissions to what the parent's permissions are
     28    * @param {string} [options.reason] Reason for modifying the parent of this channel
     29    * @returns {Promise<GuildChannel>}
     30    */
     31 }
     32 
     33 module.exports = CategoryChannel;