Discord Bot API
The Discord Bot API allows you to programmatically manage your Discord bot hosting.
Endpoints
| Method | Endpoint | Description |
|---|---|---|
| GET | /bots | List all bots |
| GET | /bots/:id | Get bot details |
| POST | /bots | Create a new bot |
| PUT | /bots/:id | Update bot config |
| DELETE | /bots/:id | Delete a bot |
| POST | /bots/:id/start | Start bot |
| POST | /bots/:id/stop | Stop bot |
List All Bots
GET /v1/botsResponse:
{
"success": true,
"data": [
{
"id": "bot_xyz789",
"name": "Music Bot",
"bot_token": "***hidden***",
"status": "running",
"shard_count": 1,
"guild_count": 150,
"created_at": "2026-01-10T08:00:00Z"
}
]
}Create a Bot
POST /v1/botsRequest Body:
{
"name": "My Discord Bot",
"bot_token": "YOUR_BOT_TOKEN_HERE",
"language": "en",
"shard_count": 1,
"auto_restart": true
}Configuration Options:
| Field | Type | Description |
|---|---|---|
name | string | Bot display name |
bot_token | string | Discord bot token |
language | string | Bot language (en, etc.) |
shard_count | number | Number of shards (1-100) |
auto_restart | boolean | Auto-restart on crash |
Example: Python Discord Bot
Here's a simple example of a Discord bot that works with our hosting:
import discord
from discord.ext import commands
bot = commands.Bot(command_prefix='!', intents=discord.Intents.default())
@bot.event
async def on_ready():
print(f'Logged in as {bot.user}')
@bot.command()
async def ping(ctx):
await ctx.send('Pong!')
bot.run('YOUR_TOKEN_HERE')Bot Permissions
Make sure your bot has the necessary intents enabled in the Discord Developer Portal.
Monitoring
Get bot statistics:
GET /v1/bots/:id/statsResponse:
{
"success": true,
"data": {
"guild_count": 150,
"user_count": 25000,
"shard_stats": [
{"shard_id": 0, "guilds": 75, "status": "connected"}
],
"uptime": "5d 3h 22m",
"memory_usage": "256MB"
}
}