mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-13 18:13:29 +01:00
Clean up Actions code (#591)
This commit is contained in:
committed by
Amish Shah
parent
432c5ccc82
commit
59a5862f2d
@@ -12,16 +12,12 @@ class GuildUpdateAction extends Action {
|
||||
|
||||
handle(data) {
|
||||
const client = this.client;
|
||||
const guild = client.guilds.get(data.id);
|
||||
|
||||
const guild = client.guilds.get(data.id);
|
||||
if (guild) {
|
||||
const oldGuild = cloneObject(guild);
|
||||
guild.setup(data);
|
||||
|
||||
if (!oldGuild.equals(data)) {
|
||||
client.emit(Constants.Events.GUILD_UPDATE, oldGuild, guild);
|
||||
}
|
||||
|
||||
if (!oldGuild.equals(data)) client.emit(Constants.Events.GUILD_UPDATE, oldGuild, guild);
|
||||
return {
|
||||
old: oldGuild,
|
||||
updated: guild,
|
||||
|
||||
Reference in New Issue
Block a user