mirror of
https://github.com/danbulant/discord.js
synced 2026-05-25 13:02:38 +00:00
MessageEmbedAuthor (#619)
This commit is contained in:
parent
dc7b07022c
commit
bd113eef06
1 changed files with 34 additions and 0 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Reference in a new issue