mirror of
https://github.com/danbulant/discord.js
synced 2026-05-27 22:11:53 +00:00
* Cleanup Part 2: Electric Boogaloo (Reloaded) * Moar cleanup * Tweak NOT_A_PERMISSION error
19 lines
579 B
JavaScript
19 lines
579 B
JavaScript
const AbstractHandler = require('./AbstractHandler');
|
|
const Constants = require('../../../../util/Constants');
|
|
|
|
class GuildDeleteHandler extends AbstractHandler {
|
|
handle(packet) {
|
|
const client = this.packetManager.client;
|
|
const data = packet.d;
|
|
const response = client.actions.GuildDelete.handle(data);
|
|
if (response.guild) client.emit(Constants.Events.GUILD_DELETE, response.guild);
|
|
}
|
|
}
|
|
|
|
/**
|
|
* Emitted whenever a Guild is deleted/left.
|
|
* @event Client#guildDelete
|
|
* @param {Guild} guild The guild that was deleted
|
|
*/
|
|
|
|
module.exports = GuildDeleteHandler;
|