Skip to content

Commit 45a17e7

Browse files
authored
fix(Emoji): reject explicit error when MANAGE_EMOJI permissions are missing (#3063)
1 parent 49e8bd9 commit 45a17e7

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/structures/Emoji.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,11 @@ class Emoji {
162162
*/
163163
fetchAuthor() {
164164
if (this.managed) return Promise.reject(new Error('Emoji is managed and has no Author.'));
165+
if (!this.guild.me.permissions.has(Permissions.FLAGS.MANAGE_EMOJIS)) {
166+
return Promise.reject(
167+
new Error(`Client must have Manage Emoji permission in guild ${this.guild} to see emoji authors.`)
168+
);
169+
}
165170
return this.client.rest.makeRequest('get', Constants.Endpoints.Guild(this.guild).Emoji(this.id), true)
166171
.then(emoji => this.client.dataManager.newUser(emoji.user));
167172
}

0 commit comments

Comments
 (0)