mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-17 03:53:29 +01:00
backport: add rejection for Emoji#fetchAuthor if managed
Signed-off-by: Lewdcario <isabellafj97@gmail.com>
This commit is contained in:
@@ -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));
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user