From 625bf4ece461553e916f56b6fdba4ffe954d432d Mon Sep 17 00:00:00 2001 From: Ziji <104454302+zijipia@users.noreply.github.com> Date: Fri, 4 Oct 2024 01:44:15 +0700 Subject: [PATCH] Update getting_lyrics.mdx (#1943) Fix lrclib url lrclib return: id: 1064245, name: 'unlasting', trackName: 'unlasting', artistName: 'LiSA', albumName: 'unlasting', duration: 297, instrumental: false, .... --- .../pages/guide/_guides/examples/getting_lyrics.mdx | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/apps/website/src/pages/guide/_guides/examples/getting_lyrics.mdx b/apps/website/src/pages/guide/_guides/examples/getting_lyrics.mdx index 253dbe3e0..5ed5cf146 100644 --- a/apps/website/src/pages/guide/_guides/examples/getting_lyrics.mdx +++ b/apps/website/src/pages/guide/_guides/examples/getting_lyrics.mdx @@ -4,7 +4,7 @@ Discord Player provides two different methods for getting lyrics of a song. The ## New Method -This method is built into discord-player itself and provides both plaintext and synced lyrics. This method is more robust and reliable than the old method. It is powered by [lrclib](https://liclib.net). +This method is built into discord-player itself and provides both plaintext and synced lyrics. This method is more robust and reliable than the old method. It is powered by [lrclib](https://lrclib.net). #### Plain Lyrics @@ -18,14 +18,7 @@ if (!lyrics.length) return interaction.followUp({ content: 'No lyrics found', ep const trimmedLyrics = lyrics[0].plainLyrics.substring(0, 1997); const embed = new EmbedBuilder() - .setTitle(lyrics[0].title) - .setURL(lyrics[0].url) - .setThumbnail(lyrics[0].thumbnail) - .setAuthor({ - name: lyrics[0].artist.name, - iconURL: lyrics[0].artist.image, - url: lyrics[0].artist.url - }) + .setTitle(`${lyrics[0].trackName} - ${lyrics[0].artistName}`) .setDescription(trimmedLyrics.length === 1997 ? `${trimmedLyrics}...` : trimmedLyrics) .setColor('Yellow'); @@ -46,7 +39,7 @@ if (!first.syncedLyrics) { } // load raw lyrics to the queue -const syncedLyrics = queue.syncedLyrics(lyrics); +const syncedLyrics = queue.syncedLyrics(first); syncedLyrics.at(timestampInMilliseconds); // manually get a line at a specific timestamp