From e0cbf0bb607381633fe125c18b86722985ba31ea Mon Sep 17 00:00:00 2001 From: Frangu Vlad Date: Fri, 2 Feb 2018 21:34:21 +0200 Subject: [PATCH] feature: add GuildEmoji#fetchAuthor (#2315) * Make the base code * Fxi lint --- src/structures/GuildEmoji.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/structures/GuildEmoji.js b/src/structures/GuildEmoji.js index df0c1169b..7568738ae 100644 --- a/src/structures/GuildEmoji.js +++ b/src/structures/GuildEmoji.js @@ -61,6 +61,15 @@ class GuildEmoji extends Emoji { return new Date(this.createdTimestamp); } + /** + * Fetches the author for this emoji + * @returns {Promise} + */ + 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