How to Install a Slackbot on Slack
This guide will walk you through the steps to install the Quivr Slackbot on your Slack workspace.Prerequisites
- Clone the Quivr Slackbot repository and install the requirements
- Have an ngrok account (for making the Slackbot accessible outside your local network)
- Have a Slack workspace where you want to install the Slackbot
Step 1: Set up the Environment
- Copy the
slackbot.env.example
file and rename it to.env
.
Step 2: Make the Slackbot Accessible
- Use ngrok to make the Quivr Slackbot accessible outside your local network.
- Save the generated URL for later use.
Step 3: Create a New Slack App
- Go to api.slack.com and create a new app.
- Select “From an app manifest” and choose the workspace where you want to use the Slackbot.
- Copy the contents of
app_manifest.json
from the Quivr repository and paste it into the app manifest field. - Click “Create” to create the app.
Step 4: Configure the Slackbot
- Copy the “Signing Secret” from the Slack app settings and paste it into the
.env
file. - Go to the “OAuth & Permissions” section and install the app to your workspace.
- Copy the “Bot User OAuth Token” and paste it into the
.env
file. - Obtain a Quivr API key from the Quivr production environment and add it to the
.env
file.
Step 5: Start the Quivr Slackbot
- Run the command
python main.py
to start the Quivr Slackbot locally.
Step 6: Configure Event Subscriptions
- In the Slack app settings, go to the “Event Subscriptions” section.
- Change the URL to the one provided by ngrok (e.g.,
https://your-ngrok-url.ngrok.io/slack/events
). - Save the changes.
Step 7: Enable Interactivity
- In the Slack app settings, go to the “Interactivity & Shortcuts” section.
- Enable interactivity and set the URL to
https://your-ngrok-url.ngrok.io/slack/interactive
. - Save the changes.
Step 8: Customize the Slackbot (Optional)
- You can change the name and background color of the Slackbot in the Slack app settings.
Step 9: Test the Slackbot
- Go to your Slack workspace and mention the Slackbot using
@quivr
(or the name you set). - Ask a question and select the brain you want to use (e.g., “quivr”).
- The Slackbot will provide an answer based on the selected brain.