-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapp.js
More file actions
27 lines (22 loc) · 697 Bytes
/
app.js
File metadata and controls
27 lines (22 loc) · 697 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
const { App } = require("@slack/bolt");
const { config } = require("dotenv");
const { registerListeners } = require("./listeners");
config();
/** Initialization */
const app = new App({
token: process.env.SLACK_BOT_TOKEN,
signingSecret: process.env.SLACK_SIGNING_SECRET,
socketMode: true,
appToken: process.env.SLACK_APP_TOKEN,
// Socket Mode doesn't listen on a port, but in case you want your app to respond to OAuth,
// you still need to listen on some port!
port: process.env.PORT || 3000,
});
/** Register Listeners */
registerListeners(app);
/** Start Bolt App */
(async () => {
// Start your app
await app.start();
console.log("⚡️ Bolt app is running!");
})();