getCurrentPlayingTrackLyrics method

Future<Lyrics?> getCurrentPlayingTrackLyrics(
  1. String guildId, {
  2. bool shouldSkipTrackSource = false,
})

Gets the lyrics of the current playing track. By default, it will try to fetch the lyrics from where the track is sourced from. E.g. if the track is from Deezer it will try to fetch the lyrics from Deezer. You can disable this behavior by setting shouldSkipTrackSource to true.

Implementation

Future<Lyrics?> getCurrentPlayingTrackLyrics(String guildId, {bool shouldSkipTrackSource = false}) async {
  final response = await client.executeSafe(
    'GET',
    '/v4/sessions/${client.connection.sessionId}/players/$guildId/track/lyrics',
    queryParameters: {'skipTrackSource': shouldSkipTrackSource.toString()},
  );

  // 204: No Content
  if (response.isEmpty) {
    return null;
  }

  return Lyrics.fromJson(jsonDecode(response));
}