<commit_before>var bot = require('../bot.js');
module.exports = {};
exports = module.exports;
var guilds = {};
const GuildSpawn = require('./../classes/GuildSpawn');
exports.play = function (URL, message) {
    if (!guilds[message.guild.id]) {
        guilds[message.guild.id] = new GuildSpawn(message.guild);

        guilds[message.guild.id].p.on('message', m => {
            guilds[message.guild.id].p.send("message:test");
            console.log(m);
            if (m.guild === message.guild.id) {
                guilds[message.guild.id].spawnComplete = true;
                guilds[message.guild.id].queue.forEach((mes) => {
                    guilds[message.guild.id].p.send(mes);
                });
            }

        });
        guilds[message.guild.id].p.on('close', () => {
            console.log("child exitted");
            guilds[message.guild.id].p = undefined;
        });
        guilds[message.guild.id].p.on('exit', () => {
            console.log("child exitted");
            guilds[message.guild.id].p = undefined;
        });
    }
    let ms = { cmd: 'play', message: URL, user: message.author.id, channel: message.channel.id };
    if (guilds[message.guild.id].spawnComplete)
        return guilds[message.guild.id].p.send(ms);
    else
        return guilds[message.guild.id].queue.push(ms);
}

exports.playNext = function (message) {
    if (!guilds[message.guild.id]) {
        return message.reply("Queue is empty!");
    }
    let ms = { cmd: 'playnext', message: message.content, user: message.author.id, channel: message.channel.id };
    if (guilds[message.guild.id].spawnComplete)
        return guilds[message.guild.id].p.send(ms);
    else
        return guilds[message.guild.id].queue.push(ms);<commit_msg>Use Delete instead<commit_after>var bot = require('../bot.js');
module.exports = {};
exports = module.exports;
var guilds = {};
const GuildSpawn = require('./../classes/GuildSpawn');
exports.play = function (URL, message) {
    if (!guilds[message.guild.id]) {
        guilds[message.guild.id] = new GuildSpawn(message.guild);

        guilds[message.guild.id].p.on('message', m => {
            guilds[message.guild.id].p.send("message:test");
            console.log(m);
            if (m.guild === message.guild.id) {
                guilds[message.guild.id].spawnComplete = true;
                guilds[message.guild.id].queue.forEach((mes) => {
                    guilds[message.guild.id].p.send(mes);
                });
            }

        });
        guilds[message.guild.id].p.on('close', () => {
            console.log("child exitted");
            delete guilds[message.guild.id].p;
        });
        guilds[message.guild.id].p.on('exit', () => {
            console.log("child exitted");
            delete guilds[message.guild.id].p;
        });
    }
    let ms = { cmd: 'play', message: URL, user: message.author.id, channel: message.channel.id };
    if (guilds[message.guild.id].spawnComplete)
        return guilds[message.guild.id].p.send(ms);
    else
        return guilds[message.guild.id].queue.push(ms);
}

exports.playNext = function (message) {
    if (!guilds[message.guild.id]) {
        return message.reply("Queue is empty!");
    }
    let ms = { cmd: 'playnext', message: message.content, user: message.author.id, channel: message.channel.id };
    if (guilds[message.guild.id].spawnComplete)
        return guilds[message.guild.id].p.send(ms);
    else
        return guilds[message.guild.id].queue.push(ms);
{'fraction_non_alphanumeric': 0.1725221365324193, 'fraction_numerical': 0.0, 'mean_word_length': 2.357622243528284, 'pattern_counts': {'":': 0, '<': 3, '<?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': '571412', 'n_tokens_mistral': 1181, 'n_tokens_neox': 1158, 'n_words': 169}