var Botkit = require('botkit');

var controller = Botkit.slackbot({
    debug: false
});

controller.spawn({
    token: process.env.token || ''
}).startRTM(function(err) {
    if (err) {
        throw new Error(err);
    }
});

controller.hears(['hello', 'hi'], ['direct_message', 'direct_mention', 'mention'],
    function(bot, message) {
        bot.reply(message, 'Hello yourself.');
    }
);

controller.on('direct_mention', function(bot, message) {
    bot.reply(message, 'I heard you mention me!');
});

var Botkit = require('botkit');

var controller = Botkit.slackbot({
    debug: false
});

controller.spawn({
    token: process.env.token || ''
}).startRTM(function (err) {
    if (err) {
        throw new Error(err);
    }
});

controller.hears(['hello', 'hi'], ['direct_message', 'direct_mention', 'mention'],
    function (bot, message) {
        bot.reply(message, 'Hello yourself.');
    }
);

controller.on('direct_mention', function (bot, message) {
    bot.reply(message, 'I heard you mention me!');
});

controller.hears(['random'], ['direct_mention'], function (bot, message) {
    bot.say(
        {
            text: 'Message to random channel',
            channel: '#random'
        }
    );
});

Add message to random channel