Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update getting_lyrics.mdx #1943

Merged
merged 1 commit into from
Oct 3, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 3 additions & 10 deletions apps/website/src/pages/guide/_guides/examples/getting_lyrics.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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');

Expand All @@ -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

Expand Down
Loading