-
Notifications
You must be signed in to change notification settings - Fork 23
Expand file tree
/
Copy pathindex.js
More file actions
37 lines (29 loc) · 837 Bytes
/
index.js
File metadata and controls
37 lines (29 loc) · 837 Bytes
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
/*
# RUN THE BOT:
Get a Bot token from Slack:
-> http://my.slack.com/services/new/bot
Run your bot from the command line:
token=<MY TOKEN> node index.js
# EXTEND THE BOT:
Botkit has many features for building cool and useful bots!
Read all about it here:
-> http://howdy.ai/botkit
*/
'use strict';
const { controller, bot} = require('./bootstrap');
if (process.env.NODE_ENV !== 'development') {
// Start Bot
bot.startRTM(function (err) {
if (err) {
throw new Error(err);
}
});
// To schedule the bot to say words at a certain date/time or recurringly
const scheduler = require('node-schedule');
// Schedule Jobs
require('./jobs')(scheduler, bot);
}
// Initialise Command Listeners
require('./commands')(controller);
// Initialise Event Listeners
require('./events')(controller);