From dd7eedbd48e2925866965826a48dc7f1b01f76ac Mon Sep 17 00:00:00 2001 From: SpaceEEC Date: Wed, 9 May 2018 16:20:41 +0200 Subject: [PATCH] feat(Emoji): add fetchAuthor method Backported from commit: e0cbf0bb607381633fe125c18b86722985ba31ea PR: #2315 --- src/structures/Emoji.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/structures/Emoji.js b/src/structures/Emoji.js index d91734bf4..470122639 100644 --- a/src/structures/Emoji.js +++ b/src/structures/Emoji.js @@ -150,6 +150,15 @@ class Emoji { return this.edit({ name }, reason); } + /** + * Fetches the author for this emoji + * @returns {Promise} + */ + fetchAuthor() { + return this.client.rest.makeRequest('get', Constants.Endpoints.Guild(this.guild).Emoji(this.id), true) + .then(emoji => this.client.dataManager.newUser(emoji.user)); + } + /** * Add a role to the list of roles that can use this emoji. * @param {Role} role The role to add