mirror of
https://github.com/discordjs/discord.js.git
synced 2026-06-04 18:10:08 +00:00
28 lines
613 B
JavaScript
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;
|