<commit_before>var botCore = require('./chat_modules_bot/core');
var mainCore = require('./chat_modules/core');
var commandManager = require('./commands');

commandManager.setCore(mainCore);
commandManager.setBotCore(botCore);

var getAWakeupMessage = function(){
    var messages = [
        'Why am I getting up?',
        'Seriously, this again?',
        'Alright, alright, give me a minute',
        'What\'s the point in even getting up?',
        'Time to start the daily grind'
    ];
    return messages[Math.floor(Math.random() * messages.length)];
};

var messageFormatting = {
    room: function(event) {
        return "[" +
            event.room_name +
            "](http://chat.stackexchange.com/rooms/" +
            event.room_id +
            ")";
    },
    user: function(event) {
        return "[" +
            event.user_name +
            "](http://chat.stackexchange.com/users/" +
            event.user_id +
            ")";
    },
    activity: function(string) {
        return string;
    },
    content: function(event) {
        return event.content;
    },
    edited: function(event) {
        var maxStringLength = 25;
        var editedStringLength = Math.ceil(maxStringLength / 2);
        return event.content.length > maxStringLength ? event.content.substring(0, editedStringLength + "...") : event.content;
    },
    changedRoomName: function(event) {
        var name = event.content.substring(0, event.content.lastIndexOf(" /"));
        return "[" +
            event.room_id +
            ": " +
            name +
            "]";
    },
    messageId: function(event) {
        return event.message_id;
    },
    connection: function(event) {
        return "Connecting to " + event.name;
    },
};
mainCore.set.messageFormatting(messageFormatting);
botCore.setMessageFormatting(messageFormatting);
mainCore.set.commands(commandManager.commands);
mainCore.set.limitedAccessCommands(commandManager.limitedAccessCommands);

var botPrefix = "[ [**Marvin**](https://github.com/The-Quill/SE-Flag-Bot) ] ";
var chatDomain = mainCore.chatAbbreviationToFull("SE");

mainCore.start()
.then(function() {
    console.log("Main core started");
    return botCore.start();
})
.then(function(){
    console.log("Bot core started");
    botCore.actions.send(chatDomain, 39270, botPrefix + getAWakeupMessage());
    mainCore.set.say(function (message){
        return botCore.actions.send(chatDomain, 39270, botPrefix + message);
    });
    mainCore.set.specialSay(function (message){
        return new Promise(function(resolve, reject){
            console.log(message);
            resolve();
        });
    });
    mainCore.set.noPrefixSay(function (message){
        return botCore.actions.send(chatDomain, 39270, message);<commit_msg>added a fun one and fixed link so I don't get 50 million fucking slack emails<commit_after>var botCore = require('./chat_modules_bot/core');
var mainCore = require('./chat_modules/core');
var commandManager = require('./commands');

commandManager.setCore(mainCore);
commandManager.setBotCore(botCore);

var getAWakeupMessage = function(){
    var messages = [
        'Why am I getting up?',
        'Seriously, this again?',
        'Why do you hate me so?',
        'Captain Quill\'s log, Day#143: We\'re still hiding in fear of these ' +
            'manical bots, the crew are running low on food and some are talking of eating the' +
            'Java developers first... their language\'s verbosity makes them more tender when slow roasted.',
        'Alright, alright, give me a minute',
        'What\'s the point in even getting up?',
        'Time to start the daily grind'
    ];
    return messages[Math.floor(Math.random() * messages.length)];
};

var messageFormatting = {
    room: function(event) {
        return "[" +
            event.room_name +
            "](http://chat.stackexchange.com/rooms/" +
            event.room_id +
            ")";
    },
    user: function(event) {
        return "[" +
            event.user_name +
            "](http://chat.stackexchange.com/users/" +
            event.user_id +
            ")";
    },
    activity: function(string) {
        return string;
    },
    content: function(event) {
        return event.content;
    },
    edited: function(event) {
        var maxStringLength = 25;
        var editedStringLength = Math.ceil(maxStringLength / 2);
        return event.content.length > maxStringLength ? event.content.substring(0, editedStringLength + "...") : event.content;
    },
    changedRoomName: function(event) {
        var name = event.content.substring(0, event.content.lastIndexOf(" /"));
        return "[" +
            event.room_id +
            ": " +
            name +
            "]";
    },
    messageId: function(event) {
        return event.message_id;
    },
    connection: function(event) {
        return "Connecting to " + event.name;
    },
};
mainCore.set.messageFormatting(messageFormatting);
botCore.setMessageFormatting(messageFormatting);
mainCore.set.commands(commandManager.commands);
mainCore.set.limitedAccessCommands(commandManager.limitedAccessCommands);

var botPrefix = "[ [**Marvin**](https://git.io/vrgPr) ] ";
var chatDomain = mainCore.chatAbbreviationToFull("SE");

mainCore.start()
.then(function() {
    console.log("Main core started");
    return botCore.start();
})
.then(function(){
    console.log("Bot core started");
    botCore.actions.send(chatDomain, 39270, botPrefix + getAWakeupMessage());
    mainCore.set.say(function (message){
        return botCore.actions.send(chatDomain, 39270, botPrefix + message);
    });
    mainCore.set.specialSay(function (message){
        return new Promise(function(resolve, reject){
            console.log(message);
            resolve();
        });
    });
    mainCore.set.noPrefixSay(function (message){
        return botCore.actions.send(chatDomain, 39270, message);
{'fraction_non_alphanumeric': 0.13617165061665823, 'fraction_numerical': 0.007602635580334516, 'mean_word_length': 2.681592039800995, 'pattern_counts': {'":': 2, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 2, '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': '6280941', 'n_tokens_mistral': 1743, 'n_tokens_neox': 1688, 'n_words': 356}