<commit_before>// Various assorted call/response combinations

module.exports = {listeners: [
{
    type: "startsWith",
    query: ".dice",
    callback: function(reply){
        var words = message.body.match(/\S+/gi);
        for (var i = 0; i < words.length; i++) {
            if (!isNaN(words[i])) {
                reply(Math.floor(Math.random() * words[i]) + 1 + "");
                return;
            }
        }
        reply(Math.floor(Math.random() * 6) + 1 + "");
    }
}, {
    type: "equals",
    query: ".coin",
    callback: function(reply){
        reply(Math.random()<0.5 ? "Heads" : "Tails");
    }
}
]};<commit_msg>Changed the regex being used to split strings for .dice. Thanks Dan.<commit_after>// Various assorted call/response combinations

module.exports = {listeners: [
{
    type: "startsWith",
    query: ".dice",
    callback: function(reply){
        var words = message.body.match(/[0-9]*/);
        for (var i = 0; i < words.length; i++) {
            if (!isNaN(words[i])) {
                reply(Math.floor(Math.random() * words[i]) + 1 + "");
                return;
            }
        }
        reply(Math.floor(Math.random() * 6) + 1 + "");
    }
}, {
    type: "equals",
    query: ".coin",
    callback: function(reply){
        reply(Math.random()<0.5 ? "Heads" : "Tails");
    }
}
]};
{'fraction_non_alphanumeric': 0.18721804511278195, 'fraction_numerical': 0.010526315789473684, 'mean_word_length': 2.018140589569161, 'pattern_counts': {'":': 0, '<': 7, '<?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': '6841176', 'n_tokens_mistral': 446, 'n_tokens_neox': 436, 'n_words': 93}