mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-10 16:43:31 +01:00
Fix emoji events (fixes #1333)
This commit is contained in:
@@ -121,13 +121,6 @@ class Guild {
|
||||
*/
|
||||
this.applicationID = data.application_id;
|
||||
|
||||
/**
|
||||
* A collection of emojis that are in this guild. The key is the emoji's ID, the value is the emoji.
|
||||
* @type {Collection<Snowflake, Emoji>}
|
||||
*/
|
||||
this.emojis = new Collection();
|
||||
for (const emoji of data.emojis) this.emojis.set(emoji.id, new Emoji(this, emoji));
|
||||
|
||||
/**
|
||||
* The time in seconds before a user is counted as "away from keyboard".
|
||||
* @type {?number}
|
||||
@@ -216,6 +209,20 @@ class Guild {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!this.emojis) {
|
||||
/**
|
||||
* A collection of emojis that are in this guild. The key is the emoji's ID, the value is the emoji.
|
||||
* @type {Collection<Snowflake, Emoji>}
|
||||
*/
|
||||
this.emojis = new Collection();
|
||||
for (const emoji of data.emojis) this.emojis.set(emoji.id, new Emoji(this, emoji));
|
||||
} else {
|
||||
this.client.actions.GuildEmojisUpdate.handle({
|
||||
guild_id: this.id,
|
||||
emojis: data.emojis,
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user