<commit_before>//Displays the list of commands found in ./commands/

exports.name = 'commands';
exports.hidden = false;
exports.enabled = true;
exports.matchStart = false;
exports.handler = function(data) {
    var response = 'Commands: ';
    for (i in commands) {
        if (commands[i].enabled && !(commands[i].hidden)) {
            response += commands[i].name + ', ';
        }
    }
    output({text: response.substring(0, response.length - 2), destination: data.source, userid: data.userid});
}<commit_msg>Simplify commands listing with filter and join instead of a loop.<commit_after>//Displays the list of commands found in ./commands/

exports.name = 'commands';
exports.hidden = false;
exports.enabled = true;
exports.matchStart = false;
exports.handler = function(data) {
    var response = 'Commands: ' + commands.filter(function(command) {
        return command.enabled && !command.hidden;
    }).join(', ');
    output({text: response.substring(0, response.length - 2), destination: data.source, userid: data.userid});
}
{'fraction_non_alphanumeric': 0.1464354527938343, 'fraction_numerical': 0.0038535645472061657, 'mean_word_length': 3.7660550458715596, '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': '7016938', 'n_tokens_mistral': 302, 'n_tokens_neox': 297, 'n_words': 82}