Files
discord.js/src/client/websocket/packets/handlers/ChannelCreate.js
2016-08-20 00:15:09 +01:00

28 lines
613 B
JavaScript

const AbstractHandler = require('./AbstractHandler');
const Constants = require('../../../../util/Constants');
class ChannelCreateHandler extends AbstractHandler {
handle(packet) {
const data = packet.d;
const client = this.packetManager.client;
const response = client.actions.ChannelCreate.handle(data);
if (response.channel) {
client.emit(Constants.Events.CHANNEL_CREATE, response.channel);
}
}
}
/**
* Emitted whenever a Channel is created.
*
* @event Client#channelCreate
* @param {Channel} channel The channel that was created
*/
module.exports = ChannelCreateHandler;