From ffd2270e80b6676e3e4b7519b486873cd07876ca Mon Sep 17 00:00:00 2001 From: Mylloon Date: Thu, 7 Nov 2024 16:04:01 +0100 Subject: [PATCH] right error messages --- src/commands/music/lyrics.ts | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/commands/music/lyrics.ts b/src/commands/music/lyrics.ts index d420d85..1a4cb46 100644 --- a/src/commands/music/lyrics.ts +++ b/src/commands/music/lyrics.ts @@ -91,6 +91,7 @@ export default { const player = useMainPlayer(); const queue = useQueue(interaction.guildId!); + if (request) { if ( interaction.options.getSubcommand() === @@ -108,9 +109,10 @@ export default { } else if (queue) { const track = queue.history.currentTrack; if (track) { + request = track.cleanTitle + " " + queue.history.currentTrack?.author; try { data = await player.lyrics.search({ - q: track.cleanTitle + " " + queue.history.currentTrack?.author, + q: request, }); } catch { return await interaction.followUp(`❌ | ${loc.get("c_lyrics2")} \`${track.title}\``); @@ -196,7 +198,11 @@ export default { return await interaction.followUp(loc.get("c_lyrics8")); } - if (data && data.length > 0 && data[0].plainLyrics !== null) { + if (data) { + if (data.length === 0 || (data.length > 0 && data[0].plainLyrics !== null)) { + return await interaction.followUp(`❌ | ${loc.get("c_lyrics2")} \`${request}\``); + } + const title = data[0]; const limit_desc = 4096; const nb_embed = Math.ceil(title.plainLyrics.length / limit_desc); -- 2.45.2