Skip to content

docs(slack): add instructions for Slack to facilitate direct messaging the app #1

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 3, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 12 additions & 4 deletions docs/apps/integrations/slack.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,19 @@ id: slack
title: Slack
---

To call your Promptly app from a Slack channel, you need to first create a Slack app in your Slack workspace and use that configuration in your app's `Integration -> Slack` configuration. Follow the steps below to set up a Slack app to call your Promptly app.
To call your Promptly app from Slack through app mentions in channels or by direct messaging the app, you need to first create a Slack app in your Slack workspace and use that configuration in your app's `Integration -> Slack` configuration. Follow the steps below to set up a Slack app to call your Promptly app.

![Slack Integration](/img/ui/slack.png)

## Create a Slack App

To create a Slack app, visit [https://api.slack.com/apps](https://api.slack.com/apps) and click the `Create New App` button. Pick `From scratch`, you’ll be prompted to give your app a name and select a workspace to install it in. Once you’ve done that, you’ll be taken to the app configuration page.

Click on `OAuth & Permissions` under `Features` section in the sidebar and add the following scopes under `Bot Token Scopes` section:
Click on `OAuth & Permissions` under `Features` section in the sidebar and add the following scopes under `Scopes` section:

**Bot Token Scopes:** `app_mentions:read`, `channels:history`, `channels:read`, `chat:write`, `chat:write.customize`, `chat:write.public`, `commands`, `groups:history`, `im:history`, `im:read`, `im:write`, `incoming-webhook`, `mpim:history`, `mpim:read`, `mpim:write`, `users:read`, `users:read.email`

**User Token Scopes:** `channels.read`, `chat.write`, `users.profile:read`, `users:read`

Once added, click on `Install to Workspace` button under `OAuth Tokens for the workspace` section. You’ll be prompted to authorize the app to be installed in your workspace. Click `Allow` to install the app in your workspace. Once done, you’ll be taken back to the app configuration page where you can see `Bot User OAuth Token`.

Expand All @@ -27,6 +31,10 @@ Now go to your Slack app’s configuration page and click on `Event Subscription

After this, you’ll need to subscribe to the following bot events under `Subscribe to Bot Events` section:

`app_mention`
`app_mention`, `message.channels`, `message.groups`, `message.im`, `message.mpim`.

Click `Save Changes` to save the configuration. You’ll be prompted to reinstall the app in your workspace. Click `Reinstall App` to reinstall the app in your workspace.

To facilitate direct messaging with the app, access `App Home` under the `Features` section and activate the `Messages Tab` in the `Show Tabs` section.

Click `Save Changes` to save the configuration. You’ll be prompted to reinstall the app in your workspace. Click `Reinstall App` to reinstall the app in your workspace. You should now be able to add the app to your Slack channels and call it from there which will trigger the LLM app and return the output.
With these settings configured, you can now add the app to your Slack channels and interact with it. This interaction will activate the LLM app and return the output.