Documentation

Everything you need to know about hosting and managing your Discord bot with Trevand.

Quick Start

Get your Discord bot up and running on Trevand in under 5 minutes. Follow these simple steps to deploy your first bot.

1. Create an Account

Login with your Discord account to get started. We'll automatically link your existing bots.

Login with Discord

2. Create a New Bot

Head to your dashboard and click "New Bot". Enter your bot token and configure basic settings.

3. Deploy

Upload your bot files or connect your GitHub repository. Click deploy and your bot will be live in seconds!

Installation

Trevand supports bots written in multiple languages. Here's how to set up your project.

Python (discord.py)

# requirements.txt
discord.py==2.3.0
aiohttp
python-dotenv

# main.py
import discord
from discord.ext import commands

bot = commands.Bot(command_prefix='!')

@bot.event
async def on_ready():
    print(f'Logged in as {bot.user}')

bot.run('YOUR_TOKEN')

JavaScript (discord.js)

// package.json
{
  "dependencies": {
    "discord.js": "^14.0.0"
  }
}

// index.js
const { Client, GatewayIntentBits } = require('discord.js');

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

client.once('ready', () => {
  console.log(`Logged in as ${client.user.tag}`);
});

client.login('YOUR_TOKEN');

Configuration

Configure your bot settings through environment variables or our web dashboard.

Environment Variables

Variable Description Required
DISCORD_TOKEN Your bot's Discord token Yes
PREFIX Command prefix (default: !) No
LOG_LEVEL Logging level (debug/info/warn/error) No
DATABASE_URL Database connection string No

Authentication

All API requests require authentication using your API key.

# Include your API key in the Authorization header
curl -H "Authorization: Bearer YOUR_API_KEY" \
  https://api.trevand.host/v1/bots

Getting Your API Key

  1. Login to your Dashboard
  2. Navigate to Settings → API Keys
  3. Click "Generate New Key"
  4. Copy and store your key securely

API Endpoints

GET /v1/bots

List all your bots

// Response
{
  "bots": [
    {
      "id": "123456789",
      "name": "MyBot",
      "status": "online",
      "servers": 42
    }
  ]
}
POST /v1/bots/{id}/restart

Restart a specific bot

// Response
{
  "success": true,
  "message": "Bot restart initiated"
}
GET /v1/bots/{id}/logs

Get bot logs

// Response
{
  "logs": [
    {
      "timestamp": "2024-01-15T10:30:00Z",
      "level": "info",
      "message": "Bot started successfully"
    }
  ]
}

Frequently Asked Questions

How do I update my bot?

You can update your bot by pushing changes to your connected GitHub repository or uploading new files through the dashboard. Changes are deployed automatically.

What languages are supported?

We currently support Python, JavaScript/Node.js, TypeScript, Java, Go, and Rust. More languages coming soon!

How do I view my bot's logs?

Logs are available in real-time through your dashboard. You can also access them via the API or set up webhook notifications.

Can I use a custom domain?

Yes! Custom domains are available on Pro and Ultimate plans. Contact support to set up your domain.

Still Need Help?

Can't find what you're looking for? Join our Discord community for support.

Join Support Server