Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions packages/discord.js/src/errors/ErrorCodes.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@
*
* @property {'EmojiType'} EmojiType
* @property {'EmojiManaged'} EmojiManaged
* @property {'MissingManageGuildExpressionsPermission'} MissingManageGuildExpressionsPermission
* @property {'MissingGuildExpressionsPermission'} MissingGuildExpressionsPermission
*
* @property {'NotGuildSoundboardSound'} NotGuildSoundboardSound
* @property {'NotGuildSticker'} NotGuildSticker
Expand Down Expand Up @@ -217,7 +217,7 @@ const keys = [

'EmojiType',
'EmojiManaged',
'MissingManageGuildExpressionsPermission',
'MissingGuildExpressionsPermission',

'NotGuildSoundboardSound',
'NotGuildSticker',
Expand Down
4 changes: 2 additions & 2 deletions packages/discord.js/src/errors/Messages.js
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,8 @@ const Messages = {

[ErrorCodes.EmojiType]: 'Emoji must be a string or GuildEmoji/ReactionEmoji',
[ErrorCodes.EmojiManaged]: 'Emoji is managed and has no Author.',
[ErrorCodes.MissingManageGuildExpressionsPermission]: guild =>
`Client must have Manage Guild Expressions permission in guild ${guild} to see emoji authors.`,
[ErrorCodes.MissingGuildExpressionsPermission]: guild =>
`Client must have Create Guild Expressions or Manage Guild Expressions permission in guild ${guild} to see emoji authors.`,

[ErrorCodes.NotGuildSoundboardSound]: action =>
`Soundboard sound is a default (non-guild) soundboard sound and can't be ${action}.`,
Expand Down
4 changes: 2 additions & 2 deletions packages/discord.js/src/managers/GuildEmojiManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -251,8 +251,8 @@ class GuildEmojiManager extends CachedManager {

const { me } = this.guild.members;
if (!me) throw new DiscordjsError(ErrorCodes.GuildUncachedMe);
if (!me.permissions.has(PermissionFlagsBits.ManageGuildExpressions)) {
throw new DiscordjsError(ErrorCodes.MissingManageGuildExpressionsPermission, this.guild);
if (!me.permissions.any(PermissionFlagsBits.CreateGuildExpressions | PermissionFlagsBits.ManageGuildExpressions)) {
throw new DiscordjsError(ErrorCodes.MissingGuildExpressionsPermission, this.guild);
}

const data = await this.client.rest.get(Routes.guildEmoji(this.guild.id, resolvedEmoji.id));
Expand Down
2 changes: 1 addition & 1 deletion packages/discord.js/typings/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4051,7 +4051,7 @@ export enum DiscordjsErrorCodes {

EmojiType = 'EmojiType',
EmojiManaged = 'EmojiManaged',
MissingManageGuildExpressionsPermission = 'MissingManageGuildExpressionsPermission',
MissingGuildExpressionsPermission = 'MissingGuildExpressionsPermission',

NotGuildSoundboardSound = 'NotGuildSoundboardSound',
NotGuildSticker = 'NotGuildSticker',
Expand Down