<commit_before>var telegram = require('telegram-bot-api');
var request = require('ajax-request');
var MongoClient = require('mongodb').MongoClient
  , assert = require('assert');

// Connection URL
var url = 'mongodb://localhost:27017/pschub';
// Use connect method to connect to the Server
MongoClient.connect(url, function(err, db) {
  assert.equal(null, err);
  console.log("Connected correctly to server");
  //insertQuestions(db, function() {});
});


var api = new telegram({
  token: '<KEY>',
  updates: {
    enabled: true,
    get_interval: 40
  }
});

var getRandom = function getRandomArbitrary() {
  return Math.random() * (9600 - 100) + 100;
}

api.on('message', function(message)
{
  var chat_id = message.chat.id;
  if(message.text == '/start') {
    api.sendMessage({
      chat_id: message.chat.id,
      text: "Yes lets start :) \n \n /quiz - Start a Quiz section \n /statistics - Get my statistics \n /help - Get help from people behind PSC HUB \n /about - about the developers \n /pegke - A Customer Loyalty Software\n /end - Stop Quiz\n"
    });
  } else if(message.text == '/quiz') {

    MongoClient.connect(url, function(err, db) {
      var collection = db.collection('questions');<commit_msg>#1 temp fix<commit_after>var telegram = require('telegram-bot-api');
var request = require('ajax-request');
var MongoClient = require('mongodb').MongoClient
  , assert = require('assert');

// Connection URL
var url = 'mongodb://localhost:27017/pschub';
// Use connect method to connect to the Server
MongoClient.connect(url, function(err, db) {
  assert.equal(null, err);
  console.log("Connected correctly to server");
  //insertQuestions(db, function() {});
});


var api = new telegram({
  token: '<KEY>',
  updates: {
    enabled: true,
    get_interval: 40
  }
});

var getRandom = function getRandomArbitrary() {
  return Math.random() * (9600 - 100) + 100;
}

api.on('message', function(message)
{
  var chat_id = message.chat.id;

  //console.log(message);
  message.text = message.text ? message.text : "this is bad";

  if(message.text == '/start') {
    api.sendMessage({
      chat_id: message.chat.id,
      text: "Yes lets start :) \n \n /quiz - Start a Quiz section \n /statistics - Get my statistics \n /help - Get help from people behind PSC HUB \n /about - about the developers \n /pegke - A Customer Loyalty Software\n /end - Stop Quiz\n"
    });
  } else if(message.text == '/quiz') {

    MongoClient.connect(url, function(err, db) {
      var collection = db.collection('questions');
{'fraction_non_alphanumeric': 0.15451664025356576, 'fraction_numerical': 0.01386687797147385, 'mean_word_length': 3.533213644524237, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '1280880', 'n_tokens_mistral': 852, 'n_tokens_neox': 813, 'n_words': 234}