mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-11 17:13:31 +01:00
ESLint stuff...
This commit is contained in:
@@ -1,38 +1,25 @@
|
||||
'use strict';
|
||||
|
||||
const AbstractHandler = require('./AbstractHandler');
|
||||
const Structure = name => require(`../../../../structures/${name}`);
|
||||
|
||||
const ClientUser = Structure('ClientUser');
|
||||
const Guild = Structure('Guild');
|
||||
|
||||
const Constants = require('../../../../util/Constants');
|
||||
|
||||
class GuildCreateHandler extends AbstractHandler {
|
||||
|
||||
constructor(packetManager) {
|
||||
super(packetManager);
|
||||
}
|
||||
handle(packet) {
|
||||
const data = packet.d;
|
||||
const client = this.packetManager.client;
|
||||
|
||||
handle(packet) {
|
||||
let data = packet.d;
|
||||
let client = this.packetManager.client;
|
||||
const guild = client.store.get('guilds', data.id);
|
||||
|
||||
let guild = client.store.get('guilds', data.id);
|
||||
if (guild) {
|
||||
if (!guild.available && !data.unavailable) {
|
||||
// a newly available guild
|
||||
guild.setup(data);
|
||||
this.packetManager.ws.checkIfReady();
|
||||
}
|
||||
} else {
|
||||
// a new guild
|
||||
client.store.newGuild(data);
|
||||
}
|
||||
}
|
||||
|
||||
if (guild) {
|
||||
if (!guild.available && !data.unavailable) {
|
||||
// a newly available guild
|
||||
guild.setup(data);
|
||||
this.packetManager.ws.checkIfReady();
|
||||
}
|
||||
} else {
|
||||
// a new guild
|
||||
client.store.NewGuild(data);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
};
|
||||
}
|
||||
|
||||
module.exports = GuildCreateHandler;
|
||||
|
||||
Reference in New Issue
Block a user