mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-09 16:13:31 +01:00
Organise structure methods
This commit is contained in:
@@ -3,17 +3,19 @@
|
||||
*/
|
||||
class MessageEmbed {
|
||||
constructor(message, data) {
|
||||
/**
|
||||
* The message this embed is part of
|
||||
* @type {Message}
|
||||
*/
|
||||
this.message = message;
|
||||
/**
|
||||
* The client that instantiated this embed
|
||||
* @type {Client}
|
||||
*/
|
||||
this.client = message.client;
|
||||
Object.defineProperty(this, 'client', { enumerable: false, configurable: false });
|
||||
|
||||
/**
|
||||
* The message this embed is part of
|
||||
* @type {Message}
|
||||
*/
|
||||
this.message = message;
|
||||
|
||||
this.setup(data);
|
||||
}
|
||||
|
||||
@@ -23,42 +25,42 @@ class MessageEmbed {
|
||||
* @type {?string}
|
||||
*/
|
||||
this.title = data.title;
|
||||
|
||||
/**
|
||||
* The type of this embed
|
||||
* @type {string}
|
||||
*/
|
||||
this.type = data.type;
|
||||
|
||||
/**
|
||||
* The description of this embed, if there is one
|
||||
* @type {?string}
|
||||
*/
|
||||
this.description = data.description;
|
||||
|
||||
/**
|
||||
* The URL of this embed
|
||||
* @type {string}
|
||||
*/
|
||||
this.url = data.url;
|
||||
if (data.thumbnail) {
|
||||
/**
|
||||
* The thumbnail of this embed, if there is one
|
||||
* @type {MessageEmbedThumbnail}
|
||||
*/
|
||||
this.thumbnail = new MessageEmbedThumbnail(this, data.thumbnail);
|
||||
}
|
||||
if (data.author) {
|
||||
/**
|
||||
* The author of this embed, if there is one
|
||||
* @type {MessageEmbedAuthor}
|
||||
*/
|
||||
this.author = new MessageEmbedAuthor(this, data.author);
|
||||
}
|
||||
if (data.provider) {
|
||||
/**
|
||||
* The provider of this embed, if there is one
|
||||
* @type {MessageEmbedProvider}
|
||||
*/
|
||||
this.provider = new MessageEmbedProvider(this, data.provider);
|
||||
}
|
||||
|
||||
/**
|
||||
* The thumbnail of this embed, if there is one
|
||||
* @type {MessageEmbedThumbnail}
|
||||
*/
|
||||
this.thumbnail = data.thumbnail ? new MessageEmbedThumbnail(this, data.thumbnail) : null;
|
||||
|
||||
/**
|
||||
* The author of this embed, if there is one
|
||||
* @type {MessageEmbedAuthor}
|
||||
*/
|
||||
this.author = data.author ? new MessageEmbedAuthor(this, data.author) : null;
|
||||
|
||||
/**
|
||||
* The provider of this embed, if there is one
|
||||
* @type {MessageEmbedProvider}
|
||||
*/
|
||||
this.provider = data.provider ? new MessageEmbedProvider(this, data.provider) : null;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -72,6 +74,7 @@ class MessageEmbedThumbnail {
|
||||
* @type {MessageEmbed}
|
||||
*/
|
||||
this.embed = embed;
|
||||
|
||||
this.setup(data);
|
||||
}
|
||||
|
||||
@@ -81,16 +84,19 @@ class MessageEmbedThumbnail {
|
||||
* @type {string}
|
||||
*/
|
||||
this.url = data.url;
|
||||
|
||||
/**
|
||||
* The Proxy URL for this thumbnail
|
||||
* @type {string}
|
||||
*/
|
||||
this.proxyURL = data.proxy_url;
|
||||
|
||||
/**
|
||||
* The height of the thumbnail
|
||||
* @type {number}
|
||||
*/
|
||||
this.height = data.height;
|
||||
|
||||
/**
|
||||
* The width of the thumbnail
|
||||
* @type {number}
|
||||
@@ -109,6 +115,7 @@ class MessageEmbedProvider {
|
||||
* @type {MessageEmbed}
|
||||
*/
|
||||
this.embed = embed;
|
||||
|
||||
this.setup(data);
|
||||
}
|
||||
|
||||
@@ -118,6 +125,7 @@ class MessageEmbedProvider {
|
||||
* @type {string}
|
||||
*/
|
||||
this.name = data.name;
|
||||
|
||||
/**
|
||||
* The URL of this provider
|
||||
* @type {string}
|
||||
@@ -136,6 +144,7 @@ class MessageEmbedAuthor {
|
||||
* @type {MessageEmbed}
|
||||
*/
|
||||
this.embed = embed;
|
||||
|
||||
this.setup(data);
|
||||
}
|
||||
|
||||
@@ -145,6 +154,7 @@ class MessageEmbedAuthor {
|
||||
* @type {string}
|
||||
*/
|
||||
this.name = data.name;
|
||||
|
||||
/**
|
||||
* The URL of this author
|
||||
* @type {string}
|
||||
|
||||
Reference in New Issue
Block a user