Basic Playback Flow
The typical flow for playing audio:Connect to voice channel
First, connect your bot to a Discord voice channel:The voice state updates will be automatically forwarded to DisGoLink through event handlers.
Complete Example
Here’s a full example combining all steps:Player Update Options
ThePlayer.Update() method accepts multiple options to control playback:
Playing Tracks
- Play Track
- Play Encoded Track
- Stop Playback
Volume Control
Control the player’s volume (0-1000, default is 100):Pause and Resume
- Pause
- Resume
- Toggle
Position Seeking
Seek to a specific position in the track:lavalink.Millisecond(base unit)lavalink.Second(1000ms)lavalink.Minute(60s)lavalink.Hour(60m)
Combining Options
You can combine multiple options in a single update:Player State
Access the current player state:Handling Track Events
Listen for track lifecycle events:Track End Reasons
| Reason | Description | MayStartNext |
|---|---|---|
finished | Track completed normally | ✅ |
loadFailed | Track failed to load | ✅ |
stopped | Stopped by user/command | ❌ |
replaced | Replaced by another track | ❌ |
cleanup | Cleanup operation | ❌ |
Managing Players
Destroying Players
Clean up a player when done:Iterating Players
Get all active players:Voice State Handling
DisGoLink requires voice state updates from Discord:FAQ
FAQ
Next Steps
Filters
Apply audio filters like bass boost and nightcore
Error Handling
Handle playback errors properly