diff --git a/src/errors/Messages.js b/src/errors/Messages.js index 4e362635f..6905cbbc5 100644 --- a/src/errors/Messages.js +++ b/src/errors/Messages.js @@ -94,6 +94,7 @@ const Messages = { WEBHOOK_MESSAGE: 'The message was not sent by a webhook.', EMOJI_TYPE: 'Emoji must be a string or GuildEmoji/ReactionEmoji', + EMOJI_MANAGED: 'Emoji is managed and has no Author.', REACTION_RESOLVE_USER: 'Couldn\'t resolve the user ID to remove from the reaction.', }; diff --git a/src/structures/GuildEmoji.js b/src/structures/GuildEmoji.js index e8027ab1c..4811f207e 100644 --- a/src/structures/GuildEmoji.js +++ b/src/structures/GuildEmoji.js @@ -1,5 +1,6 @@ const GuildEmojiRoleStore = require('../stores/GuildEmojiRoleStore'); const Permissions = require('../util/Permissions'); +const { Error } = require('../errors'); const Snowflake = require('../util/Snowflake'); const Emoji = require('./Emoji'); @@ -87,6 +88,9 @@ class GuildEmoji extends Emoji { * @returns {Promise} */ fetchAuthor() { + if (this.managed) { + return Promise.reject(new Error('EMOJI_MANAGED')); + } return this.client.api.guilds(this.guild.id).emojis(this.id).get() .then(emoji => this.client.users.add(emoji.user)); }