mirror of
https://github.com/danbulant/discord.js
synced 2026-06-20 23:21:04 +00:00
fix(GuildEmojiCreate): Prevent double fire from emoji creation (#4863)
This commit is contained in:
parent
a45cc112e5
commit
6261dd65d3
1 changed files with 2 additions and 1 deletions
|
|
@ -5,13 +5,14 @@ const { Events } = require('../../util/Constants');
|
|||
|
||||
class GuildEmojiCreateAction extends Action {
|
||||
handle(guild, createdEmoji) {
|
||||
const already = guild.emojis.cache.has(createdEmoji.id);
|
||||
const emoji = guild.emojis.add(createdEmoji);
|
||||
/**
|
||||
* Emitted whenever a custom emoji is created in a guild.
|
||||
* @event Client#emojiCreate
|
||||
* @param {GuildEmoji} emoji The emoji that was created
|
||||
*/
|
||||
this.client.emit(Events.GUILD_EMOJI_CREATE, emoji);
|
||||
if (!already) this.client.emit(Events.GUILD_EMOJI_CREATE, emoji);
|
||||
return { emoji };
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue