mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-09 16:13:31 +01:00
MessageEmbedAuthor (#619)
This commit is contained in:
@@ -44,6 +44,13 @@ class MessageEmbed {
|
||||
*/
|
||||
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
|
||||
@@ -118,4 +125,31 @@ class MessageEmbedProvider {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Represents a Author for a Message embed
|
||||
*/
|
||||
class MessageEmbedAuthor {
|
||||
constructor(embed, data) {
|
||||
/**
|
||||
* The embed this author is part of
|
||||
* @type {MessageEmbed}
|
||||
*/
|
||||
this.embed = embed;
|
||||
this.setup(data);
|
||||
}
|
||||
|
||||
setup(data) {
|
||||
/**
|
||||
* The name of this author
|
||||
* @type {string}
|
||||
*/
|
||||
this.name = data.name;
|
||||
/**
|
||||
* The URL of this author
|
||||
* @type {string}
|
||||
*/
|
||||
this.url = data.url;
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = MessageEmbed;
|
||||
|
||||
Reference in New Issue
Block a user