March 7th 7dfdef46a5 Downgrade to v13
[vi] cảm giác đau khổ
2022-03-24 17:55:32 +07:00

24 lines
638 B
JavaScript

'use strict';
const Action = require('./Action');
const { Events } = require('../../util/Constants');
class ChannelCreateAction extends Action {
handle(data) {
const client = this.client;
const existing = client.channels.cache.has(data.id);
const channel = client.channels._add(data);
if (!existing && channel) {
/**
* Emitted whenever a guild channel is created.
* @event Client#channelCreate
* @param {GuildChannel} channel The channel that was created
*/
client.emit(Events.CHANNEL_CREATE, channel);
}
return { channel };
}
}
module.exports = ChannelCreateAction;