<commit_before>var fs = require('fs');
var token = require(process.env.HOME + '/.dagsen-bot-token.js');

var request = require('request');
var Telegram = require('telegram-bot');
var tg = new Telegram(token);

tg.on('message', function(msg) {
  if (!msg.text) return;

  if (msg.text === '/mat' || msg.text === '/dagsen') {
    request('http://api.teknolog.fi/taffa/sv/today', function(err, res, body) {
      console.log(body);
      tg.sendMessage({
        text: body,
        chat_id: msg.chat.id
      });
    });
  }
});

tg.start();<commit_msg>be verbose, respond to anything starting with /mat<commit_after>var fs = require('fs');
var token = require(process.env.HOME + '/.dagsen-bot-token.js');

var request = require('request');
var Telegram = require('telegram-bot');
var tg = new Telegram(token);

tg.on('message', function(msg) {
  console.log('got msg: ' + msg.text);
  if (!msg.text) return;

  if (!msg.text.indexOf('/mat')) {
    console.log('retreiving menu...');
    request('http://api.teknolog.fi/taffa/sv/today', function(err, res, body) {
      tg.sendMessage({
        text: body,
        chat_id: msg.chat.id
      });
    });
  }
});

tg.start();
{'fraction_non_alphanumeric': 0.2030716723549488, 'fraction_numerical': 0.0, 'mean_word_length': 3.2654545454545456, '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': '5839292', 'n_tokens_mistral': 419, 'n_tokens_neox': 411, 'n_words': 83}