<commit_before>'use strict'

const bodyParser = require('body-parser')
const slack = require('slapp/client')

const ConvoStore = require('./convo-store')

var http = require("https");
var querystring = require('querystring');

var attachments = [{
    fallback: "Attachment 1 Fallback",
    title: "This is Attachment 1",
    text: "Attachment 1 Text",
    color: "#3964db"
}, {
    fallback: "Attachment 2 Fallback",
    title: "This is Attachment 2",
    text: "Attachment 2 Text",
    color: "#3964db"
}];




module.exports = (server, db) => {
  let clientId = process.env.SLACK_CLIENT_ID
  let clientSecret = process.env.SLACK_CLIENT_SECRET
  let domain = process.env.DOMAIN

  // let app = Slapp({
  //   verify_token: process.env.SLACK_VERIFY_TOKEN,
  //   context: Context(),
  //   convo_store: ConvoStore()
  // })

  server.get('/cron', (req, res) => {

    // let params = {
    //   code: req.query.code,
    //   client_id: clientId,
    //   client_secret: clientSecret,
    //   redirect_uri: `https://${domain || req.get('host')}/cron`
    // }

    // slack.oauth.access(params, (err, oauthAccess) => {
    //   if (err) {
    //     console.error(err)
    //     return res.status(500).send(err.message || err)
    //   }

      var url = 'https://slack.com/api/chat.postMessage?user=token=' + process.env.SLACK_API_TOKEN + '&channel=@C0320RUB4&text=HelloWorld'

      console.log('api')
      console.log(process.env.SLACK_API_TOKEN)
      consoel.log('api')
      var message = {
        token: '<PASSWORD>-6249dc86e60c14bf3c220a8f<PASSWORD>ee248',
        channel: "@C0320RUB4",
        text: "This is a message with attachments"
      }

      var qs = querystring.stringify(message);

      var options = {
        "method": "GET",
        "hostname": "slack.com",
        "path": "/api/chat.postMessage?" + qs
      };

      var req = http.request(options, function (res) {
        var chunks = [];

        res.on("data", function (chunk) {
          chunks.push(chunk);
        });

        res.on("end", function () {
          var body = Buffer.concat(chunks);
          console.log(body.toString());
        });
      }).on('error', function(err) {<commit_msg>Misspelling.<commit_after>'use strict'

const bodyParser = require('body-parser')
const slack = require('slapp/client')

const ConvoStore = require('./convo-store')

var http = require("https");
var querystring = require('querystring');

var attachments = [{
    fallback: "Attachment 1 Fallback",
    title: "This is Attachment 1",
    text: "Attachment 1 Text",
    color: "#3964db"
}, {
    fallback: "Attachment 2 Fallback",
    title: "This is Attachment 2",
    text: "Attachment 2 Text",
    color: "#3964db"
}];




module.exports = (server, db) => {
  let clientId = process.env.SLACK_CLIENT_ID
  let clientSecret = process.env.SLACK_CLIENT_SECRET
  let domain = process.env.DOMAIN

  // let app = Slapp({
  //   verify_token: process.env.SLACK_VERIFY_TOKEN,
  //   context: Context(),
  //   convo_store: ConvoStore()
  // })

  server.get('/cron', (req, res) => {

    // let params = {
    //   code: req.query.code,
    //   client_id: clientId,
    //   client_secret: clientSecret,
    //   redirect_uri: `https://${domain || req.get('host')}/cron`
    // }

    // slack.oauth.access(params, (err, oauthAccess) => {
    //   if (err) {
    //     console.error(err)
    //     return res.status(500).send(err.message || err)
    //   }

      var url = 'https://slack.com/api/chat.postMessage?user=token=' + process.env.SLACK_API_TOKEN + '&channel=@C0320RUB4&text=HelloWorld'

      console.log('api')
      console.log(process.env.SLACK_API_TOKEN)
      console.log('api')
      var message = {
        token: '<KEY>',
        channel: "@C0320RUB4",
        text: "This is a message with attachments"
      }

      var qs = querystring.stringify(message);

      var options = {
        "method": "GET",
        "hostname": "slack.com",
        "path": "/api/chat.postMessage?" + qs
      };

      var req = http.request(options, function (res) {
        var chunks = [];

        res.on("data", function (chunk) {
          chunks.push(chunk);
        });

        res.on("end", function () {
          var body = Buffer.concat(chunks);
          console.log(body.toString());
        });
      }).on('error', function(err) {
{'fraction_non_alphanumeric': 0.16512915129151293, 'fraction_numerical': 0.016605166051660517, 'mean_word_length': 2.489139179404666, 'pattern_counts': {'":': 6, '<': 6, '<?xml version=': 0, '>': 12, 'https://': 4, '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': '181879', 'n_tokens_mistral': 1506, 'n_tokens_neox': 1446, 'n_words': 290}