Prerequisites:
- Node.js version 16 or higher
- A running Lavalink server
- Discord bot token and application
1
Install Aqualink
2
Set up Lavalink server
Download and configure your Lavalink server for development:
- Download the latest Lavalink.jar from GitHub releases
- Create an
application.yml
file:
- Start your Lavalink server:
3
Create your bot
Set up your Discord bot with Aqualink:
Environment Configuration
Set up your environment variables for development:Development Scripts
Add these helpful scripts to yourpackage.json
:
Hot Reloading
For faster development, use Node.js built-in watch mode:Testing Your Setup
Create a simple test command to verify everything is working:IDE Setup
We recommend using these extensions for the best development experience:Visual Studio Code
- Discord.js IntelliSense - Autocomplete for Discord.js
- JavaScript and TypeScript - Built-in support
- Prettier - Code formatting
- ESLint - Code linting
Configuration Files
Create these files in your project root: .eslintrc.jsonTroubleshooting
Error: Cannot connect to Lavalink server
Error: Cannot connect to Lavalink server
This usually means your Lavalink server isn’t running or the connection details are incorrect.
- Verify your Lavalink server is running: check
http://localhost:2333
- Check your
application.yml
configuration - Ensure the password matches in both files
- Try restarting the Lavalink server
Error: Missing Access - connect to voice channel
Error: Missing Access - connect to voice channel
Your bot needs proper permissions to join voice channels.
- Ensure your bot has “Connect” and “Speak” permissions
- Check if the voice channel isn’t full or restricted
- Verify the user is in a voice channel when creating the connection
Error: No tracks found
Error: No tracks found
This can happen when search sources aren’t properly configured.
- Check your Lavalink
application.yml
sources configuration - Ensure YouTube and other sources are enabled (
true
) - Try different search terms or platforms
- Check Lavalink logs for detailed error messages
Node.js version compatibility
Node.js version compatibility
Aqualink requires Node.js 16 or higher for optimal performance.
- Check your Node version:
node --version
- Update Node.js if needed
- Clear node_modules and reinstall:
rm -rf node_modules && npm install
Development Best Practices
- Use environment variables for sensitive data like tokens
- Implement proper error handling for all Aqualink operations
- Test with different audio sources to ensure compatibility
- Monitor Lavalink server logs during development
- Use TypeScript for better development experience and type safety