<commit_before>// Description:
//   Show Abakus coffee status
//
// Commands:
// hubot kaffe - Replay with information about the coffee brewer at the webkom-office.

const token = process.env.MOCCAMASTER_TOKEN;
const coffeeChannel = process.env.MOCCAMASTER_CHANNEL || '#kaffebot';
const moment = require('moment');
const log = console.log;

module.exports = robot => {
  robot.router.post('/moccamaster', (request, response) => {
    const authorization = request.headers.authorization;

    if (token !== authorization) {
      log(`Token denied, ${authorization}`);
      return response.status(401).json({ details: 'Invalid token' });
    }

    // Store status in memory
    robot.brain.set('moccamasterLastBrew', moment());

    // Post brewing done in slack
    robot.messageRoom(
      coffeeChannel,
      'Det er nytraktet kaffe på kontoret! :coffee:'
    );

    return response.json({ details: `success` });
  });<commit_msg>Switch to norwegian plz<commit_after>// Description:
//   Show Abakus coffee status
//
// Commands:
// hubot kaffe - Replay with information about the coffee brewer at the webkom-office.

const token = process.env.MOCCAMASTER_TOKEN;
const coffeeChannel = process.env.MOCCAMASTER_CHANNEL || '#kaffebot';
const moment = require('moment');
const log = console.log;
moment.locale('nb-NO');

module.exports = robot => {
  robot.router.post('/moccamaster', (request, response) => {
    const authorization = request.headers.authorization;

    if (token !== authorization) {
      log(`Token denied, ${authorization}`);
      return response.status(401).json({ details: 'Invalid token' });
    }

    // Store status in memory
    robot.brain.set('moccamasterLastBrew', moment());

    // Post brewing done in slack
    robot.messageRoom(
      coffeeChannel,
      'Det er nytraktet kaffe på kontoret! :coffee:'
    );

    return response.json({ details: `success` });
  });
{'fraction_non_alphanumeric': 0.13588667366211962, 'fraction_numerical': 0.0031479538300104933, 'mean_word_length': 3.5731414868105515, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, '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': '5287935', 'n_tokens_mistral': 586, 'n_tokens_neox': 570, 'n_words': 154}