-
Notifications
You must be signed in to change notification settings - Fork 0
/
app.js
31 lines (27 loc) · 943 Bytes
/
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
require("dotenv").config();
require("./controllers/job");
const { App } = require("@slack/bolt");
// Initializes your app with your bot token | user token and signing secret
const app = new App({
token: process.env.USER_TOKEN || process.env.BOT_TOKEN,
appToken: process.env.SLACK_APP_TOKEN,
socketMode: true,
});
const { listenShortcut } = require("./listeners/shortcutHandler");
const handleSubmit = require("./listeners/handleSubmit");
const handleSpep2 = require("./listeners/handleStep2");
const { test } = require("./listeners/test");
/// handling the shortcut
test(app);
(async() => {
const promises = [listenShortcut(app), handleSubmit(app), handleSpep2(app)];
try {
const result = await Promise.all(promises);
console.log(result);
} catch (error) {
console.error(error);
}
})();
app.start(process.env.PORT || 3000).then(() => {
console.log("⚡️ Bolt app is running!");
});