Messaging Platforms

Slack App

Integrate your AI agent as a Slack bot. Users can interact with your agent directly in Slack channels or via direct messages. Supports slash commands, mentions, and interactive components.

Features

  • Slack bot integration
  • Channel and DM support
  • Slash commands
  • Interactive components
  • Thread replies
  • File attachments
  • User mentions
  • Rich message formatting

Requirements

  • Slack workspace
  • Slack App created
  • OAuth tokens
  • Event subscription webhook
  • Bot token

Setup

  1. 1Create Slack App in Slack API dashboard
  2. 2Configure OAuth redirect URL
  3. 3Connect "Slack App" integration
  4. 4Authorize with Slack OAuth
  5. 5Install app to workspace
  6. 6Configure bot permissions
  7. 7Set up event subscriptions
  8. 8Test bot in Slack

Authentication

OAuth 2.0 with Slack

Webhook Events

  • message.channelsMessages in channels
  • message.imDirect messages
  • app_mentionBot mentions
  • slash_commandSlash commands

Code Examples

JavaScript

// Slack event webhook handler
app.post('/slack/events', (req, res) => {
  const event = req.body.event;
  
  if (event.type === 'message' && !event.subtype) {
    // Forward to AI agent
    forwardToAgent(event.text, event.channel);
  }
  
  res.status(200).send();
});