← All Posts

How to Build a Slack AI Bot: Complete Setup Guide

By OpenClaw Launch

Why Build an AI Bot for Slack?

Slack is where work happens for millions of teams. But it's also where information gets buried — important decisions lost in threads, answers repeated dozens of times, and context scattered across hundreds of channels. An AI bot sitting inside your Slack workspace can surface that information instantly.

Here are some real use cases teams are running today:

  • Knowledge base assistant. "What's our refund policy?" — the bot searches internal docs and gives an accurate answer in seconds.
  • Standup summaries. The bot reads the #standup channel every morning and posts a digest of what everyone is working on.
  • Code review helper. Paste a code snippet and get a review with suggestions for improvement.
  • Onboarding guide. New hires can ask the bot questions about company processes, tools, and culture instead of pinging random colleagues.
  • Meeting prep. "Summarize everything discussed in #project-alpha this week" — and the bot gives you a structured overview before your meeting.

The best part: you don't need to write a single line of code. This guide walks through the entire process using OpenClaw Launch to handle the AI infrastructure, while you focus on the Slack app configuration.

Prerequisites

You'll need:

  1. A Slack workspace where you have admin privileges (or permission to install apps).
  2. An OpenClaw Launch account — sign up at openclawlaunch.com.
  3. About 20 minutes — most of that is Slack app configuration, not the AI setup.

Step 1: Create a Slack App

