<commit_before>
const chatId = process.env.CHAT_ID;

const Shout = require('../app/models/shout');

module.exports = (io, socket, console, tg) => {

    socket.on('req shouts', (data) => {
        data = data || { limit: 10 };
        var limit = data.limit || 10;
        console('Shouts requested.');
        Shout
            .find({ })
            .sort({ date: -1 })
            .limit( limit )
            .exec( (err, shouts) => {
            socket.emit('snd shouts', { shouts: shouts });
        });

    });

    socket.on('snd shout', (data) => {
        console('Shout received.');
        var shout = new Shout(data);
        shout.save((err,shout) => {
            if (err) {
                socket.emit('bad shout', err);
                return;
            }
            io.emit('rcv shout', shout);
            tg.api.sendMessage(chatId, '[' + shout.author + ']: ' + shout.msg);
        });
    });
};
<commit_msg>Fix: wrong parameter order.<commit_after>
const chatId = process.env.CHAT_ID;

const Shout = require('../app/models/shout');

module.exports = (io, socket, tg, console) => {

    socket.on('req shouts', (data) => {
        data = data || { limit: 10 };
        var limit = data.limit || 10;
        console('Shouts requested.');
        Shout
            .find({ })
            .sort({ date: -1 })
            .limit( limit )
            .exec( (err, shouts) => {
            socket.emit('snd shouts', { shouts: shouts });
        });

    });

    socket.on('snd shout', (data) => {
        console('Shout received.');
        var shout = new Shout(data);
        shout.save((err,shout) => {
            if (err) {
                socket.emit('bad shout', err);
                return;
            }
            io.emit('rcv shout', shout);
            tg.api.sendMessage(chatId, '[' + shout.author + ']: ' + shout.msg);
        });
    });
};

{'fraction_non_alphanumeric': 0.18017057569296374, 'fraction_numerical': 0.005330490405117271, 'mean_word_length': 1.6033287101248266, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 13, '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': '4375572', 'n_tokens_mistral': 591, 'n_tokens_neox': 566, 'n_words': 125}