mirror of
https://github.com/kou029w/_.git
synced 2025-01-30 13:58:08 +00:00
bolt
This commit is contained in:
parent
41a5be34b4
commit
31c822e1c1
4 changed files with 1341 additions and 0 deletions
19
bolt/README.md
Normal file
19
bolt/README.md
Normal file
|
@ -0,0 +1,19 @@
|
|||
# bolt
|
||||
|
||||
## インストール
|
||||
|
||||
Step 1
|
||||
: Slack アプリの作成
|
||||
|
||||
[Create New Slack App](https://api.slack.com/apps?new_app=1) → [Select a workspace] → [Create]
|
||||
|
||||
- ボットユーザーを有効化
|
||||
- `app_mentions:read` `chat:write` スコープ必須
|
||||
|
||||
→ [Install to Workspace]
|
||||
|
||||
Step 2
|
||||
: Deno Deploy
|
||||
|
||||
- `SLACK_BOT_TOKEN` ... [Slack Applications](https://api.slack.com/apps) → 作成した Slack アプリ → Permissions ページにある `xoxb-` から始まるボットトークン
|
||||
- `SLACK_SIGNING_SECRET` ... [Slack Applications](https://api.slack.com/apps) → 作成した Slack アプリ → Basic Information ページにある Signing Secret
|
13
bolt/deno.json
Normal file
13
bolt/deno.json
Normal file
|
@ -0,0 +1,13 @@
|
|||
{
|
||||
"imports": {
|
||||
"@slack/bolt": "npm:@slack/bolt@^3.17.1"
|
||||
},
|
||||
"deploy": {
|
||||
"project": "b0bd997b-0b41-4348-9657-73a44c2bc25a",
|
||||
"exclude": [
|
||||
"**/node_modules"
|
||||
],
|
||||
"include": [],
|
||||
"entrypoint": "main.ts"
|
||||
}
|
||||
}
|
1295
bolt/deno.lock
generated
Normal file
1295
bolt/deno.lock
generated
Normal file
File diff suppressed because it is too large
Load diff
14
bolt/main.ts
Normal file
14
bolt/main.ts
Normal file
|
@ -0,0 +1,14 @@
|
|||
import bolt from "npm:@slack/bolt";
|
||||
|
||||
const { SLACK_BOT_TOKEN = "", SLACK_SIGNING_SECRET = "" } = Deno.env.toObject();
|
||||
|
||||
const app = new bolt.App({
|
||||
token: SLACK_BOT_TOKEN,
|
||||
signingSecret: SLACK_SIGNING_SECRET,
|
||||
});
|
||||
|
||||
app.event("app_mention", async (c) => {
|
||||
await c.say(`Pong! ${c.event.text}`);
|
||||
});
|
||||
|
||||
await app.start();
|
Loading…
Add table
Reference in a new issue