<commit_before>module.exports = Cmds.addCommand({
    cmds: [';mutes ', ';usermutes ', ';history ', ';userhistory '],

    requires: {
        guild: true,
        loud: false,
    },

    desc: 'Get the mute history of a user',

    args: '([@user] | [id] | [name])',

    example: 'vae',

    // /////////////////////////////////////////////////////////////////////////////////////////

    func: async (cmd, args, msgObj, speaker, channel, guild) => {
        const data = Util.getDataFromString(args, [
            function (str) {
                return Util.getMemberByMixed(str, guild);
            },
        ], false);
        if (!data) return Util.commandFailed(channel, speaker, 'User not found');

        const member = data[0];

        const pastMutes = await Data.getRecords(guild, 'mutes', { user_id: member.id });

        const sendEmbedFields = [];

        for (let i = 0; i < pastMutes.length; i++) {
            const row = pastMutes[i];

            const muteDate = new Date(row.start_tick);
            const muteLength = row.end_tick - row.start_tick;
            const moderatorId = row.mod_id;
            const active = row.active;

            const reason = row.mute_reason;
            const muteDateStr = Util.getDateString(muteDate);
            const muteLengthStr = Util.formatTime(muteLength);<commit_msg>Fixed active data<commit_after>module.exports = Cmds.addCommand({
    cmds: [';mutes ', ';usermutes ', ';history ', ';userhistory '],

    requires: {
        guild: true,
        loud: false,
    },

    desc: 'Get the mute history of a user',

    args: '([@user] | [id] | [name])',

    example: 'vae',

    // /////////////////////////////////////////////////////////////////////////////////////////

    func: async (cmd, args, msgObj, speaker, channel, guild) => {
        const data = Util.getDataFromString(args, [
            function (str) {
                return Util.getMemberByMixed(str, guild);
            },
        ], false);
        if (!data) return Util.commandFailed(channel, speaker, 'User not found');

        const member = data[0];

        const pastMutes = await Data.getRecords(guild, 'mutes', { user_id: member.id });

        const sendEmbedFields = [];

        for (let i = 0; i < pastMutes.length; i++) {
            const row = pastMutes[i];

            const muteDate = new Date(row.start_tick);
            const muteLength = row.end_tick - row.start_tick;
            const moderatorId = row.mod_id;
            const active = Data.fromBuffer(row.active) == 1;

            const reason = row.mute_reason;
            const muteDateStr = Util.getDateString(muteDate);
            const muteLengthStr = Util.formatTime(muteLength);
{'fraction_non_alphanumeric': 0.1890198968312454, 'fraction_numerical': 0.0018422991893883567, 'mean_word_length': 1.7479757085020242, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '7361735', 'n_tokens_mistral': 800, 'n_tokens_neox': 752, 'n_words': 194}