-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 8a5a43b
Showing
4 changed files
with
1,119 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
node_modules | ||
.env |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
const { App } = require('@slack/bolt'); | ||
|
||
const app = new App({ | ||
token: process.env.SLACK_BOT_TOKEN, | ||
signingSecret: process.env.SLACK_SIGNING_SECRET | ||
}); | ||
|
||
// Listens to incoming messages that contain "hello" | ||
app.message('hello', async ({ message, say }) => { | ||
// say() sends a message to the channel where the event was triggered | ||
await say(`Hey there <@${message.user}>!`); | ||
}); | ||
|
||
app.message('time', async ({ message, say }) => { | ||
// say() sends a message to the channel where the event was triggered | ||
const date = new Date(); | ||
await say(`The time is ${date.getHours()}:${date.getMinutes()}`); | ||
}); | ||
|
||
(async () => { | ||
// Start your app | ||
await app.start(process.env.PORT || 3000); | ||
|
||
console.log('⚡️ Bolt app is running!'); | ||
})(); |
Oops, something went wrong.