<commit_before>const { Command } = require('discord-akairo');

function exec(message, args) {
    if (!args.id) {
        this.client.logger.log(3, 'No message ID provided to see edits.');
        return message.delete();
    }

    const quotee = message.channel.messages.get(args.id);

    if (!quotee) {
        this.client.logger.log(3, 'Your message ID was invalid or the message is not cached.');
        return message.delete();
    }

    const color = this.client.color(message);
    const embed = this.client.util.embed()
    .setColor(color)
    .setAuthor(`${quotee.author.username}#${quotee.author.discriminator}`, quotee.author.displayAvatarURL)
    .setFooter(`${quotee.id} | Edit History`);

    for (const [i, edit] of quotee.edits.entries()) {
        embed.addField(i === 0 ? 'Latest' : i === quotee.edits.length - 1 ? 'Original' : `Edit ${quotee.edits.length - i - 1}`, edit.content);
    }

    return message.edit(message.content.slice(message.content.search(args.id) + args.id.length + 1), { embed });
}

module.exports = new Command('edits', exec, {
    aliases: ['edits'],
    args: [
        {
            id: 'id'
        }
    ],<commit_msg>Add channel change to edits command<commit_after>const { Command } = require('discord-akairo');

function exec(message, args) {
    if (!args.id) {
        this.client.logger.log(3, 'No message ID provided to see edits.');
        return message.delete();
    }

    const quotee = message.channel.messages.get(args.id);

    if (!quotee) {
        this.client.logger.log(3, 'Your message ID was invalid or the message is not cached.');
        return message.delete();
    }

    const color = this.client.color(message);
    const embed = this.client.util.embed()
    .setColor(color)
    .setAuthor(`${quotee.author.username}#${quotee.author.discriminator}`, quotee.author.displayAvatarURL)
    .setFooter(`${quotee.id} | Edit History`);

    for (const [i, edit] of quotee.edits.entries()) {
        embed.addField(i === 0 ? 'Latest' : i === quotee.edits.length - 1 ? 'Original' : `Edit ${quotee.edits.length - i - 1}`, edit.content);
    }

    return message.edit(message.content.slice(message.content.search(args.id) + args.id.length + 1), { embed });
}

module.exports = new Command('edits', exec, {
    aliases: ['edits'],
    args: [
        {
            id: 'id'
        },
        {
            id: 'channel',
            type: function type(word) {
                if (!word) return null;
                const channel = this.client.channels.get(word);
                if (!channel || channel.type === 'voice') return null;
                return channel;
            },
            match: 'prefix',
            prefix: 'channel:',
            default: m => m.channel
        }
    ],
{'fraction_non_alphanumeric': 0.1590169859053126, 'fraction_numerical': 0.0043368268883267076, 'mean_word_length': 2.43424317617866, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 4, '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': '228825', 'n_tokens_mistral': 878, 'n_tokens_neox': 861, 'n_words': 194}