Docs cleanup

This commit is contained in:
iCrawl
2017-08-17 20:04:01 +02:00
parent 5ce0def9d0
commit 2aa2f73c74
40 changed files with 366 additions and 359 deletions

View File

@@ -57,7 +57,7 @@ class MessageEmbed {
this.fields = data.fields || [];
/**
* The thumbnail of this embed, if there is one
* The thumbnail of this embed (if there is one)
* @type {?Object}
* @property {string} url URL for this thumbnail
* @property {string} proxyURL ProxyURL for this thumbnail
@@ -87,7 +87,7 @@ class MessageEmbed {
} : null;
/**
* The video of this embed, if there is one
* The video of this embed (if there is one)
* @type {?Object}
* @property {string} url URL of this video
* @property {number} height Height of this video
@@ -96,7 +96,7 @@ class MessageEmbed {
this.video = data.video;
/**
* The author of this embed, if there is one
* The author of this embed (if there is one)
* @type {?Object}
* @property {string} name The name of this author
* @property {string} url URL of this author
@@ -111,7 +111,7 @@ class MessageEmbed {
} : null;
/**
* The provider of this embed, if there is one
* The provider of this embed (if there is one)
* @type {?Object}
* @property {string} name The name of this provider
* @property {string} url URL of this provider
@@ -132,14 +132,12 @@ class MessageEmbed {
} : null;
/**
* The files of this embed
* @type {?Object}
* @property {Array<FileOptions|string|Attachment>} files Files to attach
*/
* The files of this embed
* @type {?Object}
* @property {Array<FileOptions|string|Attachment>} files Files to attach
*/
if (data.files) {
for (let file of data.files) {
if (file instanceof Attachment) file = file.file;
}
for (let file of data.files) if (file instanceof Attachment) file = file.file;
} else { data.files = null; }
}
@@ -166,7 +164,7 @@ class MessageEmbed {
* @param {StringResolvable} name The name of the field
* @param {StringResolvable} value The value of the field
* @param {boolean} [inline=false] Set the field to display inline
* @returns {MessageEmbed} This embed
* @returns {MessageEmbed}
*/
addField(name, value, inline = false) {
if (this.fields.length >= 25) throw new RangeError('EMBED_FIELD_COUNT');
@@ -181,7 +179,7 @@ class MessageEmbed {
/**
* Convenience function for `<MessageEmbed>.addField('\u200B', '\u200B', inline)`.
* @param {boolean} [inline=false] Set the field to display inline
* @returns {MessageEmbed} This embed
* @returns {MessageEmbed}
*/
addBlankField(inline = false) {
return this.addField('\u200B', '\u200B', inline);
@@ -191,7 +189,7 @@ class MessageEmbed {
* Sets the file to upload alongside the embed. This file can be accessed via `attachment://fileName.extension` when
* setting an embed image or author/footer icons. Only one file may be attached.
* @param {Array<FileOptions|string|Attachment>} files Files to attach
* @returns {MessageEmbed} This embed
* @returns {MessageEmbed}
*/
attachFiles(files) {
if (this.files) this.files = this.files.concat(files);
@@ -207,7 +205,7 @@ class MessageEmbed {
* @param {StringResolvable} name The name of the author
* @param {string} [iconURL] The icon URL of the author
* @param {string} [url] The URL of the author
* @returns {MessageEmbed} This embed
* @returns {MessageEmbed}
*/
setAuthor(name, iconURL, url) {
this.author = { name: Util.resolveString(name), iconURL, url };
@@ -217,7 +215,7 @@ class MessageEmbed {
/**
* Sets the color of this embed.
* @param {ColorResolvable} color The color of the embed
* @returns {MessageEmbed} This embed
* @returns {MessageEmbed}
*/
setColor(color) {
this.color = Util.resolveColor(color);
@@ -227,7 +225,7 @@ class MessageEmbed {
/**
* Sets the description of this embed.
* @param {StringResolvable} description The description
* @returns {MessageEmbed} This embed
* @returns {MessageEmbed}
*/
setDescription(description) {
description = Util.resolveString(description);
@@ -240,7 +238,7 @@ class MessageEmbed {
* Sets the footer of this embed.
* @param {StringResolvable} text The text of the footer
* @param {string} [iconURL] The icon URL of the footer
* @returns {MessageEmbed} This embed
* @returns {MessageEmbed}
*/
setFooter(text, iconURL) {
text = Util.resolveString(text);
@@ -252,7 +250,7 @@ class MessageEmbed {
/**
* Set the image of this embed.
* @param {string} url The URL of the image
* @returns {MessageEmbed} This embed
* @returns {MessageEmbed}
*/
setImage(url) {
this.image = { url };
@@ -262,7 +260,7 @@ class MessageEmbed {
/**
* Set the thumbnail of this embed.
* @param {string} url The URL of the thumbnail
* @returns {MessageEmbed} This embed
* @returns {MessageEmbed}
*/
setThumbnail(url) {
this.thumbnail = { url };
@@ -272,7 +270,7 @@ class MessageEmbed {
/**
* Sets the timestamp of this embed.
* @param {Date} [timestamp=current date] The timestamp
* @returns {MessageEmbed} This embed
* @returns {MessageEmbed}
*/
setTimestamp(timestamp = new Date()) {
this.timestamp = timestamp.getTime();
@@ -282,7 +280,7 @@ class MessageEmbed {
/**
* Sets the title of this embed.
* @param {StringResolvable} title The title
* @returns {MessageEmbed} This embed
* @returns {MessageEmbed}
*/
setTitle(title) {
title = Util.resolveString(title);
@@ -294,7 +292,7 @@ class MessageEmbed {
/**
* Sets the URL of this embed.
* @param {string} url The URL
* @returns {MessageEmbed} This embed
* @returns {MessageEmbed}
*/
setURL(url) {
this.url = url;