Loading Methods
DisGoLink provides two methods for loading tracks:LoadTracks(): Returns aLoadResultthat you handle manuallyLoadTracksHandler(): Uses a handler interface for cleaner result processing
Using LoadTracks()
Using LoadTracksHandler()
The handler interface provides a cleaner way to handle different result types:Search Prefixes
Use search prefixes to search on specific platforms:- YouTube
- YouTube Music
- SoundCloud
- Custom Prefix
Available Search Types
| Prefix | Constant | Description |
|---|---|---|
ytsearch: | SearchTypeYouTube | YouTube search |
ytmsearch: | SearchTypeYouTubeMusic | YouTube Music search |
scsearch: | SearchTypeSoundCloud | SoundCloud search |
Load Result Types
Single Track
Returned when loading a direct track URL:Playlist
Returned when loading a playlist URL:Search Results
Returned when using search prefixes:Empty Result
Returned when no matches are found:Exception
Returned when an error occurs during loading:SeverityCommon: Normal errors (e.g., track not found)SeveritySuspicious: Unusual errors that may indicate issuesSeverityFault: Serious errors that indicate problems with Lavalink
Practical Example
Here’s a complete example handling user input:Decoding Tracks
If you have an encoded track string (e.g., from a database), you can decode it:- Single Track
- Multiple Tracks
FAQ
FAQ
Next Steps
Playing Audio
Learn how to play loaded tracks in voice channels
Error Handling
Handle track loading errors properly