<commit_before>module.exports = Cmds.addCommand({
    cmds: [';translate '],

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

    desc: 'Translate a word/sentence into English',

    args: '([word] | [sentence])',

    example: 'Hola mis amigos',

    func: (cmd, args, msgObj, speaker, channel, guild) => {
        index.Translate.translate(args, 'en', (err, res) => {
            if (err) return console.error(err);

            const embFields = [
                { name: `[${res.detectedSourceLanguage}] Original`, value: res.originalText || args, inline: false },
                { name: '[en] Translation', value: res.translatedText, inline: false },
            ];

            Util.sendEmbed(channel, 'Translated', null, Util.makeEmbedFooter(speaker), null, colGreen, embFields);
        });

        return undefined;
    },
});<commit_msg>Fix error check<commit_after>module.exports = Cmds.addCommand({
    cmds: [';translate '],

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

    desc: 'Translate a word/sentence into English',

    args: '([word] | [sentence])',

    example: 'Hola mis amigos',

    func: (cmd, args, msgObj, speaker, channel, guild) => {
        index.Translate.translate(args, 'en', (err, res) => {
            if (err && err.error) return console.log(err.error);

            const embFields = [
                { name: `[${res.detectedSourceLanguage}] Original`, value: res.originalText || args, inline: false },
                { name: '[en] Translation', value: res.translatedText, inline: false },
            ];

            Util.sendEmbed(channel, 'Translated', null, Util.makeEmbedFooter(speaker), null, colGreen, embFields);
        });

        return undefined;
    },
});
{'fraction_non_alphanumeric': 0.1540216771249287, 'fraction_numerical': 0.0, 'mean_word_length': 2.419103313840156, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, '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': '5081533', 'n_tokens_mistral': 543, 'n_tokens_neox': 508, 'n_words': 129}