feat(Emoji): add fetchAuthor method

Backported from commit: e0cbf0bb60
PR: #2315
This commit is contained in:
SpaceEEC
2018-05-09 16:20:41 +02:00
parent c0ca73a40c
commit dd7eedbd48

View File

@@ -150,6 +150,15 @@ class Emoji {
return this.edit({ name }, reason);
}
/**
* Fetches the author for this emoji
* @returns {Promise<User>}
*/
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