Skip to content

Commit

Permalink
MessageEmbedAuthor (#619)
Browse files Browse the repository at this point in the history
  • Loading branch information
Snazzah authored and amishshah committed Sep 5, 2016
1 parent dc7b070 commit bd113ee
Showing 1 changed file with 34 additions and 0 deletions.
34 changes: 34 additions & 0 deletions src/structures/MessageEmbed.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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;

0 comments on commit bd113ee

Please sign in to comment.