<commit_before>exports.names = ['lottery', 'roulette'];
exports.hidden = true;
exports.enabled = true;
exports.matchStart = true;
exports.cdAll = 60;
exports.cdUser = 60;
exports.cdStaff = 60;
exports.minRole = PERMISSIONS.BOUNCER;
exports.handler = function (data) {

    var input = data.message.split(' ');
    var mins = 1;


    if (input.length >= 2) {
        mins = parseInt(_.last(input, 1));
    }
    else {
        mins = 5;
    }

    // Sanity check!
    if (mins < 1 || mins > 120) {
        mins = 5;
    }

    if (input[0] === 'roulette') {
        bot.sendChat('Wait list roulette in ' + mins + ' minutes! Chat and be in line within ' + mins + ' minutes to enter.  Winner gets moved up a random number of spots! @djs');
    }
    else {
        bot.sendChat('Wait list lottery in ' + mins + ' minutes! Chat and be in line within ' + mins + ' minutes to enter.  Winner gets the #2 spot! @djs');
    }

    if (mins > 1) {
        setTimeout(function () {
            bot.sendChat("Contest ending in ONE MINUTE - be in line and chat to enter! @djs");
        }, (mins - 1) * 60 * 1000);
    }

    setTimeout(function () {
        // Only select from users active during the lottery
        var minPosition = 2;
        getActiveDJs(mins, minPosition, function (activeDJs) {
                if (activeDJs.length > 0) {
                    var randomNumber = _.random(0, activeDJs.length - 1);
                    var winner = activeDJs[randomNumber];<commit_msg>Prevent a shouted 'ROULETTE' or any mixed case from accidentally starting a lottery.<commit_after>exports.names = ['lottery', 'roulette'];
exports.hidden = true;
exports.enabled = true;
exports.matchStart = true;
exports.cdAll = 60;
exports.cdUser = 60;
exports.cdStaff = 60;
exports.minRole = PERMISSIONS.BOUNCER;
exports.handler = function (data) {

    var input = data.message.split(' ');
    var mins = 1;


    if (input.length >= 2) {
        mins = parseInt(_.last(input, 1));
    }
    else {
        mins = 5;
    }

    // Sanity check!
    if (mins < 1 || mins > 120) {
        mins = 5;
    }

    if (input[0].toLowerCase() === 'roulette') {
        bot.sendChat('Wait list roulette in ' + mins + ' minutes! Chat and be in line within ' + mins + ' minutes to enter.  Winner gets moved up a random number of spots! @djs');
    }
    else {
        bot.sendChat('Wait list lottery in ' + mins + ' minutes! Chat and be in line within ' + mins + ' minutes to enter.  Winner gets the #2 spot! @djs');
    }

    if (mins > 1) {
        setTimeout(function () {
            bot.sendChat("Contest ending in ONE MINUTE - be in line and chat to enter! @djs");
        }, (mins - 1) * 60 * 1000);
    }

    setTimeout(function () {
        // Only select from users active during the lottery
        var minPosition = 2;
        getActiveDJs(mins, minPosition, function (activeDJs) {
                if (activeDJs.length > 0) {
                    var randomNumber = _.random(0, activeDJs.length - 1);
                    var winner = activeDJs[randomNumber];
{'fraction_non_alphanumeric': 0.1268485047650345, 'fraction_numerical': 0.019060138021689123, 'mean_word_length': 2.248665955176094, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 11, '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': '4968004', 'n_tokens_mistral': 1024, 'n_tokens_neox': 939, 'n_words': 299}