-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathindex.js
More file actions
32 lines (27 loc) · 740 Bytes
/
index.js
File metadata and controls
32 lines (27 loc) · 740 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
const { App } = require('@slack/bolt');
require('dotenv').config();
const app = new App({
signingSecret: process.env.SIGNING_SECRET,
token: process.env.TOKEN,
socketMode: true,
appToken: process.env.APP_TOKEN,
});
app.message(async ({ message, context }) => {
if (message.user === process.env.USER_ID) {
try {
const result = await app.client.reactions.add({
token: context.botToken,
name: 'heavy_plus_sign',
channel: message.channel,
timestamp: message.ts,
});
} catch (error) {
console.error(error);
}
}
});
(async () => {
const port = process.env.PORT || 3000;
await app.start(port);
console.log(`⚡️ reacting-app is running on port ${port}`);
})();