feature: add GuildEmoji#fetchAuthor (#2315)

* Make the base code

* Fxi lint
This commit is contained in:
Frangu Vlad
2018-02-02 21:34:21 +02:00
committed by SpaceEEC
parent bd1bf11ed0
commit e0cbf0bb60

View File

@@ -61,6 +61,15 @@ class GuildEmoji extends Emoji {
return new Date(this.createdTimestamp);
}
/**
* Fetches the author for this emoji
* @returns {Promise<User>}
*/
fetchAuthor() {
return this.client.api.guilds(this.guild.id).emojis(this.id).get()
.then(emoji => this.client.users.add(emoji.user));
}
/**
* Data for editing an emoji.
* @typedef {Object} GuildEmojiEditData