<commit_before>const Action = require('./Action');
const { Events } = require('../../util/Constants');

class ChannelCreateAction extends Action {
  handle(data) {
    const client = this.client;
    const existing = client.channels.has(data.id);
    const channel = client.channels.add(data);
    if (!existing && channel) {
      client.emit(Events.CHANNEL_CREATE, channel);
    }
    return { channel };
  }
}

module.exports = ChannelCreateAction;
<commit_msg>docs: add documentation for Client#channelCreate (#2967)<commit_after>const Action = require('./Action');
const { Events } = require('../../util/Constants');

class ChannelCreateAction extends Action {
  handle(data) {
    const client = this.client;
    const existing = client.channels.has(data.id);
    const channel = client.channels.add(data);
    if (!existing && channel) {
      client.emit(Events.CHANNEL_CREATE, channel);
    }
    return { channel };
  }
}

/**
 * Emitted whenever a channel is created.
 * @event Client#channelCreate
 * @param {GroupDMChannel|GuildChannel} channel The channel that was created
 */

module.exports = ChannelCreateAction;

{'fraction_non_alphanumeric': 0.13628318584070798, 'fraction_numerical': 0.0035398230088495575, 'mean_word_length': 3.8127659574468087, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4805579', 'n_tokens_mistral': 316, 'n_tokens_neox': 311, 'n_words': 79}