-
Notifications
You must be signed in to change notification settings - Fork 21
/
Copy pathindex.js
65 lines (61 loc) · 2.12 KB
/
index.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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
var slack = require('./lib/slack.js');
var commands = require('./commands');
var staffCommands = require('./staffCommands');
var controller = slack.controller;
//var staffController = slack.staffController;
//var opSparkController = slack.opSparkController;
var hrController = slack.hrController;
var rptController = slack.rptController;
var testController = slack.testController;
var hrsf110Controller = slack.hrsf110Controller;
var hrsf111Controller = slack.hrsf111Controller;
var MongoClient = require('mongodb').MongoClient;
var url = 'mongodb://localhost:27017/codybot';
MongoClient.connect(url, function(err, db) {
// Commands will be an object that looks something like this:
// {
// beatbox: [Function: beatbox],
// caps: [Function: caps],
// compose: [Function: compose],
// help: [Function: help],
// moo: [Function: moo],
// morning: [Function: morning],
// test: [Function: test],
// yo: [Function: yo]
// }
for (var command in commands) {
commands[command](controller, db);
//commands[command](staffController, db);
//commands[command](opSparkController, db);
commands[command](hrController, db);
commands[command](rptController, db);
commands[command](testController, db);
commands[command](hrsf110Controller, db);
commands[command](hrsf111Controller, db);
}
for (var command in staffCommands) {
//staffCommands[command](staffController, db);
staffCommands[command](hrController, db);
}
});
// staffController.on('message_received', function(bot, message) {
// if(message.type === 'hello') {
// startTest(bot);
// }
// });
//
// var users = ['U0J6WJYE5', 'U0YTST37B', 'U1CBC3090']; // cody, cara, bianca
// users = ['U0J6WJYE5'];
//
// function startTest(bot){
// users.forEach(function (userID){
// bot.startPrivateConversation({user: userID}, function(response, convo){
// convo.ask('Testing the stand-up feature. So...... What did you do today?', function(response, convo){
// convo.say('Sweet! Thanks for helping with the test.');
// console.log(convo.responses);
// convo.next();
// });
// });
// });
//
// }