Skip to main content

AI Slack Channel Summarizer

This guide will walk you through the steps to set up a Slack bot that summarizes channels using GPT-4.

Features

  • Gather data from websites
  • Send processed data to Slack

Step 1: Fork the template

Login to Replit and then fork the AI Slack summary template, select the + Use Template button at the top right of the page. Follow the onscreen instructions to complete the fork and create a Repl.

Step 2: Create the app in the Slack developer portal

Follow the instructions below to create and install a Slack app into your Slack workspace:

  1. Navigate to Your Apps page and select Create an App.
  2. Choose From an app manifest from the options.
  3. Select a Workspace from the dropdown menu and then select Next.
  4. Replace the JSON content with the content of the manifest.json file, then select Next.
  5. Review and configure your OAuth permissions, Features, and Settings, then select Create.
  6. Select Install the App.

Note: You might need admin approval to install the App based on your organization's policies.

Step 3: Get tokens from Slack developer portal

Follow these instructions to obtain the necessary tokens:

  1. SLACK_BOT_TOKEN: Navigate to your Slack App page, then to Settings -> Install App. Under OAuth Tokens for your Workspace, copy the Bot User OAuth Token and use it to update the SLACK_BOT_TOKEN Secret key in your Repl.
  2. SLACK_SIGNING_SECRET: On your Slack App page, go to Settings -> Basic Information. In the App Credentials section, locate the Signing Secret and use it to update the SLACK_SIGNING_SECRET Secret key in your Repl.
  3. SLACK_APP_TOKEN: On your Slack App page, go to Settings -> Basic Information. In the App-Level Tokens section, select Generate Token and Scopes. Add a Token Name, choose your desired permissions, and select Generate. Copy the generated token and use it to update the SLACK_APP_TOKEN Secret key in your Repl.
  4. OPENAI_API_KEY: The API key is generated by registering your application on the open API provider's platform and creating a new application within their developer portal. The key is then generated and provided for authentication purposes.

Save all of these secrets to Replit by opening the Secrets tab in the Replit Workspace and pasting the values in.

Step 4: Deploy your Slack bot on Replit

In the Workspace header, select the Deploy button located on the top right of your Repl, and from the available types of Deployments, choose Reserved VM Deployments. Select the Set up your deployment button, followed by the Deploy button to deploy your application.

Step 5: Testing your bot

To summarize a channel, add your App to the channel and send it a direct message. Then, use the command summarize-channel #my-channel 24 to summarize the activity in #my-channel from the past 24 hours.

Example:

/summarize-channel #my-channel 24

This command summarizes the #my-channel channel from the previous 24 hours. Adjust the channel name and duration according to your preferences.

Further customization

  • Customizable summarization criteria: Customize summaries to focus on specific keywords or topics.
  • Integration with additional platforms: Extend functionality by integrating with other platforms.
  • Personalized alert messages: Customize message content and formatting for Slack alerts.
  • Dynamic summarization frequency: Set different summarization intervals for channels or topics.
Was this helpful?