Discord Integration
How to Connect Discord to NIVA — Slash Command Integration Guide
Connect NIVA to Discord via slash commands. Users type /ask <question> in any channel and your AI bot replies. NIVA uses Discord's Interactions Endpoint — a stateless webhook approach with Ed25519 signature security, no persistent connection needed.
Before you begin
NIVA botmaster account with a bot configured
Discord account with server management permission
Step-by-step setup
Create a Discord Application
- Go to https://discord.com/developers/applications
- Click New Application
- Enter a name (e.g. NIVA Bot) and click Create
- From General Information, copy the Application ID and Public Key
Add a Bot and Get Token
- Left sidebar → Bot → Add Bot → Yes, do it!
- Click Reset Token → Yes, do it!
- Copy the Bot Token shown
- Under Privileged Gateway Intents, no special intents are needed for slash commands
Bot token is shown only once. Keep it secure.
Configure in NIVA Botmaster
- Open your NIVA botmaster → Omnichannel
- Click Configure on the Discord card
- Paste Application ID, Public Key, and Bot Token
- Set Slash Command Name (default:
ask) - Click Save & Activate
- Copy the Webhook URL
Set Interactions Endpoint URL
- Back in Discord Developer Portal → General Information
- Paste your NIVA Webhook URL into Interactions Endpoint URL
- Click Save Changes
- Discord will send a PING to verify — NIVA responds automatically
If verification fails, ensure your server is publicly reachable via HTTPS.
Create the Slash Command
- Left sidebar → Slash Commands → New Command
- Set Name to
ask(or your chosen command name) - Set Description to something like "Ask the AI bot a question"
- Add an option: Name
question, Type STRING, Required Yes - Click Save
Invite the Bot to Your Server
- Left sidebar → OAuth2 → URL Generator
- Under Scopes, check
botandapplications.commands - Under Bot Permissions check Send Messages
- Copy the generated URL and open it in a browser
- Select your server and click Authorize
Test the Integration
- Open Discord → go to any channel in your server
- Type
/ask— you should see the slash command appear - Fill in the question and send
- Discord shows "Bot is thinking…" then your bot replies
Troubleshooting
Interactions URL verification fails
Server not reachable via HTTPS. Use ngrok for local dev.
401 on PING
Public Key copied wrong — re-check in General Information.
Slash command not visible
Wait up to 1 hour for global command propagation, or use guild-specific commands for instant testing.
Bot does not reply
Check Discord card shows Active in NIVA Omnichannel.
Ready to connect Discord?
Open your NIVA botmaster → Omnichannel → Configure