Prerequisites:
- Python 3.8 or higher
- A running Lavalink server
- Discord bot token and application
Set up Lavalink server
Download and configure your Lavalink server for development:
- Download the latest Lavalink.jar from GitHub releases
- Create an
application.ymlfile:
- Start your Lavalink server:
Environment Configuration
Set up your environment variables for development:Development Setup
Install additional development dependencies:Hot Reloading
For faster development, use a tool likewatchdog or run your bot with auto-restart:
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
- Python - Official Python extension
- Pylance - Fast Python language server
- Python Type Hint - Type hint support
- autopep8 or Black - Code formatting
PyCharm
- Built-in Python support with type checking
- Discord.py autocomplete
- Integrated debugger
Configuration Files
Create these files in your project root: pyproject.tomlTroubleshooting
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.ymlconfiguration - 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.ymlsources configuration - Ensure YouTube and other sources are enabled (
true) - Try different search terms or platforms
- Check Lavalink logs for detailed error messages
Python version compatibility
Python version compatibility
Salada requires Python 3.8 or higher for optimal performance.
- Check your Python version:
python --version - Update Python if needed
- Reinstall dependencies:
pip install --upgrade salada
AttributeError or import errors
AttributeError or import errors
Make sure all dependencies are properly installed.
- Create a virtual environment:
python -m venv venv - Activate it:
source venv/bin/activate(Linux/Mac) orvenv\Scripts\activate(Windows) - Install requirements:
pip install -r requirements.txt
Development Best Practices
- Use virtual environments to isolate project dependencies
- Use environment variables for sensitive data like tokens
- Implement proper error handling for all Salada operations with try-except blocks
- Test with different audio sources to ensure compatibility
- Monitor Lavalink server logs during development
- Use type hints for better development experience and code clarity
- Follow PEP 8 style guidelines for clean, readable code