Skip to content

Commit

Permalink
backport: add rejection for Emoji#fetchAuthor if managed
Browse files Browse the repository at this point in the history
Signed-off-by: Lewdcario <isabellafj97@gmail.com>
  • Loading branch information
Lewdcario committed Jul 26, 2018
1 parent 96011cf commit d685e39
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/structures/Emoji.js
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,7 @@ class Emoji {
* @returns {Promise<User>}
*/
fetchAuthor() {
if (this.managed) return Promise.reject(new TypeError('Emoji is managed and has no Author.'));
return this.client.rest.makeRequest('get', Constants.Endpoints.Guild(this.guild).Emoji(this.id), true)
.then(emoji => this.client.dataManager.newUser(emoji.user));
}
Expand Down

0 comments on commit d685e39

Please # to comment.