Class GuildLyrics
- Namespace
- Nyra
- Assembly
- Nyra.dll
The lyrics subscription of a guild connection.
public sealed class GuildLyrics
- Inheritance
-
GuildLyrics
- Inherited Members
Methods
SubscribeAsync(bool, CancellationToken)
Subscribes to lyrics updates, LyricsFound delivers the full lyrics, LyricsLine the current line as playback advances, LyricsNotFound when the track has no timed lyrics, and skipTrackSource skips the source's own lyrics.
public Task SubscribeAsync(bool skipTrackSource = false, CancellationToken cancellationToken = default)
Parameters
skipTrackSourceboolWhether to skip the track's source as a provider.
cancellationTokenCancellationTokenA token to cancel the operation.
Returns
- Task
A task that completes when the subscription was sent.
Remarks
NodeLink answers for the current track when it is playing, Lavalink answers from the next track start. On a node that is not NodeLink, this needs a LavaLyrics build that has the subscribe routes. Without them this call fails with a NotSupportedException naming the missing route instead of the raw 404.
Exceptions
- NotSupportedException
The node is not NodeLink and does not have the LavaLyrics plugin, or its LavaLyrics build carries no subscribe route (the released builds).
UnsubscribeAsync(CancellationToken)
Drops the lyrics subscription, LyricsFound and LyricsLine stop arriving.
public Task UnsubscribeAsync(CancellationToken cancellationToken = default)
Parameters
cancellationTokenCancellationTokenA token to cancel the operation.
Returns
- Task
A task that completes when the subscription was dropped.
Remarks
On a node that is not NodeLink, this needs a LavaLyrics build that has the unsubscribe route. Without it this call fails with a NotSupportedException naming the missing route instead of the raw 404.
Exceptions
- NotSupportedException
The node is not NodeLink and does not have the LavaLyrics plugin, or its LavaLyrics build carries no subscribe route (the released builds).