forked from cyclic-software/starter-slack-boltjs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
app.js
32 lines (26 loc) · 758 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
32
const { App, SocketModeReceiver } = require('@slack/bolt');
const socketModeReceiver = new SocketModeReceiver({
token: process.env.APP_TOKEN
})
const app = new App({
receiver:socketModeReceiver,
token: process.env.SLACK_BOT_TOKEN,
// signingSecret: process.env.SLACK_SIGNING_SECRET,
// socketMode:true, // enable the following to use socket mode
// appToken: process.env.APP_TOKEN,
});
// The echo command simply echoes on command
app.command('/room', async ({ say }) => {
try {
await ack();
say("Yaaay! that command works!");
} catch (error) {
console.log("err")
console.error(error);
}
});
(async () => {
// Start the app
await app.start('3000');
console.log('⚡️ Bolt app is running!');
})();