mirror of
https://github.com/MinazukiAmane/Tinasha-Bot.git
synced 2025-03-15 07:35:57 +08:00
change from lyrics using java timed now used lavalyrics
this change now make the needed of lavalink plugins requirements from java-timed-lyrics to lavalyrics
This commit is contained in:
parent
9090aa0916
commit
12cc645120
@ -69,7 +69,7 @@ async function getLyric({ client, guild, member }, query) {
|
||||
|
||||
// Try default lyrics endpoint first
|
||||
try {
|
||||
const defaultLyricsUrl = `${baseUrl}/v4/sessions/${node.sessionId}/players/${guild.id}/lyrics`;
|
||||
const defaultLyricsUrl = `${baseUrl}/v4/sessions/${node.sessionId}/players/${guild.id}/track/lyrics?skipTrackSource=true`;
|
||||
const defaultRes = await fetch(defaultLyricsUrl, {
|
||||
headers: { Authorization: node.options.authorization }
|
||||
});
|
||||
@ -115,16 +115,10 @@ function createLyricsEmbed(lyrics, member, track) {
|
||||
.setThumbnail(track.info.artworkUrl)
|
||||
.setFooter({ text: `Requested by: ${member.user.displayName} | Source: ${lyrics.source || 'Unknown'}` });
|
||||
|
||||
let ltext;
|
||||
if (lyrics.type === 'text') {
|
||||
ltext = lyrics.text;
|
||||
} else if (lyrics.type === 'timed') {
|
||||
ltext = lyrics.lines.map(line => line.line).join('\n');
|
||||
} else {
|
||||
return "Unsupported lyrics format";
|
||||
}
|
||||
const lines = lyrics.lines.map(line => line.line).filter(Boolean).join("\n");
|
||||
const truncatedLyrics = lines.length > 4096 ? `${lines.slice(0, 4093)}...` : lines;
|
||||
|
||||
embed.setDescription(ltext.length > 4096 ? ltext.slice(0, 4093) + "..." : ltext);
|
||||
embed.setDescription(truncatedLyrics);
|
||||
|
||||
return { embeds: [embed] };
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user