-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
app.ts
88 lines (75 loc) · 2.06 KB
/
app.ts
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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
import { Md } from 'slack-block-builder';
import { App } from '@slack/bolt';
import { LogLevel } from '@slack/logger';
import { PointdPalInstallStore } from './src/lib/services/pointdPalInstallStore';
require('dotenv').config();
require('newrelic');
import { healthEndpoint } from './src/lib/routes/health';
export let app = new App({
signingSecret: process.env.SLACK_SIGNING_SECRET,
clientId: process.env.SLACK_CLIENT_ID,
clientSecret: process.env.SLACK_CLIENT_SECRET,
stateSecret: process.env.SLACK_STATE_SECRET,
logLevel: process.env.LOG_LEVEL as LogLevel,
installationStore: PointdPalInstallStore,
tokenVerificationEnabled: true,
installerOptions: {
directInstall: true,
},
scopes: [
'app_mentions:read',
'channels:history',
'channels:manage',
'channels:read',
'channels:join',
'chat:write',
'commands',
'groups:history',
'groups:read',
'groups:write',
'im:history',
'im:read',
'im:write',
'mpim:history',
'mpim:read',
'mpim:write',
'users.profile:read',
'users:read',
'users:read.email',
'usergroups:read',
],
customRoutes: [healthEndpoint],
});
// messages
import './src/messages.crypto';
import './src/messages.scoreboard';
import './src/messages.help';
import './src/messages.plusplus';
// etc
import './src/events';
import './src/migrations';
import './src/monthlyScoreboardCron';
// hometab
import './src/hometab';
import './src/hometab.actions';
import './src/hometab.views';
//shortcuts
import './src/shortcuts';
app.action('button_click', async ({ body, ack, say }) => {
// Acknowledge the action
await ack();
await say(`${Md.user(body.user.id)} clicked the button`);
});
app.message(/.*/, async ({ message, context, logger }) => {
logger.debug('This is for logging all the things!', message, context);
//await say(context.matches.input);
});
(async () => {
// Start your app
let port = 5000;
if (process.env.PORT) {
port = parseInt(process.env.PORT, 10);
}
await app.start(port);
console.log(`⚡️ Bolt app is running at localhost:${port}!`);
})();