🎮 Discord Integration
Connect Datix xAgents to Discord to receive notifications, run queries, and collaborate with your community.
Overview
Discord Integration enables:
- Real-time notifications in Discord channels
- Run queries using bot commands
- Share data insights with community
- Agent execution alerts
- Workflow completion notifications
- Interactive embeds with rich formatting
Discord Integration is available in Growth plan and above.
Setup
1. Create Discord Bot
- Go to Discord Developer Portal
- Click "New Application"
- Name: "Datix xAgents Bot"
- Go to "Bot" section
- Click "Add Bot"
- Copy the Bot Token
2. Configure Bot Permissions
Required permissions:
Permission Integer: 326417525824
3. Enable Intents
In Bot settings, enable:
- ✅ Presence Intent
- ✅ Server Members Intent
- ✅ Message Content Intent
4. Invite Bot to Server
Generate OAuth2 URL:
- Go to "OAuth2 → URL Generator"
- Select scopes:
botandapplications.commands - Select permissions listed above
- Copy generated URL
- Open URL in browser
- Select server and authorize
5. Configure in Datix xAgents
- Navigate to Settings → Integrations
- Click "Add Integration"
- Select "Discord"
- Paste Bot Token
- Enter Server ID and default Channel ID
- Click "Save"
Features
Notifications
Receive embeds for:
- Query Completion: When queries finish
- Agent Execution: Autonomous agent results
- Workflow Completion: Workflow status updates
- Anomaly Detection: AI insights found
- Approval Requests: Actions needing approval
- Error Alerts: Failed executions
Rich Embeds
Notifications use Discord's rich embed format:
Bot Commands
Run queries from Discord:
Slash Commands
Modern Discord slash commands:
Configuration Options
Channel Routing
Send different notifications to different channels:
Notification Filters
Control what gets sent to Discord:
- Minimum Duration: Only notify for queries >30s
- Query Types: Only multi-database queries
- Priority Only: High-priority agents only
- Error Level: Only critical errors
Embed Customization
Customize embed appearance:
- Color: Different colors for different statuses
- Thumbnail: Add custom bot avatar
- Footer: Custom footer text
- Author: Show who triggered action
Interactive Components
Buttons
Embeds include action buttons:
Dropdown Menus
For selecting from options:
- Select template to execute
- Choose data source
- Pick time range
Approval Workflows
Approve Actions in Discord
When an agent requires approval:
- Embed sent to approvals channel
- Shows action details with context
- Buttons: "Approve" or "Reject"
- Click button to respond
- Agent continues based on response
- Updates embed to show decision
Query Results
Result Preview in Embeds
Discord embeds show data preview:
- First 5 rows in field format
- Total row count
- Key metrics highlighted
- Link to full results
File Attachments
Send result data as files:
- CSV export attached to message
- Chart images from visualizations
- PDF reports
Role Mentions
Notify Specific Roles
Tag roles in notifications:
User Mentions
Mention specific users:
- Map Datix users to Discord users
- By username or email
- Manual mapping in settings
Webhooks
Discord Webhooks
Alternative to bot - simpler setup:
- Right-click channel → Edit Channel
- Go to Integrations → Webhooks
- Click "New Webhook"
- Name: "Datix Notifications"
- Copy Webhook URL
- Add to Datix integration settings
Webhook vs Bot
Webhooks:
- ✅ Simpler setup
- ✅ No permissions needed
- ❌ One-way only (send messages)
- ❌ No commands
Bot:
- ✅ Two-way interaction
- ✅ Commands and slash commands
- ✅ Button interactions
- ❌ More complex setup
Best Practices
- Dedicated Channels: Create separate channels for different notification types
- Role Mentions: Use role mentions sparingly to avoid spam
- Use Threads: Keep main channel clean by using threads
- Rich Embeds: Use embeds for better formatting and readability
- Files for Large Data: Attach CSV instead of embedding large datasets
- Test Channel: Use a test channel before production
Keep your Bot Token secret. Never share it publicly or commit to version control. Regenerate if exposed.
Troubleshooting
Bot Not Responding
- Verify bot has correct permissions
- Check bot is online (green status)
- Ensure Message Content Intent is enabled
- Check token is valid
Messages Not Appearing
- Verify channel ID is correct
- Check bot can see channel
- Ensure "Send Messages" permission
- Check integration status in Datix
Slash Commands Not Working
- Wait up to 1 hour for commands to sync
- Kick and re-invite bot
- Verify
applications.commandsscope - Check bot has slash command permissions
Common Errors
Rate Limits
Discord enforces rate limits:
- Messages: 5 per 5 seconds per channel
- Embeds: Unlimited (same as messages)
- Files: Max 8MB per file (25MB with Nitro)
- Global: 50 requests per second
- Datix automatically handles rate limiting
Advanced Features
Scheduled Messages
Send recurring reports:
- Daily digest at 9 AM
- Weekly summary every Monday
- Monthly reports on 1st of month
Conditional Notifications
Only notify when conditions met:
- Sales drop >10%
- Query takes >1 minute
- Anomaly confidence >90%
Thread Management
Organize notifications in threads:
- One thread per workflow
- One thread per agent
- Archive old threads automatically
Permissions
To configure Discord integration:
- Admin role in Datix xAgents
- Manage Server permission in Discord
- Growth plan or above
Having trouble setting up Discord integration? Check our video tutorial or contact support.