General Questions
What is JDA?
What is JDA?
- Event-driven architecture for real-time responses
- Full REST API coverage with rate limit handling
- Customizable caching for optimal performance
- Support for all Discord features (commands, buttons, modals, etc.)
- Compatible with Java 8+ and Kotlin
What Java version do I need?
What Java version do I need?
Is JDA free to use?
Is JDA free to use?
- Use it for personal projects
- Use it for commercial bots
- Modify the source code
- Contribute back to the project
Can I use JDA with Kotlin?
Can I use JDA with Kotlin?
Where can I get help?
Where can I get help?
- JDA Wiki - Comprehensive guides and tutorials
- Javadocs - Complete API documentation
- GitHub Repository - Source code and issues
- Discord Server - Community support
- Stack Overflow (tag:
jda) - Reddit: r/Discord_Bots
- YouTube tutorials
Getting Started
How do I create a Discord bot?
How do I create a Discord bot?
-
Create Application in Discord Developer Portal
- Go to discord.com/developers/applications
- Click “New Application”
- Navigate to “Bot” section and create a bot
- Copy the bot token (keep it secret!)
-
Add JDA to Your Project
-
Write Your First Bot
How do I invite my bot to a server?
How do I invite my bot to a server?
- Go to the Discord Developer Portal
- Select your application
- Go to “OAuth2” → “URL Generator”
- Select scopes:
bot- Required for bot functionalityapplications.commands- Required for slash commands
- Select bot permissions needed
- Copy the generated URL and open it in a browser
- Select a server and authorize
What are Gateway Intents and why do I need them?
What are Gateway Intents and why do I need them?
GUILD_MESSAGES- Message events in serversDIRECT_MESSAGES- DM eventsGUILD_MESSAGE_REACTIONS- Reaction events
MESSAGE_CONTENT- Access to message textGUILD_MEMBERS- Member join/leave, member cacheGUILD_PRESENCES- User status and activities
Should I use JDABuilder.createDefault() or createLight()?
Should I use JDABuilder.createDefault() or createLight()?
| Builder | Use Case | Cache Behavior |
|---|---|---|
createDefault() | General-purpose bots | Caches users, members, and all flags |
createLight() | Minimal bots, slash commands only | Minimal caching, voice users only |
create() | Large bots needing full cache | All users, all members, chunking enabled |
Commands and Interactions
Should I use slash commands or message commands?
Should I use slash commands or message commands?
- Native Discord feature
- Better user experience with auto-complete
- No need for
MESSAGE_CONTENTintent - Shown in Discord’s UI automatically
- Support for options, choices, and permissions
- Requires
MESSAGE_CONTENTprivileged intent - More flexible parsing
- Can be used with prefix-based systems
- Will require verification for bots in 100+ servers
How do I create a slash command?
How do I create a slash command?
Why aren't my commands showing up?
Why aren't my commands showing up?
- Commands not registered - Make sure you call
updateCommands().queue() - Global command delay - Global commands can take up to 1 hour to appear
- Wrong scope - Missing
applications.commandswhen inviting bot - Cache issue - Restart Discord client
How do I make buttons and dropdown menus?
How do I make buttons and dropdown menus?
What is the 3-second interaction timeout?
What is the 3-second interaction timeout?
- Immediate response:
- Defer if processing takes time:
- Defer as ephemeral (only user can see):
RestAction and Async Operations
What is RestAction and why use queue()?
What is RestAction and why use queue()?
RestAction is JDA’s lazy request builder. Nothing happens until you call a completion method:.queue()- Send asynchronously (recommended).submit()- Returns aFuture.complete()- Blocks until complete (avoid in event handlers!)
How do I chain multiple RestActions?
How do I chain multiple RestActions?
flatMap() to chain dependent operations:Should I use queue() or complete()?
Should I use queue() or complete()?
.queue() (asynchronous) in almost all cases:- Non-blocking
- Better performance
- Required in event handlers
- Handles rate limits automatically
.complete() (blocking) when:- Running in a separate thread (not event handler)
- You absolutely need the result immediately
- In main method initialization
Audio and Music Bots
How do I make a music bot?
How do I make a music bot?
- Better for large bots
- Runs on separate server
- Supports multiple bot instances
- See Lavalink documentation
What is DAVE Protocol?
What is DAVE Protocol?
- Lavaplayer - Most popular choice
- LavaLink - For distributed setups
Why is my audio stuttering?
Why is my audio stuttering?
- Garbage Collection pauses - Use udpqueue:
- High CPU usage - Optimize your bot code
- Network issues - Check connection stability
- Improper audio buffer - Ensure proper AudioSendHandler implementation
Performance and Scaling
How do I reduce memory usage?
How do I reduce memory usage?
When should I use sharding?
When should I use sharding?
- Your bot is in 2,500+ servers (Discord will require it)
- You need to distribute load across multiple processes
- You want better redundancy
JDA instance is sufficient.What are rate limits and how are they handled?
What are rate limits and how are they handled?
- Tracks rate limits per endpoint
- Queues requests when limits are reached
- Retries on 429 responses
- Respects global rate limits
- Use caching to avoid unnecessary API calls
- Batch operations when possible
- Avoid spamming requests in loops
Deployment and Production
How do I keep my bot running 24/7?
How do I keep my bot running 24/7?
-
VPS (Virtual Private Server)
- DigitalOcean, Linode, Vultr
- Run bot as systemd service or screen session
-
Cloud Platforms
- AWS EC2, Google Cloud Compute
- Heroku (free tier discontinued)
- Railway, Render
-
Docker Container
-
Process Managers
- PM2 (for Node.js wrappers)
- systemd (Linux)
- screen/tmux sessions
How do I secure my bot token?
How do I secure my bot token?
- Never commit tokens to Git:
- Use environment variables:
- Use configuration files (gitignored):
- Regenerate if exposed:
- Go to Developer Portal immediately
- Regenerate bot token
- Update your bot configuration
How do I update my bot without downtime?
How do I update my bot without downtime?
- Graceful Shutdown:
-
Multiple Instances (for large bots):
- Use sharding
- Update shards one at a time
- Requires stateless design or shared database
-
Rolling Updates (Docker/Kubernetes):
- Deploy new version alongside old
- Gradually shift traffic
- Rollback if issues occur
Still Have Questions?
If you didn’t find your answer here:- Check the Common Issues page
- Browse the JDA Wiki
- Search GitHub Issues
- Ask on the JDA Discord Server