Class LavalinkRestClient
Represents a class for Lavalink REST calls.
Inheritance
Namespace: DSharpPlus.Lavalink
Assembly: cs.temp.dll.dll
Syntax
public sealed class LavalinkRestClient
Constructors
LavalinkRestClient(ConnectionEndpoint, String)
Creates a new Lavalink REST client.
Declaration
public LavalinkRestClient(ConnectionEndpoint restEndpoint, string password)
Parameters
Type | Name | Description |
---|---|---|
ConnectionEndpoint | restEndpoint | The REST server endpoint to connect to. |
System.String | password | The password for the remote server. |
Properties
RestEndpoint
Gets the REST connection endpoint for this client.
Declaration
public ConnectionEndpoint RestEndpoint { get; }
Property Value
Type | Description |
---|---|
ConnectionEndpoint |
Methods
DecodeTrackAsync(String)
Decodes a base64 track string into a Lavalink track object.
Declaration
public Task<LavalinkTrack> DecodeTrackAsync(string trackString)
Parameters
Type | Name | Description |
---|---|---|
System.String | trackString | The base64 track string. |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<LavalinkTrack> |
DecodeTracksAsync(List<String>)
Decodes a list of base64 track strings into Lavalink track objects.
Declaration
public Task<IEnumerable<LavalinkTrack>> DecodeTracksAsync(List<string> trackStrings)
Parameters
Type | Name | Description |
---|---|---|
List<System.String> | trackStrings | The list of base64 track strings. |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<IEnumerable<LavalinkTrack>> |
DecodeTracksAsync(String[])
Decodes an array of base64 track strings into Lavalink track objects.
Declaration
public Task<IEnumerable<LavalinkTrack>> DecodeTracksAsync(string[] trackStrings)
Parameters
Type | Name | Description |
---|---|---|
System.String[] | trackStrings | The array of base64 track strings. |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<IEnumerable<LavalinkTrack>> |
FreeAddressAsync(String)
Unmarks a failed route planner IP Address.
Declaration
public Task FreeAddressAsync(string address)
Parameters
Type | Name | Description |
---|---|---|
System.String | address | The IP address name to unmark. |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task |
FreeAllAddressesAsync()
Unmarks all failed route planner IP Addresses.
Declaration
public Task FreeAllAddressesAsync()
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task |
GetRoutePlannerStatusAsync()
Retrieves statistics from the route planner.
Declaration
public Task<LavalinkRouteStatus> GetRoutePlannerStatusAsync()
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<LavalinkRouteStatus> | The status ( |
GetTracksAsync(FileInfo)
Loads tracks from a local file.
Declaration
public Task<LavalinkLoadResult> GetTracksAsync(FileInfo file)
Parameters
Type | Name | Description |
---|---|---|
FileInfo | file | File to load tracks from. |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<LavalinkLoadResult> | A collection of tracks from the file. |
GetTracksAsync(String, LavalinkSearchType)
Searches for specified terms.
Declaration
public Task<LavalinkLoadResult> GetTracksAsync(string searchQuery, LavalinkSearchType type = LavalinkSearchType.Youtube)
Parameters
Type | Name | Description |
---|---|---|
System.String | searchQuery | What to search for. |
LavalinkSearchType | type | What platform will search for. |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<LavalinkLoadResult> | A collection of tracks matching the criteria. |
GetTracksAsync(Uri)
Loads tracks from specified URL.
Declaration
public Task<LavalinkLoadResult> GetTracksAsync(Uri uri)
Parameters
Type | Name | Description |
---|---|---|
Uri | uri | URL to load tracks from. |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<LavalinkLoadResult> | A collection of tracks from the URL. |
GetVersionAsync()
Gets the version of the Lavalink server.
Declaration
public Task<string> GetVersionAsync()
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<System.String> |