Installation
Get DisGoLink installed and ready for building your Discord music bot.Prerequisites
Before installing DisGoLink, ensure you have the following:Go 1.21 or higher
DisGoLink requires Go 1.21+. Check your Go version:If you need to install or update Go, visit golang.org/doc/install.
A Discord Bot Application
You’ll need a Discord bot token. Create a bot at the Discord Developer Portal if you haven’t already.
Make sure to enable the “Server Members Intent” and “Message Content Intent” in your bot’s settings if needed.
A Running Lavalink Server
DisGoLink connects to a Lavalink server to handle audio processing. You can:
- Download and run Lavalink locally
- Use a hosted Lavalink service
- Run Lavalink in Docker
Install DisGoLink
Install DisGoLink v3 using Go modules:go.mod file.
Package Structure
DisGoLink consists of two main packages:disgolink Package
The high-level client interface. This is where you’ll:
- Create and manage the Lavalink client
- Add and configure nodes
- Create and control players
- Register event listeners
- Handle plugins
lavalink Package
Low-level protocol types and structures. This package contains:
- Track and playlist types
- Player state structures
- Event message types
- Filter and effect definitions
- REST API request/response types
Verify Installation
Create a simple test file to verify everything is installed correctly:test.go
Additional Dependencies
Depending on your Discord library choice, you’ll need to install it as well:DisGoLink is designed to work best with DisGo as both libraries use the same Snowflake implementation, avoiding type conversion overhead.
Optional: Install Plugins
Extend DisGoLink with official plugins:Set Up Lavalink Server
If you haven’t set up a Lavalink server yet, here’s a quick Docker setup:docker-compose.yml
Troubleshooting
Module Resolution Issues
If you encounter module resolution errors:Version Conflicts
Ensure you’re using DisGoLink v3:Snowflake Type Errors
Make sure you’re importing the correct Snowflake package:Next Steps
Now that DisGoLink is installed, you’re ready to build your first music bot!Next: Quickstart
Learn how to create a working Discord music bot with DisGoLink