Skip to main content
Prerequisites:
  • Node.js version 16 or higher
  • A running Lavalink server
  • Discord bot token and application
Follow these steps to set up your development environment and start building with Aqualink.
1

Install Aqualink

2

Set up Lavalink server

Download and configure your Lavalink server for development:
  1. Download the latest Lavalink.jar from GitHub releases
  2. Create an application.yml file:
  1. Start your Lavalink server:
3

Create your bot

Set up your Discord bot with Aqualink:

Environment Configuration

Set up your environment variables for development:
Then load them in your application:

Development Scripts

Add these helpful scripts to your package.json:

Hot Reloading

For faster development, use Node.js built-in watch mode:
This will automatically restart your bot when you make changes to your code.

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.json
.prettierrc

Troubleshooting

Your bot needs proper permissions to join voice channels.
  1. Ensure your bot has “Connect” and “Speak” permissions
  2. Check if the voice channel isn’t full or restricted
  3. Verify the user is in a voice channel when creating the connection
This can happen when search sources aren’t properly configured.
  1. Check your Lavalink application.yml sources configuration
  2. Ensure YouTube and other sources are enabled (true)
  3. Try different search terms or platforms
  4. Check Lavalink logs for detailed error messages
Aqualink requires Node.js 16 or higher for optimal performance.
  1. Check your Node version: node --version
  2. Update Node.js if needed
  3. 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
Ready to start building? Check out our API Reference for detailed documentation on all available methods and events.