-
Notifications
You must be signed in to change notification settings - Fork 0
/
bot.js
30 lines (25 loc) · 989 Bytes
/
bot.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
var Botkit = require('botkit');
var controller = Botkit.slackbot();
var bot = controller.spawn({
token: "xoxb-22433004800-z4HqeKA85M1LLxa22AUfgNUc"
})
bot.startRTM(function(err,bot,payload) {
if (err) {
throw new Error('Could not connect to Slack');
}
});
controller.hears(["juice","^pattern$"],["direct_message","direct_mention","mention","ambient"],function(bot,message) {
bot.reply(message,'I think you mean HOOSE!');
});
controller.hears(["hoose","^pattern$"],["direct_message","direct_mention","mention","ambient"],function(bot,message) {
bot.reply(message,'Now we\'re talkin');
});
controller.hears(["hola","^pattern$"],["direct_message","direct_mention"],function(bot,message) {
bot.reply(message,"Leave me alone, I\'m drinking hoose.");
});
controller.hears(["alex"],["direct_message","direct_mention","mention","ambient"],function(bot,message){
bot.startConversation(message,function(err,convo) {
convo.say("Alexander");
convo.say("The great!");
})
});