Documentation

Everything you need to know about hosting Discord bots on fract.dev. From quick start guides to advanced configuration.

Quick Start

Get your Discord bot deployed in under 5 minutes

1
Install the CLI
Get started with our command-line interface
npm install -g @fract/cli
2
Login to your account
Authenticate with your fract.dev credentials
fract login
3
Deploy your bot
Deploy your Discord bot with a single command
fract deploy ./my-bot

Documentation Sections

Explore our comprehensive guides and references

Getting Started
Learn the basics of Discord bot hosting
  • Quick Start Guide
  • Account Setup
  • First Deployment
  • Dashboard Overview
API Reference
Complete API documentation and examples
  • REST API
  • WebSocket Events
  • Authentication
  • Rate Limits
Deployment
Deploy and manage your Discord bots
  • CLI Commands
  • Environment Variables
  • Scaling
  • Monitoring
Security
Keep your bots and data secure
  • Best Practices
  • Token Management
  • Permissions
  • Audit Logs
Infrastructure
Understanding our hosting platform
  • Architecture
  • Regions
  • Performance
  • Reliability
Community
Connect with other developers
  • Discord Server
  • GitHub
  • Examples
  • Tutorials

Code Examples

Ready-to-use code snippets to get you started

Basic Bot Deployment
bash
# Initialize a new bot project
fract init my-discord-bot

# Configure your bot
cd my-discord-bot
fract config set token YOUR_BOT_TOKEN

# Deploy to production
fract deploy --env production
Environment Configuration
yaml
# fract.yml
name: my-discord-bot
runtime: node18
memory: 512MB
env:
  NODE_ENV: production
  DEBUG: false
scaling:
  min: 1
  max: 3
Discord.js Example
javascript
const { Client, GatewayIntentBits } = require('discord.js');

const client = new Client({
  intents: [GatewayIntentBits.Guilds, GatewayIntentBits.GuildMessages]
});

client.once('ready', () => {
  console.log('Bot is ready!');
});

client.on('messageCreate', message => {
  if (message.content === '!ping') {
    message.reply('Pong!');
  }
});

client.login(process.env.DISCORD_TOKEN);

Need More Help?

Can't find what you're looking for? Our support team is here to help.