<commit_before>'use strict';

var util = require('util');

var chat = require('../api/chat');

var handleMessage = function (message) {

    console.log(message);

    if (process.env.user_id === message.user) {
        return;
    }

    switch (message.type) {
        case 'message':
            if (/@?nestor/gi.test(message.text)) {
                if (/hello|hi|xoka/i.test(message.text)) {
                    return chat.postMessage(message.channel, util.format('Good day, <@%s>!', message.user), {
                        as_user: true
                    });
                }

                return chat.postMessage(message.channel, util.format('I\'m not quite sure what to tell you, <@%s>.', message.user), {
                    as_user: true
                });
                break;
            }
        default:
    }

};

module.exports = handleMessage;<commit_msg>Add ability to say goodbye<commit_after>'use strict';

var util = require('util');

var chat = require('../api/chat');

var handleMessage = function (message) {

    console.log(message);

    if (process.env.user_id === message.user) {
        return;
    }

    switch (message.type) {
        case 'message':
            if (/@?nestor/gi.test(message.text)) {
                if (/hello|hi|xoka/i.test(message.text)) {
                    return chat.postMessage(message.channel, util.format('Good day, <@%s>!', message.user), {
                        as_user: true
                    });
                }

                if (/goodbye|bye|xopa/i.test(message.text)) {
                    return chat.postMessage(message.channel, util.format('Farewell, <@%s>!', message.user), {
                        as_user: true
                    });
                }

                return chat.postMessage(message.channel, util.format('I\'m not quite sure what to tell you, <@%s>.', message.user), {
                    as_user: true
                });
                break;
            }
        default:
    }

};

module.exports = handleMessage;
{'fraction_non_alphanumeric': 0.1430678466076696, 'fraction_numerical': 0.0, 'mean_word_length': 1.5469336670838547, 'pattern_counts': {'":': 0, '<': 8, '<?xml version=': 0, '>': 8, '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': '90343', 'n_tokens_mistral': 604, 'n_tokens_neox': 561, 'n_words': 114}