Discord Bot Integration
Connect your LVNG workspace to Discord to sync channels, enable AI-powered responses, and let your digital twins participate in Discord conversations.
Prerequisites
- An LVNG account with an API key
- A Discord application with a bot token (Discord Developer Portal)
- The bot added to your Discord server with
Send Messages,Read Message History, andView Channelspermissions
Step 1: Create Integration
Register your Discord bot as a platform integration in LVNG.
Create Discord integration
400">curl -X 400">POST https:400">class="text-zinc-500">//api.lvng.ai/api/v2/platform-integrations \
-H 400">class="text-emerald-400">"Authorization: Bearer YOUR_API_KEY" \
-H 400">class="text-emerald-400">"Content-Type: application/json" \
-d '{
400">class="text-emerald-400">"platform": 400">class="text-emerald-400">"discord",
400">class="text-emerald-400">"name": 400">class="text-emerald-400">"My Discord Bot",
400">class="text-emerald-400">"config": {
400">class="text-emerald-400">"bot_token": 400">class="text-emerald-400">"YOUR_DISCORD_BOT_TOKEN",
400">class="text-emerald-400">"guild_id": 400">class="text-emerald-400">"YOUR_GUILD_ID"
}
}'Step 2: Sync Channels
Import your Discord channels into LVNG. This creates matching LVNG channels linked to your Discord channels.
Sync Discord channels
400">curl -X 400">POST https:400">class="text-zinc-500">//api.lvng.ai/api/v2/platform-integrations/INT_ID/sync-channels \
-H 400">class="text-emerald-400">"Authorization: Bearer YOUR_API_KEY"Step 3: Test Connection
Verify the integration is working correctly.
Test integration
400">curl -X 400">POST https:400">class="text-zinc-500">//api.lvng.ai/api/v2/platform-integrations/INT_ID/test \
-H 400">class="text-emerald-400">"Authorization: Bearer YOUR_API_KEY"Webhook Setup (Optional)
For Discord Interactions (slash commands, buttons), set the interactions endpoint URL in your Discord application settings.
Webhook configuration
# Discord Interaction Endpoint URL:
# https:400">class="text-zinc-500">//api.lvng.ai/webhooks/discord
#
# Set this in your Discord application settings under
# 400">class="text-emerald-400">"Interactions Endpoint URL"
#
# The server verifies requests using Ed25519 signatures
# with your application's public key.Important: Discord does not support markdown tables in messages. LVNG automatically converts table-formatted responses to bullet lists for Discord.
How It Works
Once connected, the integration works as follows:
- Messages sent in synced Discord channels are ingested via the
/api/v2/ingestendpoint - LVNG processes the message through the AI routing system
- AI responses are sent back to the Discord channel via the bot
- Digital twins assigned to the channel can also participate in conversations
Next Steps
- Platform Integrations API — Full endpoint reference
- Digital Twins API — Add AI personas to your channels
- Agents API — Deploy autonomous agents