<commit_before>var Session = require('./session')
var request = require('request')

function WebhookClient() {
  return function(bot) {
    bot.on('webhook', function(req, res, next) {

      var body = req.body
      var callbackURI = req.query.callback;

      if (!callbackURI) {
        res.error('No callback URI parameter provided.');
        return
      }

      if (!body.text) {
        res.error('No text provided in body for the message.');
        return
      }

      var session = new Session({
        user: body.user,
        conversation: body.user,
        account: body.user,
        callbackURI: callbackURI
        send: function(text) {


        }
      }, this)

      bot.trigger('message_received', body, session)
      res.success()
    })
  }
}

WebhookClient.prototype.send = function(meta, text) {
  request({
    uri: meta.callbackURI,
    method: "POST",
    headers: {
      'Content-Type': 'application/json',
    },
    body: JSON.stringify({
      text: text
    })
  }, function (error, response, body) {
    if (!error && response.statusCode == 200) {
      console.log("Successfully sent message.");
    } else {<commit_msg>Fixes typo.<commit_after>var Session = require('./session')
var request = require('request')

function WebhookClient() {
  return function(bot) {
    bot.on('webhook', function(req, res, next) {

      var body = req.body
      var callbackURI = req.query.callback;

      if (!callbackURI) {
        res.error('No callback URI parameter provided.');
        return
      }

      if (!body.text) {
        res.error('No text provided in body for the message.');
        return
      }

      var session = new Session({
        user: body.user,
        conversation: body.user,
        account: body.user,
        callbackURI: callbackURI
      }, this)

      bot.trigger('message_received', body, session)
      res.success()
    })
  }
}

WebhookClient.prototype.send = function(meta, text) {
  request({
    uri: meta.callbackURI,
    method: "POST",
    headers: {
      'Content-Type': 'application/json',
    },
    body: JSON.stringify({
      text: text
    })
  }, function (error, response, body) {
    if (!error && response.statusCode == 200) {
      console.log("Successfully sent message.");
    } else {
{'fraction_non_alphanumeric': 0.13566739606126915, 'fraction_numerical': 0.00262582056892779, 'mean_word_length': 2.3178519593613935, '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': '4379413', 'n_tokens_mistral': 676, 'n_tokens_neox': 661, 'n_words': 169}