MessageEmbedAuthor (#619)

This commit is contained in:
Snazzah
2016-09-05 01:22:51 -05:00
committed by Amish Shah
parent dc7b07022c
commit bd113eef06

View File

@@ -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;