-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.js
38 lines (32 loc) · 903 Bytes
/
index.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
33
34
35
36
37
38
const dotenv = require("dotenv");
dotenv.config();
const { App } = require("@slack/bolt");
// Initializes your app with your bot token and signing secret
const app = new App({
token: process.env.SLACK_BOT_TOKEN,
signingSecret: process.env.SLACK_SIGNING_SECRET,
});
app.shortcut(
"add_to_getdocumentai_drive_message_shortcut",
async ({ shortcut, body, ack, context, client }) => {
await ack();
console.log(shortcut);
}
);
app.shortcut(
"add_to_getdocumentai_drive_message_shortcut",
async ({ shortcut, ack, client }) => {
try {
await ack();
console.log("Shortcut Clicked", shortcut, ack, client);
// Trigger to open a modal which shows add to drive
} catch (err) {
console.error("LOG:Error" + err);
}
}
);
(async () => {
// Start your app
await app.start(process.env.PORT || 5000);
console.log("⚡️ Bolt app is running!");
})();