-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapp.js
53 lines (45 loc) · 1.02 KB
/
app.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
const { config } = require("dotenv");
const { App } = require("@slack/bolt");
const { compass } = require("./compass");
const { registerActions } = require("./actions");
const { registerViews } = require("./views");
const { registerCrons } = require("./crons");
const { registerCommands } = require("./commands");
config();
/**
* Initializes your app with your bot token and signing secret.
*/
const app = new App({
token: process.env.SLACK_BOT_TOKEN,
signingSecret: process.env.SLACK_SIGNING_SECRET,
socketMode: true,
appToken: process.env.SLACK_APP_TOKEN,
port: process.env.PORT || 3000,
});
/**
* Registers the app's actions.
*/
registerActions(app);
/**
* Registers the app's views.
*/
registerViews(app);
/**
* Registers the app's crons.
*/
// registerCrons(app);
/**
* Registers the app's commands.
*/
registerCommands(app);
/**
* Sets the app's assistant to Compass.
*/
app.assistant(compass);
/**
* Starts the app.
*/
(async () => {
await app.start();
app.logger.info("🌊 Compass is sailing!");
})();