refactor: make use of destructuring for Constants (#1942)

This commit is contained in:
SpaceEEC
2017-09-16 20:31:36 +02:00
committed by Crawl
parent 25ece1882b
commit ec4c98704f
66 changed files with 262 additions and 262 deletions

View File

@@ -1,5 +1,5 @@
const Action = require('./Action');
const Constants = require('../../util/Constants');
const { Events } = require('../../util/Constants');
class GuildDeleteAction extends Action {
constructor(client) {
@@ -19,7 +19,7 @@ class GuildDeleteAction extends Action {
if (guild.available && data.unavailable) {
// Guild is unavailable
guild.available = false;
client.emit(Constants.Events.GUILD_UNAVAILABLE, guild);
client.emit(Events.GUILD_UNAVAILABLE, guild);
// Stops the GuildDelete packet thinking a guild was actually deleted,
// handles emitting of event itself
@@ -30,7 +30,7 @@ class GuildDeleteAction extends Action {
// Delete guild
client.guilds.remove(guild.id);
client.emit(Constants.Events.GUILD_DELETE, guild);
client.emit(Events.GUILD_DELETE, guild);
this.deleted.set(guild.id, guild);
this.scheduleForDeletion(guild.id);
} else {