← Back to blog

AI Bot Builder: Export a Discord or Web Bot in Minutes

September 5, 2026 · Eric · 6 min read

Shipping a chat bot usually means gluing together a model SDK, a platform API, a web server, a memory store, and a deployment manifest — before you have written a single line of bot logic. The Agent Media Tools Bot Builder takes the opposite path: you describe the bot you want as plain JSON (or click through the form), and it exports a complete, tested Python package you run anywhere. This review walks through the real API behind the builder and shows how to generate a Discord bot, a local web chat, or a terminal assistant with curl or Python.

What the builder actually generates

The builder is a server-side project generator. Every bot is described by a single config.json document, and the generator turns that config into a self-contained package:

The exported zip contains a single-file bot.py runtime (standard-library HTTP plus the platform SDKs), config.json, a .env.example with every secret slot named, requirements.txt, launch scripts for Windows and Linux, and deployment files such as Dockerfile, docker-compose.yml, railway.json, render.yaml, and fly.toml. Nothing about the generator is black-box: the same endpoints the web form calls are public, so you can script the whole flow.

Step 1 — Read the schema (no account needed)

Every option the builder accepts is published at GET /api/bot-builder/options. It returns the supported platforms, providers, deployments, the seven AMT tools, and the full default config:

curl -s https://agentmediatools.com/api/bot-builder/options \
  | python3 -m json.tool
{
  "schemaVersion": 1,
  "templateVersion": 2,
  "platforms": ["terminal", "web", "discord", "telegram"],
  "providers": ["openai", "anthropic", "gemini", "ollama", "lmstudio", "openai-compatible"],
  "deployments": ["windows", "linux", "docker", "digitalocean", "railway", "render", "fly", "vps"],
  "amtTools": ["web_extract", "screenshot", "ocr", "pdf_text", "image_generation", "image_convert", "qrcode"],
  "defaults": { "platform": "terminal", "provider": { "type": "ollama", "model": "llama3.2" }, "memory": { "type": "sqlite", "maxMessages": 50 }, ... }
}

Because the defaults object is served with the schema, you never have to guess a field name or a valid enum value — an agent can fetch this file and construct a valid config on the first try.

Step 2 — Validate your config

Before downloading anything, send the config to POST /api/bot-builder/preview. The server normalizes it (bounds every number, filters the AMT allowlist, rejects unknown provider types) and tells you exactly which files the export will contain:

cat > bot-config.json <<'EOF'
{
  "name": "Discord Research Bot",
  "slug": "discord-research-bot",
  "platform": "discord",
  "deployment": "docker",
  "provider": { "type": "ollama", "model": "llama3.2", "temperature": 0.4, "maxTokens": 1200 },
  "memory": { "type": "sqlite", "maxMessages": 50 },
  "tools": { "amt": ["screenshot", "web_extract", "qrcode"] },
  "limits": { "requestsPerMinute": 20, "maxInputChars": 12000 }
}
EOF
curl -s -X POST https://agentmediatools.com/api/bot-builder/preview \
  -H "Content-Type: application/json" \
  -d @bot-config.json | python3 -m json.tool

