<commit_before>const time = require('time-parser'),
    exec = require("child_process").exec;

require('moment-duration-format');

exports.run = async function(msg) {
    if (msg.isMentioned(client.user.id) && msg.content.toLowerCase().includes('prefix')) return msg.channel.send(`My prefix in this guild is \`${prefixdb[msg.guild.id]}\`.`);

    if (!prefixdb[msg.guild.id]) prefixdb[msg.guild.id] = settings.defaultPrefix;

    const cmd = msg.content.toLowerCase().substring(prefixdb[msg.guild.id].length).split(' ')[0];

    if (cmd === 'reboot' || cmd === 'restart') {
        if (msg.author.id !== settings.ownerID) return msg.reply('You do not have permission to use this command.');
        await msg.channel.send('Restarting...')
        await client.destroy();
        process.exit();
    };

    if (cmd === 'invite') return msg.channel.send({
        embed: new Discord.RichEmbed()
            .setColor(settings.embedColor)
            .setDescription('Click [here](https://discordapp.com/oauth2/authorize?permissions=27648&scope=bot&client_id=' + client.user.id + ') to invite me to your server, or click [here](https://discord.gg/Yphr6WG) for an invite to RemindMeBot\'s support server.')
    })

    if (cmd === 'block') { // test write
        if (msg.author.id !== settings.ownerID) return msg.reply('You do not have permission to use this command.');
        if (msg.mentions.users.size === 0) return msg.channel.send('No users mentioned.');
        blocked.push(msg.mentions.users.first().id);
        fs.writeFile('./storage/blocked.json', JSON.stringify(blocked, '', '\t'), (err) => {
            if (err) return false;
            msg.channel.send({
                embed: new Discord.RichEmbed()
                    .setColor(settings.embedColor)
                    .setDescription(`${msg.mentions.users.first().username} successfully blocked`)
            })

        });
    };

    if (cmd === 'unblock') { // test write
        if (msg.author.id !== settings.ownerID) return msg.reply('You do not have permission to use this command.');
        if (msg.mentions.users.size === 0) return msg.channel.send('No users mentioned.');
        blocked.splice(blocked.indexOf(msg.mentions.users.first().id), 1);
        fs.writeFile('./storage/blocked.json', JSON.stringify(blocked, '', '\t'), (err) => {
            if (err) return false;
            msg.channel.send({
                embed: new Discord.RichEmbed()
                    .setColor(settings.embedColor)
                    .setDescription(`${msg.mentions.users.first().username} successfully unblocked`)
            });
        });
    };

    if (cmd === 'stats' || cmd === 'info') {
        let os = require('os'),
            embed = new Discord.RichEmbed()
            .setColor(settings.embedColor)
            .setTitle(`RemindMeBot ${settings.version}`)
            .setURL('https://discordbots.org/bot/290947970457796608')
            .addField('Guilds', client.guilds.size, true)
            .addField('Uptime', moment.duration(process.uptime(), 'seconds').format('dd:hh:mm:ss'), true)
            .addField('Ping', `${(client.ping).toFixed(0)} ms`, true)
            .addField('RAM Usage', `${(process.memoryUsage().rss / 1048576).toFixed()}MB/${(os.totalmem() > 1073741824 ? (os.totalmem() / 1073741824).toFixed(1) + ' GB' : (os.totalmem() / 1048576).toFixed() + ' MB')}
(${(process.memoryUsage().rss / os.totalmem() * 100).toFixed(2)}%)`, true)
            .addField('System Info', `${process.platform} (${process.arch})\n${(os.totalmem() > 1073741824 ? (os.totalmem() / 1073741824).toFixed(1) + ' GB' : (os.totalmem() / 1048576).toFixed(2) + ' MB')}`, true)
            .addField('Libraries', `[Discord.js](https://discord.js.org) v${Discord.version}\nNode.js ${process.version}`, true)
            .addField('Links', '[Bot invite](https://discordapp.com/oauth2/authorize?permissions=27648&scope=bot&client_id=290947970457796608) | [Support server invite](https://discord.gg/Yphr6WG) | [GitHub](https://github.com/Aetheryx/remindme)', true)
            .setFooter('Created by Aetheryx#2222');

        msg.channel.send({
            embed: embed
        });
    };

    if (cmd === 'ping')
        msg.channel.send(`:ping_pong: Pong! ${client.pings[0]}ms`)

    if (cmd === 'ev') {
        if (msg.author.id !== settings.ownerID) return false;
        let script = msg.content.substring(prefixdb[msg.guild.id].length + 3, msg.content.length);
        let silent = script.includes('--silent') ? true : false
        if (silent) script = script.replace('--silent', '')
        try {
            let code = eval(script);
            if (typeof code !== 'string')
                code = require('util').inspect(code, {
                    depth: 0
                });
            code = code.replace(new RegExp(client.token, "gi"), "*");
            if (!silent) msg.channel.sendCode('js', code)
        } catch (e) {
            msg.channel.send('\n`ERROR` ```xl\n' + e + '\n```');
        };
    };

    if (cmd === 'exec') {
        if (msg.author.id !== settings.ownerID) return false;
        let script = msg.content.substring(prefixdb[msg.guild.id].length + 5, msg.content.length);
        exec(script, async(e, stdout, stderr) => {
            if (stdout.length > 2000 || stderr.length > 2000) {
                let res = await sagent.post("https://hastebin.com/documents")
                    .send(stdout + "\n\n" + stderr)
                    .catch(e => msg.channel.send(e.message));
                msg.channel.send({
                    embed: new Discord.RichEmbed()
                        .setColor(settings.embedColor)
                        .setDescription(`Console log exceeds 2000 characters. View [here](https://hastebin.com/${sagent.body.key}).`)
                });
            } else {
                stdout && msg.channel.sendMessage('Info: \n\`\`\`' + stdout + '\`\`\`')
                stderr && msg.channel.sendMessage('Errors: \n\`\`\`' + stderr + '\`\`\`')
                if (!stderr && !stdout) msg.react("\u2611")
            };
        });
    };
<commit_msg>sendCode deprecation fix<commit_after>const time = require('time-parser'),
    exec = require("child_process").exec;

require('moment-duration-format');

exports.run = async function(msg) {
    if (msg.isMentioned(client.user.id) && msg.content.toLowerCase().includes('prefix')) return msg.channel.send(`My prefix in this guild is \`${prefixdb[msg.guild.id]}\`.`);

    if (!prefixdb[msg.guild.id]) prefixdb[msg.guild.id] = settings.defaultPrefix;

    const cmd = msg.content.toLowerCase().substring(prefixdb[msg.guild.id].length).split(' ')[0];

    if (cmd === 'reboot' || cmd === 'restart') {
        if (msg.author.id !== settings.ownerID) return msg.reply('You do not have permission to use this command.');
        await msg.channel.send('Restarting...')
        await client.destroy();
        process.exit();
    };

    if (cmd === 'invite') return msg.channel.send({
        embed: new Discord.RichEmbed()
            .setColor(settings.embedColor)
            .setDescription('Click [here](https://discordapp.com/oauth2/authorize?permissions=27648&scope=bot&client_id=' + client.user.id + ') to invite me to your server, or click [here](https://discord.gg/Yphr6WG) for an invite to RemindMeBot\'s support server.')
    })

    if (cmd === 'block') { // test write
        if (msg.author.id !== settings.ownerID) return msg.reply('You do not have permission to use this command.');
        if (msg.mentions.users.size === 0) return msg.channel.send('No users mentioned.');
        blocked.push(msg.mentions.users.first().id);
        fs.writeFile('./storage/blocked.json', JSON.stringify(blocked, '', '\t'), (err) => {
            if (err) return false;
            msg.channel.send({
                embed: new Discord.RichEmbed()
                    .setColor(settings.embedColor)
                    .setDescription(`${msg.mentions.users.first().username} successfully blocked`)
            })

        });
    };

    if (cmd === 'unblock') { // test write
        if (msg.author.id !== settings.ownerID) return msg.reply('You do not have permission to use this command.');
        if (msg.mentions.users.size === 0) return msg.channel.send('No users mentioned.');
        blocked.splice(blocked.indexOf(msg.mentions.users.first().id), 1);
        fs.writeFile('./storage/blocked.json', JSON.stringify(blocked, '', '\t'), (err) => {
            if (err) return false;
            msg.channel.send({
                embed: new Discord.RichEmbed()
                    .setColor(settings.embedColor)
                    .setDescription(`${msg.mentions.users.first().username} successfully unblocked`)
            });
        });
    };

    if (cmd === 'stats' || cmd === 'info') {
        let os = require('os'),
            embed = new Discord.RichEmbed()
            .setColor(settings.embedColor)
            .setTitle(`RemindMeBot ${settings.version}`)
            .setURL('https://discordbots.org/bot/290947970457796608')
            .addField('Guilds', client.guilds.size, true)
            .addField('Uptime', moment.duration(process.uptime(), 'seconds').format('dd:hh:mm:ss'), true)
            .addField('Ping', `${(client.ping).toFixed(0)} ms`, true)
            .addField('RAM Usage', `${(process.memoryUsage().rss / 1048576).toFixed()}MB/${(os.totalmem() > 1073741824 ? (os.totalmem() / 1073741824).toFixed(1) + ' GB' : (os.totalmem() / 1048576).toFixed() + ' MB')}
(${(process.memoryUsage().rss / os.totalmem() * 100).toFixed(2)}%)`, true)
            .addField('System Info', `${process.platform} (${process.arch})\n${(os.totalmem() > 1073741824 ? (os.totalmem() / 1073741824).toFixed(1) + ' GB' : (os.totalmem() / 1048576).toFixed(2) + ' MB')}`, true)
            .addField('Libraries', `[Discord.js](https://discord.js.org) v${Discord.version}\nNode.js ${process.version}`, true)
            .addField('Links', '[Bot invite](https://discordapp.com/oauth2/authorize?permissions=27648&scope=bot&client_id=290947970457796608) | [Support server invite](https://discord.gg/Yphr6WG) | [GitHub](https://github.com/Aetheryx/remindme)', true)
            .setFooter('Created by Aetheryx#2222');

        msg.channel.send({
            embed: embed
        });
    };

    if (cmd === 'ping')
        msg.channel.send(`:ping_pong: Pong! ${client.pings[0]}ms`)

    if (cmd === 'ev') {
        if (msg.author.id !== settings.ownerID) return false;
        let script = msg.content.substring(prefixdb[msg.guild.id].length + 3, msg.content.length);
        let silent = script.includes('--silent') ? true : false
        if (silent) script = script.replace('--silent', '')
        try {
            let code = eval(script);
            if (typeof code !== 'string')
                code = require('util').inspect(code, {
                    depth: 0
                });
            code = code.replace(new RegExp(client.token, "gi"), "*");
            if (!silent) msg.channel.send(code, {code: 'js'});
        } catch (e) {
            msg.channel.send('\n`ERROR` ```xl\n' + e + '\n```');
        };
    };

    if (cmd === 'exec') {
        if (msg.author.id !== settings.ownerID) return false;
        let script = msg.content.substring(prefixdb[msg.guild.id].length + 5, msg.content.length);
        exec(script, async(e, stdout, stderr) => {
            if (stdout.length > 2000 || stderr.length > 2000) {
                let res = await sagent.post("https://hastebin.com/documents")
                    .send(stdout + "\n\n" + stderr)
                    .catch(e => msg.channel.send(e.message));
                msg.channel.send({
                    embed: new Discord.RichEmbed()
                        .setColor(settings.embedColor)
                        .setDescription(`Console log exceeds 2000 characters. View [here](https://hastebin.com/${sagent.body.key}).`)
                });
            } else {
                stdout && msg.channel.sendMessage('Info: \n\`\`\`' + stdout + '\`\`\`')
                stderr && msg.channel.sendMessage('Errors: \n\`\`\`' + stderr + '\`\`\`')
                if (!stderr && !stdout) msg.react("\u2611")
            };
        });
    };

{'fraction_non_alphanumeric': 0.18265289391703557, 'fraction_numerical': 0.024102311854402363, 'mean_word_length': 2.356906989543203, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 19, 'https://': 18, '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': '773951', 'n_tokens_mistral': 3984, 'n_tokens_neox': 3738, 'n_words': 695}