Run Vaquill inside any Discord server. Members ask legal questions withDocumentation Index
Fetch the complete documentation index at: https://vaquill.ai/docs/llms.txt
Use this file to discover all available pages before exploring further.
!ask, the bot replies with cited cases and statutes, and per-channel history keeps follow-ups natural. Source code at github.com/Vaquill-AI/integrations/discord-bot.
Features
!ask,!starters,!reset,!helpprefix commands (prefix is configurable)- Per-channel conversation history (cap configurable, default 20 exchanges)
- “Show Sources” button on every response reveals cited case law and statutes
- Long answers paginated with Previous / Next buttons
- Starter-question buttons via
!starters - Per-user and per-channel rate limits with optional Redis backend
- Channel and role allowlists
Prerequisites
- A Discord account with Manage Server permission on at least one server
- Python 3.10+ (or Docker)
- Vaquill API key (starts with
vq_key_). See Authentication.
Platform setup
Create the application
Open the Discord Developer Portal, click New Application, name it (e.g. “Vaquill Legal AI”), and click Create.
Create the bot user and copy the token
In the sidebar, click Bot, then Add Bot > Yes, do it!. Click Reset Token, copy the value, and save it as
DISCORD_BOT_TOKEN. You cannot view this token again after leaving the page.Enable Message Content Intent (critical)
On the same Bot page, scroll to Privileged Gateway Intents. Toggle Message Content Intent on and click Save Changes.
Generate the invite URL
Go to OAuth2 > URL Generator.Under Scopes check:
botapplications.commands
- Send Messages
- Embed Links
- Read Message History
- Use Slash Commands
- Add Reactions
Quickstart
Configuration
Top env vars - see the repo’s.env.example for the full set.
| Variable | Required | Default | Description |
|---|---|---|---|
DISCORD_BOT_TOKEN | Yes | - | Bot token from the Developer Portal |
VAQUILL_API_KEY | Yes | - | Vaquill API key (vq_key_...) |
VAQUILL_API_URL | No | https://api.vaquill.ai/api/v1 | API base URL |
VAQUILL_MODE | No | standard | standard (faster) or deep (more thorough) |
VAQUILL_COUNTRY_CODE | No | - | Jurisdiction filter, e.g. US |
DISCORD_COMMAND_PREFIX | No | ! | Command prefix |
RATE_LIMIT_PER_USER | No | 10 | Per-user limit per window |
RATE_LIMIT_PER_CHANNEL | No | 30 | Per-channel limit per window |
RATE_LIMIT_WINDOW | No | 60 | Sliding window in seconds |
ALLOWED_CHANNELS | No | - | Comma-separated channel IDs (empty = all) |
ALLOWED_ROLES | No | - | Comma-separated role IDs (empty = all) |
REDIS_URL | No | - | Optional Redis URL for distributed rate limiting |
Commands
| Command | Aliases | Description |
|---|---|---|
!ask <question> | !a, !q | Ask a legal question; supports follow-ups via channel history |
!starters | !start, !questions | Show starter questions as clickable buttons |
!reset | - | Clear conversation history for the current channel |
!help | - | Show the help menu |
Deployment
Docker
docker-compose.yml:
docker compose up -d.
Cloud hosts
Railway
railway init && railway up. Set DISCORD_BOT_TOKEN and VAQUILL_API_KEY in the Variables tab.Render
New Web Service. Build:
pip install -r requirements.txt. Start: python bot.py.VPS + systemd
Run under a systemd unit with
Restart=always. The bot does not need an open port.Fly.io
fly launch, set secrets, fly deploy. Discord uses long-poll so no public URL is required.Troubleshooting
| Symptom | Fix |
|---|---|
| Bot is offline | Check DISCORD_BOT_TOKEN. Confirm python bot.py is running. On free cloud tiers, confirm the service is not sleeping. |
| Bot online but ignores commands | Enable Message Content Intent in the Developer Portal and restart. Confirm you are using the correct prefix (default !). |
| ”Privileged intent provided is not enabled or whitelisted” on startup | Enable Message Content Intent in the Developer Portal. |
| ”Missing Permissions” error | Re-invite the bot with the URL from the OAuth2 step. Or grant Send Messages / Embed Links / Read Message History on the bot’s role. |
| API errors (“Sorry, I couldn’t process your request”) | Verify VAQUILL_API_KEY. Confirm VAQUILL_API_URL is reachable. If using deep mode, confirm your plan supports it. |
| Rate-limit messages too quickly | Raise RATE_LIMIT_PER_USER or RATE_LIMIT_WINDOW in .env. |
Related
Slack
Slash commands and Socket Mode equivalent.
Telegram
Lightest setup - BotFather only.
Chatbots overview
Compare all six platforms.
Authentication
How Vaquill API keys work.

