Class NodeLyrics
- Namespace
- Nyra
- Assembly
- Nyra.dll
Lyrics, chapters and meanings of the tracks of a node.
public sealed class NodeLyrics
- Inheritance
-
NodeLyrics
- Inherited Members
Methods
LoadAsync(Track, string?, bool, string?, CancellationToken)
Loads a track's lyrics, language applies to NodeLink, skipTrackSource to Lavalink with the LavaLyrics plugin.
public Task<LyricsResult> LoadAsync(Track track, string? language = null, bool skipTrackSource = false, string? source = null, CancellationToken cancellationToken = default)
Parameters
trackTrackThe track to load the lyrics of.
languagestringThe language to prefer, null lets the server pick.
skipTrackSourceboolWhether to skip the track's source as a provider.
sourcestringThe lyrics provider to force, such as
lrclibormusixmatch, null lets the server pick. Only the NodeLink route carries it, honored by recent NodeLink dev builds, the server forces the provider and answers an unknown one with a dedicated error. The LavaLyrics route has no such parameter.cancellationTokenCancellationTokenA token to cancel the operation.
Returns
- Task<LyricsResult>
The lyrics result of the track.
Remarks
For live per-line lyrics use GuildLyrics.SubscribeAsync instead, which on Lavalink needs a plugin build that has the subscribe route.
Exceptions
- NotSupportedException
The node is not NodeLink and does not have the LavaLyrics plugin.
- IncompatibleServerException
The server's /v4/info version is not supported.
LoadChaptersAsync(Track, CancellationToken)
Loads the chapters of a track, in milliseconds, mostly YouTube videos carry them.
public Task<IReadOnlyList<Chapter>> LoadChaptersAsync(Track track, CancellationToken cancellationToken = default)
Parameters
trackTrackThe track to load the chapters of.
cancellationTokenCancellationTokenA token to cancel the operation.
Returns
- Task<IReadOnlyList<Chapter>>
The track's chapters.
Remarks
NodeLink only.
Exceptions
- NotSupportedException
The node is not NodeLink.
- IncompatibleServerException
The server's /v4/info version is not supported.
LoadMeaningAsync(Track, string?, CancellationToken)
Loads the meaning of a track, song lore, translations and cross-references, as its providers resolve them.
public Task<MeaningResult> LoadMeaningAsync(Track track, string? language = null, CancellationToken cancellationToken = default)
Parameters
trackTrackThe track to load the meaning of.
languagestringThe language to prefer, null lets the server pick.
cancellationTokenCancellationTokenA token to cancel the operation.
Returns
- Task<MeaningResult>
The meaning result of the track.
Exceptions
- NotSupportedException
The node is not NodeLink.
- IncompatibleServerException
The server's /v4/info version is not supported.