Skip to content

Commit

Permalink
docs: Document lavasearch integration
Browse files Browse the repository at this point in the history
  • Loading branch information
angelobreuer committed Aug 15, 2023
1 parent e06d890 commit 4dcb52d
Showing 1 changed file with 36 additions and 0 deletions.
36 changes: 36 additions & 0 deletions docs/docs/integrations/lavasearch.md
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.

0 comments on commit 4dcb52d

Please sign in to comment.