Discord companion bot
The Discord companion is an optional add-on (sold / downloaded separately from the main NovaDocs package). It lives next to your install in addons/novadocs-discord.
It connects to your live NovaDocs URL and answers support questions with the best matching published article. It never needs database access — only your site’s public search API.
What it does
/docs <query>— search your docs and return the best article (+ related links)- Support channel auto-reply — when someone asks a question in the configured channel, the bot searches and replies
- @mention —
@Bot how do I install?works anywhere in the support server - No match — asks them to wait for a human, and still links to the docs home
Requirements
- Node.js 20+ (or Docker)
- A running NovaDocs site (Docker, VPS, or Vercel)
- A Discord application + bot user
1. Create the Discord bot
- Open the Discord Developer Portal → New Application
- Bot → Add Bot → copy the Token
- Enable Message Content Intent (Bot → Privileged Gateway Intents)
- OAuth2 → URL Generator
- Scopes:
bot,applications.commands - Permissions: Send Messages, Embed Links, Read Message History, Use Slash Commands
- Scopes:
- Invite the bot to your support server with that URL
- Copy:
- Application Client ID
- Server (Guild) ID (Developer Mode → right-click server → Copy Server ID)
- Optional: support channel ID (right-click channel → Copy Channel ID)
2. Configure
From the add-on folder:
bash
cd addons/novadocs-discord
cp .env.example .env| Variable | Required | Description |
|---|---|---|
DISCORD_TOKEN | yes | Bot token |
DISCORD_CLIENT_ID | yes | Application client ID |
DISCORD_GUILD_ID | yes | Support server ID |
DISCORD_SUPPORT_CHANNEL_ID | no | If set, auto-answers questions in this channel |
NOVADOCS_URL | yes | Reachable NovaDocs URL (http://127.0.0.1:3000 locally, or your live https://… URL) |
NOVADOCS_PROJECT_SLUG | no | Limit search to one project (e.g. guide) |
AUTO_REPLY | no | true / false (default true) |
MAX_RESULTS | no | 1–5 matches (default 3) |
COOLDOWN_SECONDS | no | Per-user cooldown in the channel (default 20) |
3. Run
npm install
npm startSlash commands register automatically on startup. To register only:
bash
npm run registerImportant
Make sure NEXT_PUBLIC_APP_URL on the NovaDocs site matches the public URL you put in NOVADOCS_URL, so article links open correctly.
tip
Put the bot in #support / #help only (DISCORD_SUPPORT_CHANNEL_ID) so it does not chatter elsewhere. Use /docs when you want an explicit search.
Related
- Setting up webhooks — channel embeds when articles publish (different from this bot)
- Full README inside the add-on package:
addons/novadocs-discord/README.md
