<commit_before>'use strict;'

module.exports = class Player {
    constructor(conn, chann) {
        this.conn = conn;
        this.chann = chann;
        this.queue = [];

        conn.on('end', this.playNext());
    }

    addSong(song) {
        if(this.queue.length == 0 && !this.conn.playing) {
            this.queue.push(song);
            this.queue.playNext();
        }
        else {
            this.queue.push(song);
            bot.createMessage(chann.id, `Your song was added to the queue in position ${this.queue.length}`);
        }
    }

    playNext() {
        let next = this.queue.shift();

        if(next) {
            next.getStream().then(stream => {<commit_msg>fixed event listener to be a function<commit_after>'use strict;'

module.exports = class Player {
    constructor(conn, chann) {
        this.conn = conn;
        this.chann = chann;
        this.queue = [];

        conn.on('end', () => {
            this.playNext()
        });
    }

    addSong(song) {
        if(this.queue.length == 0 && !this.conn.playing) {
            this.queue.push(song);
            this.queue.playNext();
        }
        else {
            this.queue.push(song);
            bot.createMessage(chann.id, `Your song was added to the queue in position ${this.queue.length}`);
        }
    }

    playNext() {
        let next = this.queue.shift();

        if(next) {
            next.getStream().then(stream => {
{'fraction_non_alphanumeric': 0.14644351464435146, 'fraction_numerical': 0.001394700139470014, 'mean_word_length': 1.7229601518026565, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 6, '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': '2800447', 'n_tokens_mistral': 451, 'n_tokens_neox': 432, 'n_words': 84}