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

@@ -3,12 +3,12 @@ const Collection = require('../util/Collection');
const Snowflake = require('../util/Snowflake');
/**
* Represents a custom emoji
* Represents a custom emoji.
*/
class Emoji {
constructor(guild, data) {
/**
* The Client that instantiated this object
* The client that instantiated this object
* @name Emoji#client
* @type {Client}
* @readonly
@@ -71,7 +71,7 @@ class Emoji {
}
/**
* A collection of roles this emoji is active for (empty if all), mapped by role ID.
* A collection of roles this emoji is active for (empty if all), mapped by role ID
* @type {Collection<Snowflake, Role>}
* @readonly
*/
@@ -103,18 +103,18 @@ class Emoji {
}
/**
* Data for editing an emoji
* Data for editing an emoji.
* @typedef {Object} EmojiEditData
* @property {string} [name] The name of the emoji
* @property {Collection<Snowflake, Role>|Array<Snowflake|Role>} [roles] Roles to restrict emoji to
*/
/**
* Edits the emoji
* Edits the emoji.
* @param {EmojiEditData} data The new data for the emoji
* @returns {Promise<Emoji>}
* @example
* // edit a emoji
* // Edit a emoji
* emoji.edit({name: 'newemoji'})
* .then(e => console.log(`Edited emoji ${e}`))
* .catch(console.error);
@@ -127,7 +127,7 @@ class Emoji {
* When concatenated with a string, this automatically returns the emoji mention rather than the object.
* @returns {string}
* @example
* // send an emoji:
* // Send an emoji:
* const emoji = guild.emojis.first();
* msg.reply(`Hello! ${emoji}`);
*/
@@ -136,9 +136,9 @@ class Emoji {
}
/**
* Whether this emoji is the same as another one
* @param {Emoji|Object} other the emoji to compare it to
* @returns {boolean} whether the emoji is equal to the given emoji or not
* Whether this emoji is the same as another one.
* @param {Emoji|Object} other The emoji to compare it to
* @returns {boolean} Whether the emoji is equal to the given emoji or not
*/
equals(other) {
if (other instanceof Emoji) {