<commit_before>var HTTPS = require('https');
var path = require('path');
var config = require('./config');
var bot = {};

var groupIdToBotMap = {};
config.bots.forEach(function (bot) {
  groupIdToBotMap[bot.groupID] = bot;
});

var commands = [];
bot.registerCommand = function (command, description, func) {
  commands[command] = [description, func];
};

var normalizedPath = path.join(__dirname, "commands");
require("fs").readdirSync(normalizedPath).forEach(function (file) {
  if (path.extname(file) === '.js') {
    require("./commands/" + file)(bot.registerCommand)
  }
});

bot.respond = function (request) {
  var bot = groupIdToBotMap[request.group_id],
      msg = request.text;
  if (!bot) {
    console.log('New message received, but no bot configured for Group ID ' + request.group_id);
  } else {<commit_msg>add source of code snipped<commit_after>var HTTPS = require('https');
var path = require('path');
var config = require('./config');
var bot = {};

var groupIdToBotMap = {};
config.bots.forEach(function (bot) {
  groupIdToBotMap[bot.groupID] = bot;
});

var commands = [];
bot.registerCommand = function (command, description, func) {
  commands[command] = [description, func];
};

// http://stackoverflow.com/a/5365577 (node.js require all files in a folder?)
// And http://stackoverflow.com/questions/5364928/node-js-require-all-files-in-a-folder#comment25520686_5365577
var normalizedPath = path.join(__dirname, "commands");
require("fs").readdirSync(normalizedPath).forEach(function (file) {
  if (path.extname(file) === '.js') {
    require("./commands/" + file)(bot.registerCommand)
  }
});

bot.respond = function (request) {
  var bot = groupIdToBotMap[request.group_id],
      msg = request.text;
  if (!bot) {
    console.log('New message received, but no bot configured for Group ID ' + request.group_id);
  } else {
{'fraction_non_alphanumeric': 0.1672077922077922, 'fraction_numerical': 0.015692640692640692, 'mean_word_length': 4.671779141104294, 'pattern_counts': {'":': 0, '<': 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': '5018742', 'n_tokens_mistral': 603, 'n_tokens_neox': 582, 'n_words': 134}