right error messages
Some checks failed
PR Check / lint-and-format (pull_request) Failing after 1m24s
Some checks failed
PR Check / lint-and-format (pull_request) Failing after 1m24s
This commit is contained in:
parent
a790ddf377
commit
f6abae1184
1 changed files with 8 additions and 2 deletions
|
@ -91,6 +91,7 @@ export default {
|
||||||
|
|
||||||
const player = useMainPlayer();
|
const player = useMainPlayer();
|
||||||
const queue = useQueue(interaction.guildId!);
|
const queue = useQueue(interaction.guildId!);
|
||||||
|
|
||||||
if (request) {
|
if (request) {
|
||||||
if (
|
if (
|
||||||
interaction.options.getSubcommand() ===
|
interaction.options.getSubcommand() ===
|
||||||
|
@ -108,9 +109,10 @@ export default {
|
||||||
} else if (queue) {
|
} else if (queue) {
|
||||||
const track = queue.history.currentTrack;
|
const track = queue.history.currentTrack;
|
||||||
if (track) {
|
if (track) {
|
||||||
|
request = track.cleanTitle + " " + queue.history.currentTrack?.author;
|
||||||
try {
|
try {
|
||||||
data = await player.lyrics.search({
|
data = await player.lyrics.search({
|
||||||
q: track.cleanTitle + " " + queue.history.currentTrack?.author,
|
q: request,
|
||||||
});
|
});
|
||||||
} catch {
|
} catch {
|
||||||
return await interaction.followUp(`❌ | ${loc.get("c_lyrics2")} \`${track.title}\``);
|
return await interaction.followUp(`❌ | ${loc.get("c_lyrics2")} \`${track.title}\``);
|
||||||
|
@ -196,7 +198,11 @@ export default {
|
||||||
return await interaction.followUp(loc.get("c_lyrics8"));
|
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 title = data[0];
|
||||||
const limit_desc = 4096;
|
const limit_desc = 4096;
|
||||||
const nb_embed = Math.ceil(title.plainLyrics.length / limit_desc);
|
const nb_embed = Math.ceil(title.plainLyrics.length / limit_desc);
|
||||||
|
|
Loading…
Reference in a new issue