Skip to content

Commit bb9ca7e

Browse files
authored
Update README.md
1 parent e763fb9 commit bb9ca7e

File tree

1 file changed

+75
-13
lines changed

1 file changed

+75
-13
lines changed

README.md

Lines changed: 75 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,42 @@
11
<div align="center">
2-
<img src="./screenshot.jpeg" width="700" alt="Screenshot of a conversation between a person and ChatGPT">
2+
<img src="./screenshots/header.jpeg" width="700" alt="Screenshot of a conversation between a person and ChatGPT" />
33
<h3>Integrate <a href="https://openai.com/blog/chatgpt" target="_blank">ChatGPT</a> into Slack using a Slack app hosted on <a href="https://workers.cloudflare.com" target="_blank">Cloudflare Workers</a>.</h3>
4-
</div>
4+
5+
✨ Features&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;🚀 Getting Started&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;💻 Running the Project Locally&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Built with ❤️ by Shape</div>
6+
7+
## ✨ Features
8+
9+
slack-chatgpt can be used to interact with ChatGPT in several ways on Slack.
10+
11+
#### Mentions
12+
13+
When mentioning the bot, it will post a reply in a thread so it does not clutter the conversation.
14+
15+
<img src="./screenshots/mention.png" width="500" />
16+
17+
#### Direct Messages
18+
19+
People in the workspace can write messages messages to the bot in which case it replies directly within the conversation.
20+
21+
<img src="./screenshots/dm.png" width="500" />
22+
23+
#### Slash Command
24+
25+
Use the slash command to ask ChatGPT a question and have it reply within the conversation.
26+
27+
<img src="./screenshots/command.png" width="300" />
28+
29+
#### Shortcut on Message
30+
31+
The shortcut on messages can be used to answer a message using ChatGPT.
32+
33+
<img src="./screenshots/shortcut-on-message.png" width="500" />
34+
35+
#### Global Shortcut
36+
37+
The global shortcut can be used to have ChatGPT help you write a message and then send that message to a channel or you can copy the message and send it yourself.
38+
39+
<img src="./screenshots/global-shortcut.png" width="400" />
540

641
## 🚀 Getting Started
742

@@ -30,17 +65,44 @@ You will need an OpenAI account to access the ChatGPT API.
3065

3166
### Create a Slack App
3267

33-
The Slack app will be used to listen for request in Slack and post messages back into Slack.
34-
35-
1. Create a Slack app [here](https://api.slack.com/apps).
36-
2. Enable Event Subscriptions and specify the URL to your Cloudflare Worker followed by the path `/events`, e.g. `https://slack-chatgpt.shapehq.workers.dev/events`.
37-
3. Subscribe to the `app_mention` and `message.im` event names.
38-
4. Enable Interactivity and specify the URL to your Cloudflare Worker followed by the path `/shortcuts`, e.g. `https://slack-chatgpt.shapehq.workers.dev/shortcuts`.
39-
5. Add a Shortcut with the callback ID `ask_chatgpt_shortcut`.
40-
6. Add the Bots feature to the Slack app.
41-
7. Add the `app_mentions:read`, `chat:write`, `commands`, `im:history`, and `chat:write.public` scopes to the bot.
42-
8. Take note of the bot's OAuth token. This is used to post messages back into Slack.
43-
9. Finally, take note of the signing secret. We will need this later to verify that requests are coming from Slack.
68+
The Slack app will be used to listen for request in Slack and post messages back into Slack. In order to support all of slack-chatgpt's features, there are a couple of steps needed. However, you can also choose to setup just the features you need.
69+
70+
Start by creating a Slack app on [api.slack.com/apps](https://api.slack.com/apps). You are free to choose any name for the app that fits your needs.
71+
72+
Make sure to add the Bots feature to the Slack app and add the following scopes:
73+
74+
- `app_mentions:read`
75+
- `chat:write`
76+
- `commands`
77+
- `im:history`
78+
- `chat:write.public`
79+
80+
Take note of your bot's OAuth token and your app's signing secret as you will need [add bot to your Cloudflare worker later](https://github.com/shapehq/slack-chatgpt#add-your-secrets-to-the-cloudflare-worker).
81+
82+
#### Responding to Mentions and Direct Messages
83+
84+
In order for the bot to respond to mentions and direct messages, you must enable Event Subscriptions in your Slack app and pass the URL to your Cloudflare Worker followed by the path `/events`, e.g. `https://slack-chatgpt.shapehq.workers.dev/events`.
85+
86+
Make sure to subscribe to the following events:
87+
88+
- `app_mention`
89+
- `message.im`
90+
91+
#### Enabling the Slash Command
92+
93+
Add a slash command to your Slack app. You are free to choose the command, description, and usage hint that fits your needs but make sure to set the URL to your Cloudflare Worker followed by the path `/commands`, e.g. `https://slack-chatgpt.shapehq.workers.dev/commands`.
94+
95+
#### Adding the Shortcut to Messages
96+
97+
In order to respond to a message using ChatGPT, you must enable interactivity on your Slack app. Make sure to set the URL to your Cloudflare Worker followed by the path `/interactivity`, e.g. `https://slack-chatgpt.shapehq.workers.dev/interactivity`.
98+
99+
Then create a new shortcut and select "On messages" when asked about where the shortcut should appear. You are free to choose the name and description that fit your needs but make sure to set the callback ID to `ask_chatgpt_on_message`.
100+
101+
#### Adding the Global Shortcut
102+
103+
To add the global shortcut to your workspace, you must enable interactivity on your Slack app. You may have already done this when adding the shortcut to messages. When enabling interactivity, you should make sure to set the URL to your Cloudflare Worker followed by the path `/interactivity`, e.g. `https://slack-chatgpt.shapehq.workers.dev/interactivity`.
104+
105+
Then create a new shortcut and select "Global" when asked about where the shortcut should appear. You are free to choose the name and description that fit your needs but make sure to set the callback ID to `ask_chatgpt_global`.
44106

45107
### Add Your Secrets to the Cloudflare Worker
46108

0 commit comments

Comments
 (0)