-
-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docs: Document lavasearch integration
- Loading branch information
1 parent
e06d890
commit 4dcb52d
Showing
1 changed file
with
36 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
# LavaSearch | ||
|
||
The [LavaSearch](https://github.com/topi314/LavaSearch) lavalink plugin allows to search tracks more advanced than the default Lavalink search. | ||
|
||
## Installation | ||
|
||
For using the Lavasrc integration, you need to install the [`Lavalink4NET.Integrations.Lavasearch`](https://www.nuget.org/packages/Lavalink4NET.Integrations.Lavasearch) package. | ||
|
||
:::caution | ||
You need to have the [Lavasearch plugin](https://github.com/topi314/Lavasearch#lavalink-usage) installed on your Lavalink server. | ||
::: | ||
|
||
## Usage | ||
|
||
In order to resolve tracks using the Lavasearch integration, you can use the `SearchAsync` method on the `ITrackManager` interface. | ||
|
||
:::info | ||
In the following example, the track is resolved using Spotify. Lavasearch works together with search plugins like Lavasrc which need to be installed on the Lavalink server. | ||
::: | ||
|
||
```cs | ||
var searchResult = await audio.Tracks.SearchAsync( | ||
query: "[...]", | ||
loadOptions: new TrackLoadOptions(SearchMode: TrackSearchMode.Spotify), | ||
categories: ImmutableArray.Create(SearchCategory.Track)); | ||
|
||
var tracks = searchResult.Tracks; | ||
var playlists = searchResult.Playlists; | ||
var albums = searchResult.Albums; | ||
var artists = searchResult.Artists; | ||
var texts = searchResult.Texts; | ||
``` | ||
|
||
You can specify the search mode using the `TrackLoadOptions` parameter. The categories Lavasearch should search for can be specified using the `categories` parameter. | ||
|
||
Depending on what categories you specified, the `SearchResult` object will contain tracks, playlists, albums, artists and/or texts. |