The response echoes the cleaned config (missing baseUrl is filled with the Ollama default http://127.0.0.1:11434/v1) plus a files array listing every file the zip will contain. This is the cheapest possible sanity check: config problems surface as a 400 with a readable message instead of a broken bot at runtime.

Step 3 — Download the bot package

The same JSON produces a ready-to-run zip from POST /api/bot-builder/export. The endpoint is unauthenticated, so you can script it with plain curl:

curl -X POST https://agentmediatools.com/api/bot-builder/export \
  -H "Content-Type: application/json" \
  -d @bot-config.json \
  -o discord-research-bot.zip

Or with Python and requests, which is handy when you generate configs programmatically (for example, one bot per customer or per channel):

import requests

config = {
    "name": "Discord Research Bot",
    "platform": "discord",
    "deployment": "docker",
    "provider": {"type": "ollama", "model": "llama3.2", "temperature": 0.4},
    "memory": {"type": "sqlite", "maxMessages": 50},
    "tools": {"amt": ["screenshot", "web_extract", "qrcode"]},
    "limits": {"requestsPerMinute": 20, "maxInputChars": 12000},
}

r = requests.post(
    "https://agentmediatools.com/api/bot-builder/export",
    json=config,
    timeout=60,
)
r.raise_for_status()
with open("discord-research-bot.zip", "wb") as f:
    f.write(r.content)
print("downloaded", len(r.content), "bytes")

There is also POST /api/bot-builder/export-with-knowledge, a multipart variant that accepts up to ten .txt, .md, .csv, or .json knowledge files (2 MB each) and packs them into the zip for you. The UI uses these same routes — export is capped at a 128 KB config, which is generous for a document that is usually a few KB.

What you get inside the zip

Unzip it and you will find the whole project under discord-research-bot/:

discord-research-bot/
├── bot.py              # single-file runtime (chat loop, memory, rate limits, tool calls)
├── config.json         # your normalized config — the source of truth
├── .env.example        # every secret slot, empty: provider key, tokens, AMT_AGENT_KEY
├── requirements.txt    # pinned deps (discord.py for Discord, Flask + waitress for web, ...)
├── README.md           # quick start + pointer to the full docs
├── start-linux.sh / start-windows.bat
├── Dockerfile / docker-compose.yml
├── railway.json / render.yaml / fly.toml / .do/app.yaml / Procfile
└── knowledge/          # drop trusted .txt/.md/.csv/.json files here

No secret is embedded anywhere — the zip is safe to pass around, commit to a private repo, or hand to a deployment pipeline. Secrets live only in your local .env.

Running the bot

Setup is the same regardless of platform: copy the env template, fill in only the values you use, run the built-in doctor, then start:

unzip discord-research-bot.zip
cd discord-research-bot
cp .env.example .env
# edit .env: add DISCORD_BOT_TOKEN (and OLLAMA_API_KEY only if your Ollama needs one)
python bot.py --check     # verifies provider, model, and platform settings — no prompt sent
./start-linux.sh          # creates a venv, installs requirements.txt, launches the bot

python bot.py --check is worth highlighting: it hits the provider's /models endpoint, confirms the configured model is listed, and checks that required platform tokens exist — without spending a single completion. On Windows, start-windows.bat does the equivalent setup. For Discord you also need to enable Message Content Intent in the developer portal so the bot can read messages.

Local providers get sensible defaults: Ollama at http://127.0.0.1:11434/v1 and LM Studio at http://127.0.0.1:1234/v1. For an OpenAI-compatible server somewhere else — a DeepSeek endpoint, an OpenWebUI pipeline, a Tailscale-hosted LM Studio — set LLM_BASE_URL and LLM_API_KEY. The web platform runs a small Flask chat page bound to 127.0.0.1:8000 by default; the runtime refuses to bind beyond loopback unless you set a BOT_ACCESS_TOKEN, so an exposed chat page still requires a secret.

Memory, knowledge, and rate limits

The runtime handles the details that usually turn into a second project. SQLite memory is optional ("memory": { "type": "sqlite", "maxMessages": 50 }) and scoped per session — per Discord channel, per Telegram chat, per web session. Knowledge files placed in knowledge/ are loaded into the system prompt, and knowledge URLs listed in the config are fetched on the bot's own machine only when you explicitly set ALLOW_KNOWLEDGE_URLS=true; the README is blunt that external pages should be treated as untrusted content. Rate limiting is enforced in the runtime, not just suggested: requestsPerMinute and maxInputChars from the config are checked inside the chat handler, so a runaway script cannot hammer your provider.

Adding hosted AMT tools

The interesting extension is the hosted tool allowlist. Pick any of the seven tools in the config — web_extract, screenshot, ocr, pdf_text, image_generation, image_convert, qrcode — then create an agent key on Agent Media Tools and set AMT_AGENT_KEY in .env. In any chat you can then type:

/tool screenshot {"url": "https://example.com"}
/tool qrcode {"text": "https://agentmediatools.com/bot-builder"}

Each allowlisted tool maps to a real, existing AMT REST endpoint (structured scrape, screenshot, OCR, PDF text extraction, image generation, image conversion, and QR code generation), and the runtime refuses any tool that is not in your config.json allowlist — so a prompt injection cannot talk the bot into calling an unapproved endpoint. This is a clean way to give a local-model Discord bot a hosted capability like OCR or web extraction without embedding heavy tooling on the machine running the bot.

Saving and versioning projects

If you are signed in on the site, the builder can also store projects server-side: the /api/bot-projects REST endpoints (create, read, update, delete, export, and a version history under /api/bot-projects/:id/history) save every revision of a config so you can roll back or re-download an older build. These project endpoints require your normal session auth rather than an agent key, and they are optional — downloading a package works fine anonymously.

Review: where Bot Builder fits

Bot Builder is not a hosting service and it is not an agent framework. It is a generator with an opinion: describe the bot, own the package, run it wherever you want. That is the right trade for most hobby-to-production bots — you keep full control of keys and code, and the builder removes the boilerplate. The same config schema that drives the website is a public HTTP API, which makes the whole thing automatable: fetch options, validate, export, repeat. If you already run Ollama or LM Studio locally, you can go from nothing to a working Discord or web assistant in about five minutes, no cloud keys required.

Build your own bot

Open the Bot Builder in your browser to configure and download a package, or explore the rest of the toolbox and agent APIs.

Open Bot Builder Open toolbox