Improve docs a bit

This commit is contained in:
Crawl
2017-04-30 04:30:44 +02:00
parent 3f8c0a4d11
commit ac92d2cecc
83 changed files with 716 additions and 711 deletions

View File

@@ -5,7 +5,7 @@ const Permissions = require('../util/Permissions');
const Collection = require('../util/Collection');
/**
* Represents a guild channel (i.e. text channels and voice channels)
* Represents a guild channel (i.e. text channels and voice channels).
* @extends {Channel}
*/
class GuildChannel extends Channel {
@@ -29,13 +29,13 @@ class GuildChannel extends Channel {
this.name = data.name;
/**
* The position of the channel in the list.
* The position of the channel in the list
* @type {number}
*/
this.position = data.position;
/**
* A map of permission overwrites in this channel for roles and users.
* A map of permission overwrites in this channel for roles and users
* @type {Collection<Snowflake, PermissionOverwrites>}
*/
this.permissionOverwrites = new Collection();
@@ -124,7 +124,7 @@ class GuildChannel extends Channel {
}
/**
* An object mapping permission flags to `true` (enabled) or `false` (disabled)
* An object mapping permission flags to `true` (enabled) or `false` (disabled).
* ```js
* {
* 'SEND_MESSAGES': true,
@@ -140,7 +140,7 @@ class GuildChannel extends Channel {
* @param {PermissionOverwriteOptions} options The configuration for the update
* @returns {Promise}
* @example
* // overwrite permissions for a message author
* // Overwrite permissions for a message author
* message.channel.overwritePermissions(message.author, {
* SEND_MESSAGES: false
* })
@@ -190,7 +190,7 @@ class GuildChannel extends Channel {
}
/**
* The data for a guild channel
* The data for a guild channel.
* @typedef {Object} ChannelData
* @property {string} [name] The name of the channel
* @property {number} [position] The position of the channel
@@ -200,11 +200,11 @@ class GuildChannel extends Channel {
*/
/**
* Edits the channel
* Edits the channel.
* @param {ChannelData} data The new data for the channel
* @returns {Promise<GuildChannel>}
* @example
* // edit a channel
* // Edit a channel
* channel.edit({name: 'new-channel'})
* .then(c => console.log(`Edited channel ${c}`))
* .catch(console.error);
@@ -214,11 +214,11 @@ class GuildChannel extends Channel {
}
/**
* Set a new name for the guild channel
* Set a new name for the guild channel.
* @param {string} name The new name for the guild channel
* @returns {Promise<GuildChannel>}
* @example
* // set a new channel name
* // Set a new channel name
* channel.setName('not_general')
* .then(newChannel => console.log(`Channel's new name is ${newChannel.name}`))
* .catch(console.error);
@@ -228,12 +228,12 @@ class GuildChannel extends Channel {
}
/**
* Set a new position for the guild channel
* Set a new position for the guild channel.
* @param {number} position The new position for the guild channel
* @param {boolean} [relative=false] Move the position relative to its current value
* @returns {Promise<GuildChannel>}
* @example
* // set a new channel position
* // Set a new channel position
* channel.setPosition(2)
* .then(newChannel => console.log(`Channel's new position is ${newChannel.position}`))
* .catch(console.error);
@@ -243,11 +243,11 @@ class GuildChannel extends Channel {
}
/**
* Set a new topic for the guild channel
* Set a new topic for the guild channel.
* @param {string} topic The new topic for the guild channel
* @returns {Promise<GuildChannel>}
* @example
* // set a new channel topic
* // Set a new channel topic
* channel.setTopic('needs more rate limiting')
* .then(newChannel => console.log(`Channel's new topic is ${newChannel.topic}`))
* .catch(console.error);
@@ -257,13 +257,13 @@ class GuildChannel extends Channel {
}
/**
* Options given when creating a guild channel invite
* Options given when creating a guild channel invite.
* @typedef {Object} InviteOptions
*/
/**
* Create an invite to this guild channel
* Create an invite to this guild channel.
* @param {InviteOptions} [options={}] Options for the invite
* @param {boolean} [options.temporary=false] Whether members that joined via the invite should be automatically
* kicked after 24 hours if they have not yet received a role
@@ -276,7 +276,7 @@ class GuildChannel extends Channel {
}
/**
* Clone this channel
* Clone this channel.
* @param {string} [name=this.name] Optional name for the new channel, otherwise it has the name of this channel
* @param {boolean} [withPermissions=true] Whether to clone the channel with this channel's permission overwrites
* @param {boolean} [withTopic=true] Whether to clone the channel with this channel's topic
@@ -313,7 +313,7 @@ class GuildChannel extends Channel {
}
/**
* Whether the channel is deletable by the client user.
* Whether the channel is deletable by the client user
* @type {boolean}
* @readonly
*/