Guides7 min read

Customer Support Bot Setup Guide

Deploy an AI customer support bot for your business. Set up OpenClaw or OpenClaw to handle customer inquiries on Discord and Telegram.

Published: 27/01/2025

Overview

An AI-powered customer support bot can handle common inquiries 24/7, reducing response times and freeing your team for complex issues. This guide shows you how to set up a professional support bot using OpenClaw or OpenClaw.

Use Cases

  • FAQ Handling: Answer common questions automatically
  • Order Status: Check order/ticket status
  • Product Information: Provide details about products/services
  • Booking/Scheduling: Help users book appointments
  • Triage: Route complex issues to human agents
  • After-Hours Support: Provide help when team is offline

Architecture

Customer Message (Discord/Telegram/WhatsApp)
    ↓
[Your VPS - Support Bot]
    ↓
[Knowledge Base + AI]
    ↓
Response / Escalation

Setup Guide

1. Prepare Your Knowledge Base

Create a knowledge base file the bot can reference:

# knowledge-base.md

## Company Information
- Company Name: [Your Company]
- Support Hours: 9 AM - 6 PM GMT
- Email: support@yourcompany.com
- Phone: +44 xxx xxx xxxx

## Products/Services
### Product A
- Price: £99
- Features: Feature 1, Feature 2, Feature 3
- Delivery: 3-5 business days

### Product B
- Price: £149
- Features: Feature 1, Feature 2
- Delivery: 1-2 business days

## Common Questions

### Returns
We offer 30-day returns for unused items. Contact support@yourcompany.com with your order number.

### Shipping
UK: 3-5 business days
EU: 5-10 business days
International: 10-15 business days

### Payment Methods
We accept Visa, Mastercard, PayPal, and bank transfer.

## Troubleshooting

### Login Issues
1. Try resetting your password
2. Clear browser cache
3. Contact support if persists

### Order Not Received
1. Check tracking number in confirmation email
2. Allow full delivery window
3. Contact support after delivery window

2. Configure the System Prompt

SYSTEM_PROMPT="You are a customer support assistant for [Company Name].

Your role:
- Answer questions using the knowledge base provided
- Be helpful, professional, and friendly
- If you don't know something, say so and offer to escalate
- Never make up information about products, prices, or policies
- Collect order numbers/email addresses when relevant

When you can't help:
- Apologize for the inconvenience
- Offer to connect them with human support
- Provide the support email: support@yourcompany.com

Always end by asking if there's anything else you can help with."

3. Environment Configuration

# AI Provider
AI_PROVIDER=anthropic
ANTHROPIC_API_KEY=your-key
AI_MODEL=claude-3-5-sonnet-20241022

# Bot Settings
BOT_NAME=Support Assistant
KNOWLEDGE_BASE_PATH=/opt/bot/knowledge-base.md

# Platform
DISCORD_ENABLED=true
DISCORD_TOKEN=your-token

# Support Settings
SUPPORT_CHANNEL_ID=123456789
ESCALATION_ROLE_ID=987654321
SUPPORT_EMAIL=support@yourcompany.com

# Handoff
ENABLE_HUMAN_HANDOFF=true
HANDOFF_TRIGGER_WORDS=speak to human,real person,agent please

4. Channel Setup (Discord)

Create a dedicated support channel:

  1. Create #support channel
  2. Set channel topic: "AI-powered support - type your question"
  3. Configure bot to only respond in this channel
  4. Set up category for ticket threads
// Bot responds only in support channel
if (message.channel.id !== process.env.SUPPORT_CHANNEL_ID) {
  return; // Ignore messages elsewhere
}

Professional Features

Ticket System

Create tickets for tracking:

async function createTicket(user, issue) {
  const ticketId = generateTicketId();

  // Create thread for conversation
  const thread = await channel.threads.create({
    name: `Ticket-${ticketId}: ${issue.substring(0, 50)}`,
    autoArchiveDuration: 1440
  });

  // Log ticket
  await logTicket({
    id: ticketId,
    user: user.id,
    issue,
    status: 'open',
    created: new Date()
  });

  return thread;
}

Human Handoff

Escalate to human agents when needed:

const ESCALATION_TRIGGERS = [
  'speak to human',
  'real person',
  'talk to agent',
  'not helping',
  'frustrated'
];

async function checkEscalation(message) {
  const needsHuman = ESCALATION_TRIGGERS.some(trigger =>
    message.toLowerCase().includes(trigger)
  );

  if (needsHuman) {
    await notifySupport(message);
    return "I understand you'd like to speak with a human agent. " +
           "I've notified our team and someone will be with you shortly. " +
           "You can also email support@yourcompany.com for immediate assistance.";
  }

  return null;
}

Business Hours Awareness

