mirror of
https://github.com/danbulant/discord.js
synced 2026-06-08 09:13:22 +00:00
backport: add rejection for Emoji#fetchAuthor if managed
Signed-off-by: Lewdcario <isabellafj97@gmail.com>
This commit is contained in:
parent
96011cf68f
commit
d685e39af4
1 changed files with 1 additions and 0 deletions
|
|
@ -161,6 +161,7 @@ class Emoji {
|
||||||
* @returns {Promise<User>}
|
* @returns {Promise<User>}
|
||||||
*/
|
*/
|
||||||
fetchAuthor() {
|
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)
|
return this.client.rest.makeRequest('get', Constants.Endpoints.Guild(this.guild).Emoji(this.id), true)
|
||||||
.then(emoji => this.client.dataManager.newUser(emoji.user));
|
.then(emoji => this.client.dataManager.newUser(emoji.user));
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue