mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-09 16:13:31 +01:00
refactor: improve the accuracy of docs/improve docs (#4845)
Co-authored-by: Noel <icrawltogo@gmail.com>
This commit is contained in:
@@ -29,37 +29,37 @@ class MessageEmbed {
|
||||
* * `link` - a link embed
|
||||
* @type {string}
|
||||
*/
|
||||
this.type = data.type;
|
||||
this.type = data.type || 'rich';
|
||||
|
||||
/**
|
||||
* The title of this embed
|
||||
* @type {?string}
|
||||
*/
|
||||
this.title = data.title;
|
||||
this.title = 'title' in data ? data.title : null;
|
||||
|
||||
/**
|
||||
* The description of this embed
|
||||
* @type {?string}
|
||||
*/
|
||||
this.description = data.description;
|
||||
this.description = 'description' in data ? data.description : null;
|
||||
|
||||
/**
|
||||
* The URL of this embed
|
||||
* @type {?string}
|
||||
*/
|
||||
this.url = data.url;
|
||||
this.url = 'url' in data ? data.url : null;
|
||||
|
||||
/**
|
||||
* The color of this embed
|
||||
* @type {?number}
|
||||
*/
|
||||
this.color = Util.resolveColor(data.color);
|
||||
this.color = 'color' in data ? Util.resolveColor(data.color) : null;
|
||||
|
||||
/**
|
||||
* The timestamp of this embed
|
||||
* @type {?number}
|
||||
*/
|
||||
this.timestamp = data.timestamp ? new Date(data.timestamp).getTime() : null;
|
||||
this.timestamp = 'timestamp' in data ? new Date(data.timestamp).getTime() : null;
|
||||
|
||||
/**
|
||||
* Represents a field of a MessageEmbed
|
||||
@@ -331,7 +331,7 @@ class MessageEmbed {
|
||||
*/
|
||||
setFooter(text, iconURL) {
|
||||
text = Util.resolveString(text);
|
||||
this.footer = { text, iconURL, proxyIconURL: undefined };
|
||||
this.footer = { text, iconURL };
|
||||
return this;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user