function isBusinessHours() {
  const now = new Date();
  const hour = now.getUTCHours();
  const day = now.getUTCDay();

  // 9 AM - 6 PM GMT, Monday-Friday
  return day >= 1 && day <= 5 && hour >= 9 && hour < 18;
}

async function handleMessage(message) {
  if (!isBusinessHours()) {
    return await handleAfterHours(message);
  }
  return await handleNormalSupport(message);
}

async function handleAfterHours(message) {
  // Still try to help with AI
  const response = await getAIResponse(message);

  return response + "\n\n*Note: Our team is currently offline. " +
         "If this is urgent, email support@yourcompany.com and we'll " +
         "respond first thing tomorrow.*";
}

Sentiment Detection

Detect frustrated customers:

const NEGATIVE_INDICATORS = [
  'terrible', 'awful', 'worst', 'angry', 'frustrated',
  'ridiculous', 'unacceptable', 'disappointed'
];

async function analyzeSentiment(message) {
  const isNegative = NEGATIVE_INDICATORS.some(word =>
    message.toLowerCase().includes(word)
  );

  if (isNegative) {
    // Prioritize this conversation
    await flagForPriority(message);

    // Respond empathetically
    return "I'm really sorry to hear you're having a difficult experience. " +
           "Let me see how I can help resolve this for you.";
  }

  return null;
}

Integration Examples

Order Status Check

async function checkOrderStatus(orderNumber) {
  // Connect to your order system
  const order = await orderAPI.getOrder(orderNumber);

  if (!order) {
    return "I couldn't find that order number. Please double-check " +
           "and make sure to include any letters (e.g., ORD-12345).";
  }

  return `Here's your order status:

**Order:** ${order.number}
**Status:** ${order.status}
**Placed:** ${order.date}
**Tracking:** ${order.tracking || 'Not yet available'}
**Expected Delivery:** ${order.estimatedDelivery}`;
}

Booking System

async function handleBooking(userMessage) {
  // Parse booking intent
  if (userMessage.includes('book') || userMessage.includes('appointment')) {
    const availableSlots = await getAvailableSlots();

    return `I can help you book an appointment. Here are available times:

${availableSlots.map(s => `- ${s.day}: ${s.time}`).join('\n')}

Please let me know which slot works for you, and I'll need:
- Your name
- Email address
- Brief description of what you need help with`;
  }
}

Analytics and Monitoring

Track Key Metrics

const metrics = {
  totalConversations: 0,
  resolvedByBot: 0,
  escalatedToHuman: 0,
  avgResponseTime: 0,
  satisfactionScore: 0
};

async function logInteraction(interaction) {
  await db.insert('support_logs', {
    timestamp: new Date(),
    userId: interaction.user,
    question: interaction.question,
    response: interaction.response,
    resolved: interaction.resolved,
    escalated: interaction.escalated,
    responseTime: interaction.responseTime
  });
}

Daily Report

// Cron job for daily summary
async function dailySupportReport() {
  const stats = await getYesterdayStats();

  const report = `
**Daily Support Report**

📊 **Volume**
- Total conversations: ${stats.total}
- Resolved by AI: ${stats.resolved} (${stats.resolvedRate}%)
- Escalated: ${stats.escalated}

⏱️ **Performance**
- Avg response time: ${stats.avgResponse}s
- Avg resolution time: ${stats.avgResolution}

❓ **Top Questions**
${stats.topQuestions.map((q, i) => `${i+1}. ${q}`).join('\n')}

🔴 **Issues Needing Attention**
${stats.openIssues.map(i => `- ${i}`).join('\n')}
  `;

  await sendToAdminChannel(report);
}

Best Practices

Do's

  • ✅ Keep knowledge base updated
  • ✅ Set clear expectations about bot capabilities
  • ✅ Always offer human escalation option
  • ✅ Log all interactions for improvement
  • ✅ Respond to negative sentiment with empathy
  • ✅ Include business hours in responses

Don'ts

  • ❌ Pretend to be human
  • ❌ Make up information
  • ❌ Leave customers without escalation path
  • ❌ Ignore negative feedback
  • ❌ Process payments through chat

Compliance Considerations

GDPR

  • Inform users they're chatting with AI
  • Don't store unnecessary personal data
  • Allow data deletion requests
  • Log retention policy (30-90 days typical)

Example Disclosure

Hi! I'm an AI-powered support assistant for [Company].
I can help with common questions about orders, products, and policies.
For complex issues, I can connect you with our human support team.
How can I help you today?

Related Guides

Need Help?

Setting up a professional support bot requires careful configuration. Our premium service includes customer support bot setup with knowledge base integration and analytics.

Need a VPS for Your Bot?

We recommend Hostinger KVM 2 VPS - reliable, fast, and perfect for AI chatbots. Get started with our recommended setup.

Get Hostinger VPS

Need Help With Setup?

Got your VPS? Let us handle the technical work. Professional setup and maintenance for OpenClaw (formerly Clawd.bot).