<commit_before>const UTIL = require('./util');
const FS = require('fs');

module.exports = {

  getRandomEvent: function(message) {
    switch (UTIL.getRandomInt(0, 256)) {
      case 1:
        module.exports.getingRobbed(message);
        break;
      case 2:
        message.channel.send('just a placeholder for a new event');
        break;
      default:
        //message.channel.send('Just the default case for an event.\nOr should I say: You lucky bastard !!!! Nothing happend ..... ? ');
    }
  },

getingRobbed: function(message) {
  var ammount = UTIL.getRandomInt(1, 100);
  message.channel.send(message.author + ' OHHHHH NOOOO!!!!!! \nYou gabled too much and fell asleep. \n\nIn the meantime someone stole your hard earned cash....\n' + ammount + ' coins are missing');
  var path = '/tmp/' + message.author.id + '.json';
  var obj;
  if (FS.existsSync(path)) {
    var readFileInput = FS.readFileSync(path);
    obj = JSON.parse(readFileInput);
    obj.coins = Number(obj.coins) - ammount;
  }
    FS.writeFileSync(path, JSON.stringify(obj));
}
};
<commit_msg>changes i don't remember<commit_after>const UTIL = require('./util');
const FS = require('fs');

module.exports = {

  getRandomEvent: function(message) {
    switch (UTIL.getRandomInt(0, 10)) {
      case 1:
        module.exports.getingRobbed(message);
        break;
      case 2:
        message.channel.send('just a placeholder for a new event');
        break;
      case 3:
        module.exports.rainbow(message);
      default:
        //message.channel.send('Just the default case for an event.\nOr should I say: You lucky bastard !!!! Nothing happend ..... ? ');
    }
  },

getingRobbed: function(message) {
  var ammount = UTIL.getRandomInt(1, 100);
  message.channel.send(message.author + ' OHHHHH NOOOO!!!!!! \nYou gabled too much and fell asleep. \n\nIn the meantime someone stole your hard earned cash....\n' + ammount + ' coins are missing');
  var path = '/tmp/' + message.author.id + '.json';
  var obj;
  if (FS.existsSync(path)) {
    var readFileInput = FS.readFileSync(path);
    obj = JSON.parse(readFileInput);
    obj.coins = Number(obj.coins) - ammount;
  }
    FS.writeFileSync(path, JSON.stringify(obj));
}

rainbow: function(message) {
  var ammount = UTIL.getRandomInt(1, 5000);
  message.channel.send(message.author + 'Super lucky !!! \nYou found a pod of golden coins in the backyard... \n You found ' + ammount + ' coins');
  var path = '/tmp/' + message.author.id + '.json';
  var obj;
  if (FS.existsSync(path)) {
    var readFileInput = FS.readFileSync(path);
    obj = JSON.parse(readFileInput);
    obj.coins = Number(obj.coins) + ammount;
  }
    FS.writeFileSync(path, JSON.stringify(obj));
};

{'fraction_non_alphanumeric': 0.14902250092216895, 'fraction_numerical': 0.009221689413500553, 'mean_word_length': 3.0781954887218044, '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': '69394', 'n_tokens_mistral': 916, 'n_tokens_neox': 868, 'n_words': 229}