Skip to main content
Agents can live in Slack, Discord, and other platforms - chat naturally where your team works.

Quick Start

1

Create Slack Bot

import { Agent, SlackBot } from 'praisonai';

const agent = new Agent({
  instructions: 'You are a helpful team assistant'
});

const bot = new SlackBot({
  agent,
  token: process.env.SLACK_BOT_TOKEN,
  appToken: process.env.SLACK_APP_TOKEN
});

await bot.start();
// Bot is now live in Slack!
2

Handle Mentions

bot.on('app_mention', async (event) => {
  const response = await agent.chat(event.text);
  await bot.reply(event, response);
});

User Interaction Flow


Configuration Levels

// Level 1: Instance - Basic bot
const bot = new SlackBot({
  agent,
  token: process.env.SLACK_BOT_TOKEN
});

// Level 2: Dict - With options
const bot = new SlackBot({
  agent,
  token: process.env.SLACK_BOT_TOKEN,
  appToken: process.env.SLACK_APP_TOKEN,
  mode: 'socket'  // or 'http'
});

// Level 3: Full control - Custom handlers
const bot = new SlackBot({
  agent,
  token: process.env.SLACK_BOT_TOKEN,
  handlers: {
    message: customMessageHandler,
    reaction: customReactionHandler
  }
});

Environment Variables

VariableDescription
SLACK_BOT_TOKENBot OAuth token
SLACK_APP_TOKENApp-level token for Socket Mode
SLACK_SIGNING_SECRETFor HTTP mode verification

API Reference

BotConfig

Complete configuration options

BotProtocol

Protocol documentation

Best Practices

No public URL needed - easier for local testing.
Keep conversations organized by threading responses.
Always respond, even if just “I couldn’t process that”.