mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-15 11:03:30 +01:00
initial
This commit is contained in:
31
src/client/websocket/packets/handlers/ChannelDelete.js
Normal file
31
src/client/websocket/packets/handlers/ChannelDelete.js
Normal file
@@ -0,0 +1,31 @@
|
||||
'use strict';
|
||||
|
||||
const AbstractHandler = require('./AbstractHandler');
|
||||
const Structure = name => require(`../../../../structures/${name}`);
|
||||
|
||||
const ClientUser = Structure('ClientUser');
|
||||
const Guild = Structure('Guild');
|
||||
const ServerChannel = Structure('ServerChannel');
|
||||
|
||||
const Constants = require('../../../../util/Constants');
|
||||
|
||||
class ChannelDeleteHandler extends AbstractHandler {
|
||||
|
||||
constructor(packetManager) {
|
||||
super(packetManager);
|
||||
}
|
||||
|
||||
handle(packet) {
|
||||
let data = packet.d;
|
||||
let client = this.packetManager.client;
|
||||
|
||||
let channel = client.store.get('channels', data.id);
|
||||
|
||||
if (channel) {
|
||||
client.store.KillChannel(channel);
|
||||
}
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
module.exports = ChannelDeleteHandler;
|
||||
Reference in New Issue
Block a user