|
1 | | -# Bolt for JavaScript (TypeScript) Template App |
| 1 | +# `@recaptimebot/slack` - The Recap Time Bot Slack App |
2 | 2 |
|
3 | | -This is a generic Bolt for JavaScript (TypeScript) template app used to build out Slack apps. |
| 3 | + |
| 4 | +[](https://wiki.recaptime.dev/handbook/tools/recaptimebot#slack-app) |
| 5 | +[](https://github.com/slack-samples/bolt-ts-starter-template/graphs/commit-activity) |
| 6 | +[](https://github.com/recaptime-dev/squad-bots/blob/main/LICENSE) |
| 7 | +[](https://twitter.com/ajhalili2006) |
4 | 8 |
|
5 | | -Before getting started, make sure you have a development workspace where you have permissions to install apps. If you don’t have one setup, go ahead and [create one](https://slack.com/create). |
| 9 | +The multitool @RecapTimeBot Slack app for Recap Time Squad's channels and projects on Hack Club HQ Slack workspace. |
6 | 10 |
|
7 | | -## Installation |
| 11 | +### 🏠 [Homepage and docs](https://wiki.recaptime.dev/handbook/tools/recaptimebot#slack-app) (coming soon) |
8 | 12 |
|
9 | | -#### Create a Slack App |
| 13 | +### ✨ [Try the bot on Hack Club HQ Slack](https://hackclub.slack.com) |
10 | 14 |
|
11 | | -1. Open [https://api.slack.com/apps/new](https://api.slack.com/apps/new) and choose "From an app manifest" |
12 | | -2. Choose the workspace you want to install the application to |
13 | | -3. Copy the contents of [manifest.json](./manifest.json) into the text box that says `*Paste your manifest code here*` (within the JSON tab) and click _Next_ |
14 | | -4. Review the configuration and click _Create_ |
15 | | -5. Click _Install to Workspace_ and _Allow_ on the screen that follows. You'll then be redirected to the App Configuration dashboard. |
| 15 | +## Setup |
16 | 16 |
|
17 | | -#### Environment Variables |
| 17 | +```sh |
| 18 | +# Install deps |
| 19 | +npm install |
18 | 20 |
|
19 | | -Before you can run the app, you'll need to store some environment variables. |
20 | 21 |
|
21 | | -1. Copy `env.sample` to `.env` |
22 | | -2. Open your apps configuration page from [this list](https://api.slack.com/apps), click _OAuth & Permissions_ in the left hand menu, then copy the _Bot User OAuth Token_ into your `.env` file under `SLACK_BOT_TOKEN` |
23 | | -3. Click _Basic Information_ from the left hand menu and follow the steps in the _App-Level Tokens_ section to create an app-level token with the `connections:write` scope. Copy that token into your `.env` as `SLACK_APP_TOKEN`. |
24 | | - |
25 | | -#### Install Dependencies |
26 | | - |
27 | | -`npm install` |
28 | | - |
29 | | -#### Run Bolt Server |
30 | | - |
31 | | -`npm start` |
32 | | - |
33 | | -## Project Structure |
34 | | - |
35 | | -### `manifest.json` |
36 | | - |
37 | | -`manifest.json` is a configuration for Slack apps. With a manifest, you can create an app with a pre-defined configuration, or adjust the configuration of an existing app. |
| 22 | +# Ask @ajhalili2006 for the .env.keys on |
| 23 | +# Hack Club Slack at #recaptime-dev channel. |
| 24 | +# Just don't leak them. |
| 25 | +``` |
38 | 26 |
|
39 | | -### `app.ts` |
| 27 | +## Usage |
40 | 28 |
|
41 | | -`app.ts` is the entry point for the application and is the file you'll run to start the server. This project aims to keep this file as thin as possible, primarily using it as a way to route inbound requests. |
| 29 | +* Run using dev database: `npm run dev` |
| 30 | +* Run in production: `npm run start` |
| 31 | +* Migrate database: `npm run migrate:prod` (or `dotenvx run -f .env.production -- npx prism push db`) |
42 | 32 |
|
43 | | -### `/listeners` |
| 33 | +## Author |
44 | 34 |
|
45 | | -Every incoming request is routed to a "listener". Inside this directory, we group each listener based on the Slack Platform feature used, so `/listeners/shortcuts` handles incoming [Shortcuts](https://api.slack.com/interactivity/shortcuts) requests, `/listeners/views` handles [View submissions](https://api.slack.com/reference/interaction-payloads/views#view_submission) and so on. |
| 35 | +👤 **Andrei Jiroh Halili** - SABDFL at RecapTime.dev, Hack Clubber since Arcade 2024 |
46 | 36 |
|
47 | | -## App Distribution / OAuth |
| 37 | +* Website: https://links.andreijiroh.dev |
| 38 | +* Fediverse: [@ajhalili2006@tilde.zone](https://tilde.zone/@ajhalili2006) |
| 39 | +* Twitter: [@ajhalili2006](https://twitter.com/ajhalili2006) |
| 40 | +* Github: [@ajhalili2006](https://github.com/ajhalili2006) |
| 41 | +* LinkedIn: [@ajhalili2006](https://linkedin.com/in/ajhalili2006) |
48 | 42 |
|
49 | | -Only implement OAuth if you plan to distribute your application across multiple workspaces. A separate `app-oauth.ts` file can be found with relevant OAuth settings. |
| 43 | +## 🤝 Contributing |
50 | 44 |
|
51 | | -When using OAuth, Slack requires a public URL where it can send requests. In this template app, we've used [`ngrok`](https://ngrok.com/download). Checkout [this guide](https://ngrok.com/docs#getting-started-expose) for setting it up. |
| 45 | +Contributions, issues and feature requests are welcome! |
52 | 46 |
|
53 | | -Start `ngrok` to access the app on an external network and create a redirect URL for OAuth. |
| 47 | +Feel free to check [the meta issue tracker](https://github.com/recaptime-dev/community/issues). You can also take a look at the [contributing guide](../../CONTRIBUTING.md). |
54 | 48 |
|
55 | | -``` |
56 | | -ngrok http 3000 |
57 | | -``` |
| 49 | +## 📝 License |
58 | 50 |
|
59 | | -This output should include a forwarding address for `http` and `https` (we'll use `https`). It should look something like the following: |
| 51 | +Copyright © 2024 [Andrei Jiroh Halili](https://github.com/ajhalili2006) of Recap Time Squad and contributors. |
60 | 52 |
|
61 | | -``` |
62 | | -Forwarding https://3cb89939.ngrok.io -> http://localhost:3000 |
63 | | -``` |
| 53 | +This project is [MPL-2.0](https://github.com/recaptime-dev/squad-bots/blob/main/LICENSE) licensed. |
64 | 54 |
|
65 | | -Navigate to **OAuth & Permissions** in your app configuration and click **Add a Redirect URL**. The redirect URL should be set to your `ngrok` forwarding address with the `slack/oauth_redirect` path appended. For example: |
| 55 | +--- |
66 | 56 |
|
67 | | -``` |
68 | | -https://3cb89939.ngrok.io/slack/oauth_redirect |
69 | | -``` |
| 57 | +_This README was generated with ❤️ by [readme-md-generator](https://github.com/kefranabg/readme-md-generator)_ |
0 commit comments