mirror of
https://github.com/MinazukiAmane/Tinasha-Bot.git
synced 2025-03-15 07:35:57 +08:00
Update lyric.js
This commit is contained in:
parent
e5aff5c763
commit
6e78be0f29
@ -115,7 +115,15 @@ function createLyricsEmbed(lyrics, member, track) {
|
||||
.setThumbnail(track.info.artworkUrl)
|
||||
.setFooter({ text: `Requested by: ${member.user.displayName} | Source: ${lyrics.source || 'Unknown'}` });
|
||||
|
||||
const ltext = lyrics.type === 'text' ? lyrics.text : lyrics.lines.map(v => v.line).join('\n');
|
||||
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";
|
||||
}
|
||||
|
||||
embed.setDescription(ltext.length > 4096 ? ltext.slice(0, 4093) + "..." : ltext);
|
||||
|
||||
return { embeds: [embed] };
|
||||
|
Loading…
x
Reference in New Issue
Block a user