backport: add rejection for Emoji#fetchAuthor if managed

Signed-off-by: Lewdcario <isabellafj97@gmail.com>
This commit is contained in:
Lewdcario
2018-07-26 10:24:26 -06:00
parent 96011cf68f
commit d685e39af4

View File

@@ -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));
}