<commit_before>var Botkit = require("botkit");

var googleTranslate = require("google-translate")(googleToken);
var oxr = require("open-exchange-rates"),
    fx = require("money"),
    d3Format = require("d3-format");
var nlp = require("nlp_compromise");

var config = {
    "robot": "Robotto",
    "color": "#cfc"
};

function capitalizeFirstLetter(string) {
    return string.charAt(0).toUpperCase() + string.slice(1);
}

var slackToken = process.env.SLACK_TOKEN;
var googleToken = process.env.GOOGLE_TOKEN;
var oxrToken = process.env.OXR_TOKEN; // openexchangerates.com

if (!slackToken)  { console.error("SLACK_TOKEN is required!"); process.exit(1); }
if (!googleToken) { console.error("GOOGLE_TOKEN is required!"); process.exit(1); }
if (!oxrToken)    { console.error("OXR_TOKEN is required!"); process.exit(1); }

var controller = Botkit.slackbot();
var bot = controller.spawn({
    "token": slackToken
});

bot.startRTM(function(err, bot, payload) {
    if (err) {
        throw new Error("Could not connect to Slack");
    }
});

// Join message
controller.on("bot_channel_join", function(bot, message) {
    bot.reply(message, "I'm here!");<commit_msg>Move function in index.js further down<commit_after>var Botkit = require("botkit");

var googleTranslate = require("google-translate")(googleToken);
var oxr = require("open-exchange-rates"),
    fx = require("money"),
    d3Format = require("d3-format");
var nlp = require("nlp_compromise");

var config = {
    "robot": "Robotto",
    "color": "#cfc"
};

var slackToken = process.env.SLACK_TOKEN;
var googleToken = process.env.GOOGLE_TOKEN;
var oxrToken = process.env.OXR_TOKEN; // openexchangerates.com

if (!slackToken)  { console.error("SLACK_TOKEN is required!"); process.exit(1); }
if (!googleToken) { console.error("GOOGLE_TOKEN is required!"); process.exit(1); }
if (!oxrToken)    { console.error("OXR_TOKEN is required!"); process.exit(1); }

var controller = Botkit.slackbot();
var bot = controller.spawn({
    "token": slackToken
});

bot.startRTM(function(err, bot, payload) {
    if (err) {
        throw new Error("Could not connect to Slack");
    }
});

function capitalizeFirstLetter(string) {
    return string.charAt(0).toUpperCase() + string.slice(1);
}

// Join message
controller.on("bot_channel_join", function(bot, message) {
    bot.reply(message, "I'm here!");
{'fraction_non_alphanumeric': 0.16489135066041755, 'fraction_numerical': 0.005965061780997018, 'mean_word_length': 4.826302729528536, 'pattern_counts': {'":': 6, '<': 3, '<?xml version=': 0, '>': 3, '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': '269490', 'n_tokens_mistral': 792, 'n_tokens_neox': 785, 'n_words': 170}