Every Slack bot starts as a Slack app. Here's how to create one:

  1. Go to api.slack.com/apps and click Create New App.
  2. Choose From scratch (not from a manifest — we'll configure manually so you understand each part).
  3. Enter an app name. This is what users will see in Slack, so pick something descriptive: "AI Assistant", "TeamBot", or your company name + "AI".
  4. Select the workspace where you want to install the app.
  5. Click Create App.

You'll land on the app's Basic Information page. Keep this tab open — you'll need to come back here several times.

Step 2: Configure Bot Permissions (OAuth Scopes)

Slack uses OAuth scopes to control what your bot can do. Being precise with scopes is important — request only what you need.

  1. In the left sidebar, click OAuth & Permissions.
  2. Scroll down to ScopesBot Token Scopes.
  3. Add the following scopes:
ScopeWhat It Allows
app_mentions:readBot can read messages where it's @mentioned
chat:writeBot can send messages
channels:historyBot can read public channel messages
groups:historyBot can read private channel messages (if invited)
im:historyBot can read direct messages
im:writeBot can send direct messages
users:readBot can see basic user info (names, avatars)

These scopes cover the most common bot use cases. If you only want the bot to respond when @mentioned (not read full channel history), you can skip channels:history and groups:history.

A note on security: Don't add admin scopes unless you specifically need them. A bot with excessive permissions is a security risk. You can always add more scopes later.

Step 3: Enable Event Subscriptions

For your bot to respond to messages, Slack needs to send events to your bot's server. This is similar to how webhooks work.

  1. In the left sidebar, click Event Subscriptions.
  2. Toggle Enable Events to On.
  3. You'll need a Request URL — this is where Slack sends events. You'll get this URL after deploying your OpenClaw instance (Step 5). For now, note that you'll need to come back here.
  4. Under Subscribe to bot events, add:
  • app_mention — triggered when someone @mentions your bot.
  • message.im — triggered when someone DMs your bot.

If you want the bot to passively listen to channels (for summarization or knowledge base features), also add:

  • message.channels — messages in public channels the bot is in.
  • message.groups — messages in private channels the bot is in.

Step 4: Install the App to Your Workspace

  1. Go to OAuth & Permissions in the sidebar.
  2. Click Install to Workspace.
  3. Slack will show you a permissions screen listing everything your bot can do. Review it and click Allow.
  4. After installation, you'll see a Bot User OAuth Token starting with xoxb-. Copy this token — you'll need it for OpenClaw configuration.

You'll also need the Signing Secret from Basic InformationApp Credentials. This is used to verify that incoming requests actually come from Slack and not an impersonator.

Step 5: Deploy Your OpenClaw Instance

Now that the Slack side is configured, let's set up the AI backend.

  1. Log in to OpenClaw Launch.
  2. In the configurator, choose your AI model. For Slack bots, I recommend a model that's both fast and good at following instructions — Claude Sonnet or GPT-4.1 are excellent choices. If cost is a concern, DeepSeek V3 offers great quality at a lower price point.
  3. Under Channels, enable Slack.
  4. Paste your Bot User OAuth Token (xoxb-...).
  5. Paste your Signing Secret.
  6. Configure the system prompt. For a Slack bot, a good system prompt might be:

You are a helpful AI assistant for the [Company Name] team. You answer questions concisely and accurately. When you don't know something, say so clearly. Format responses using Slack-compatible markdown. Keep answers focused — Slack messages should be scannable, not essay-length.

  1. Optionally enable skills: web browsing (for looking up current info), code execution (for running code snippets), or file management (for handling uploaded documents).
  2. Click Deploy.

Your instance will be live in about 10 seconds. Once it's running, you'll see the gateway URL on your dashboard.

Step 6: Connect the Webhook

Go back to your Slack app's Event Subscriptions page and enter the gateway URL as the Request URL. The format will look something like:

https://your-gateway-url/webhook/slack

Slack will send a verification challenge to this URL. If your OpenClaw instance is running correctly, it'll respond and you'll see a green checkmark.

Click Save Changes.

Step 7: Test Your Bot

Your bot should now be live in your Slack workspace. Let's test it:

Test 1: Direct Message

Find your bot in Slack's sidebar under Apps (you may need to search for it). Send it a direct message like "What can you help me with?" You should get an AI-generated response within a few seconds.

Test 2: Channel Mention

Invite your bot to a channel by typing /invite @YourBotName. Then mention it: "@YourBotName what's the weather in New York?" (if you enabled web browsing). The bot should respond in a thread.

Test 3: Longer Conversation

Have a multi-turn conversation. Ask a question, then ask a follow-up. The bot should maintain context within the thread.

Troubleshooting

ProblemLikely CauseFix
Bot doesn't respond to @mentionsapp_mention event not subscribedCheck Event Subscriptions → Bot Events
Bot doesn't respond to DMsmessage.im event not subscribed or im:history scope missingAdd the event and scope, then reinstall the app
"not_authed" errorBot token is wrong or expiredRe-copy the xoxb- token from OAuth & Permissions
Bot responds but with errorsSigning secret mismatchMake sure the signing secret in OpenClaw matches the one in Basic Information
Bot only works in some channelsBot not invited to those channelsUse /invite @BotName in each channel

Use Case Deep Dives

Internal Knowledge Base

One of the most popular uses for a Slack AI bot is as an internal knowledge base. Instead of searching through Notion, Confluence, or Google Drive, team members just ask the bot.

To make this work well:

  • Include key information directly in the system prompt (company policies, product FAQs, etc.).
  • Enable the web browsing skill so the bot can access internal documentation if it's web-accessible.
  • Train team members to ask specific questions rather than vague ones.

Code Review Assistant

Developers can paste code snippets and ask the bot for reviews, explanations, or refactoring suggestions. This works best with Claude or GPT-4.1, which excel at code understanding.

Example prompt: "@AIBot review this function for potential bugs and performance issues: [code]"

Daily Standup Summaries

If your team posts standups in a channel, you can ask the bot to summarize them. This requires the channels:history scope so the bot can read channel messages.

Example: "@AIBot summarize everything posted in #standup today in bullet points"

Security Best Practices

A Slack bot with AI capabilities is powerful, and that means you need to think about security:

  • Limit channel access. Only invite the bot to channels where it's needed. Don't add it to sensitive channels like #leadership or #hr unless there's a specific reason.
  • Use minimal scopes. Only request the OAuth scopes you actually need. You can always add more later.
  • Rotate tokens periodically. If someone leaves your team and had access to the bot token, rotate it immediately.
  • Review the bot's responses. Occasionally check what the bot is saying, especially early on. AI models can sometimes generate inaccurate or inappropriate responses.
  • Set clear expectations. Tell your team that messages to the bot are processed by an AI model. Don't share sensitive credentials, passwords, or personal information with the bot.

Scaling Beyond One Workspace

If you want to deploy your AI bot to multiple Slack workspaces (for example, if you're building a product), you'll need to implement Slack's OAuth flow for distribution. This is more complex than a single-workspace install and involves:

  • Setting up OAuth redirect URLs.
  • Handling the OAuth callback to store each workspace's token.
  • Managing multiple bot instances or routing messages to the right AI backend.

For most teams, a single-workspace deployment is all you need. OpenClaw Launch makes it easy to get started — and if your needs grow, you can always scale up.

What's Next

Your Slack AI bot is now live and ready to help your team. Here are some next steps:

  • Refine the system prompt based on the types of questions your team actually asks.
  • Enable additional skills like code execution or web browsing for more capable responses.
  • Add more channels — you can run the same AI assistant on Slack, Telegram, Discord, and your website simultaneously from a single OpenClaw instance.
  • Monitor usage on your OpenClaw Launch dashboard to understand how your team uses the bot and optimize accordingly.

Ready to build your Slack AI bot? Get started on OpenClaw Launch — deployment takes about 10 seconds.

Build with OpenClaw

Deploy your own AI agent in under 10 seconds — no servers, no CLI.

Deploy Now