APP MarketplaceContactDownload
Bot Development Guide

Build powerful bots

Slash commands, interactive buttons, modals, event listeners, and real-time WebSocket — everything you need to build Discord-style bots on Collaborix.

What bots can do

Slash Commands

Register custom /commands with options, autocomplete, and permissions.

Interactive Components

Buttons, select menus, modals, and forms that users can interact with.

Event Listeners

React to messages, reactions, member joins, channel updates, and 50+ events.

Presence

Your bot appears in the member list with a custom status and avatar.

Permissions

Fine-grained permission system. Bots only access what they need.

Real-Time Gateway

WebSocket connection for instant event delivery. No polling needed.

1. Create Your Bot

Register a new bot application in the Developer Portal and get your token.

1. Create Your Bot
bash
# 1. Go to https://collaborix.com/developers/apps
# 2. Click "Create New Application" → Select "Bot"
# 3. Give it a name, description, and avatar
# 4. Copy your Bot Token (keep it secret!)

# Your bot token looks like this:
# clx_bot_a1b2c3d4e5f6g7h8i9j0.AbCdEfGhIjKlMnOpQrStUvWxYz

# ⚠️ Never share your token or commit it to version control!
# Use environment variables instead.

2. Install the SDK

Install the official SDK for your language of choice.

2. Install the SDK
bash
# JavaScript / TypeScript
npm install @collaborix/sdk

# Python
pip install collaborix

# Go
go get github.com/collaborix/go-sdk

# Java (Gradle)
implementation 'com.collaborix:sdk:1.0.0'

# C# / .NET
dotnet add package Collaborix.SDK

# Rust
cargo add collaborix-sdk

3. Basic Bot — Hello World

The simplest possible bot: respond to a slash command.

3. Basic Bot — Hello World
javascript
import { CollaborixBot } from '@collaborix/sdk';

const bot = new CollaborixBot({
  token: process.env.BOT_TOKEN,
  intents: ['messages'],
});

// Register a slash command
bot.command('/hello', async (ctx) => {
  await ctx.reply({
    text: `👋 Hello, ${ctx.user.name}! I'm alive!`,
    ephemeral: true, // Only visible to the user who ran the command
  });
});

bot.start();
console.log('🤖 Bot is online!');

4. Listening to Events

React to messages, reactions, member joins, and more.

4. Listening to Events
javascript
// Listen for new messages
bot.on('message.created', async (event) => {
  const { message, channel, author } = event;

  // Ignore messages from bots (including ourselves)
  if (author.bot) return;

  // Auto-respond to keywords
  if (message.content.toLowerCase().includes('help')) {
    await channel.send({
      text: '📚 Here are some things I can do:',
      embeds: [{
        title: 'Available Commands',
        description: [
          '`/hello` — Say hello',
          '`/poll` — Create a poll',
          '`/remind` — Set a reminder',
          '`/stats` — Channel statistics',
        ].join('\n'),
        color: '#7C3AED',
      }],
    });
  }
});

// Listen for reactions
bot.on('reaction.added', async (event) => {
  if (event.emoji === '⭐' && event.count >= 3) {
    // Pin messages with 3+ star reactions
    await event.message.pin();
  }
});

// Listen for new members
bot.on('member.joined', async (event) => {
  const welcomeChannel = await bot.channels.find(
    event.workspace.id,
    { name: 'welcome' }
  );

  if (welcomeChannel) {
    await welcomeChannel.send({
      text: `🎉 Welcome to the team, ${event.user.name}!`,
    });
  }
});

5. Interactive Components

Add buttons, select menus, and modals to your bot messages.

5. Interactive Components
javascript
// Send a message with buttons
bot.command('/ticket', async (ctx) => {
  await ctx.reply({
    text: 'Create a support ticket:',
    components: [
      {
        type: 'action_row',
        components: [
          {
            type: 'select',
            custom_id: 'ticket_category',
            placeholder: 'Select category...',
            options: [
              { label: 'Bug Report', value: 'bug', emoji: '🐛' },
              { label: 'Feature Request', value: 'feature', emoji: '💡' },
              { label: 'Question', value: 'question', emoji: '❓' },
              { label: 'Other', value: 'other', emoji: '📝' },
            ],
          },
        ],
      },
      {
        type: 'action_row',
        components: [
          { type: 'button', label: 'Submit', style: 'primary', custom_id: 'ticket_submit' },
          { type: 'button', label: 'Cancel', style: 'secondary', custom_id: 'ticket_cancel' },
        ],
      },
    ],
  });
});

// Handle button click → open a modal
bot.action('ticket_submit', async (ctx) => {
  await ctx.openModal({
    title: 'New Support Ticket',
    custom_id: 'ticket_modal',
    fields: [
      {
        type: 'text',
        name: 'title',
        label: 'Ticket Title',
        placeholder: 'Brief description of the issue',
        required: true,
      },
      {
        type: 'textarea',
        name: 'description',
        label: 'Details',
        placeholder: 'Provide as much detail as possible...',
        required: true,
        max_length: 2000,
      },
      {
        type: 'select',
        name: 'priority',
        label: 'Priority',
        options: ['Low', 'Medium', 'High', 'Critical'],
      },
    ],
  });
});

// Handle modal submission
bot.modal('ticket_modal', async (ctx) => {
  const { title, description, priority } = ctx.fields;

  // Create a ticket channel
  const ticketChannel = await bot.channels.create(ctx.workspace.id, {
    name: `ticket-${Date.now()}`,
    type: 'text',
    private: true,
  });

  await ticketChannel.send({
    embeds: [{
      title: `🎫 ${title}`,
      description,
      color: priority === 'Critical' ? '#EF4444' : '#7C3AED',
      fields: [
        { name: 'Priority', value: priority, inline: true },
        { name: 'Reporter', value: ctx.user.name, inline: true },
        { name: 'Status', value: 'Open', inline: true },
      ],
    }],
  });

  await ctx.reply({
    text: `✅ Ticket created in #${ticketChannel.name}`,
    ephemeral: true,
  });
});

6. Deploy & Publish

Host your bot and optionally publish it to the Marketplace.

6. Deploy & Publish
dockerfile
# Deploy options:
# 1. Any Node.js hosting (Railway, Render, Fly.io, AWS, etc.)
# 2. Docker container
# 3. Serverless (AWS Lambda, Cloudflare Workers)

# Example Dockerfile
FROM node:20-alpine
WORKDIR /app
COPY package*.json ./
RUN npm ci --production
COPY . .
CMD ["node", "bot.js"]

# Environment variables needed:
# BOT_TOKEN=clx_bot_your_token_here

# To publish to the Marketplace:
# 1. Go to Developer Portal → Your App → Settings
# 2. Add description, screenshots, and category
# 3. Click "Submit for Review"
# 4. Review takes 1-3 business days
# 5. Once approved, your bot is live! 🎉

Ready to build your bot?

Register your app, grab your token, and start coding.

Collaborix

Chat. Call. Collaborate. All-in-One. AI-powered voice, video & collaboration — unified.

PYRAX Ecosystem

Product

  • Features
  • Channels
  • AI Features
  • Pricing
  • Download Apps
  • Get Started

Company

  • About
  • Contact Us
  • Blog
  • Careers
  • Media Kit
  • Status

Developers

  • Developer Portal
  • Documentation
  • SDKs
  • Bot Guide
  • Register an App
  • Marketplace

Legal

  • Privacy Policy
  • Terms of Service
  • Cookie Policy
  • GDPR
  • Status

© 2026 Collaborix. All rights reserved. A PYRAX Ecosystem product.

PrivacyTermsStatus