feat: Music support #62
2 changed files with 20 additions and 10 deletions
|
@ -42,16 +42,25 @@ export default {
|
||||||
loc_default?.get(`c_${filename}_opt1_name`) as string
|
loc_default?.get(`c_${filename}_opt1_name`) as string
|
||||||
);
|
);
|
||||||
|
|
||||||
let data;
|
let data = null;
|
||||||
if (request) {
|
if (request) {
|
||||||
|
try {
|
||||||
data = await client.player.lyrics.search(request);
|
data = await client.player.lyrics.search(request);
|
||||||
|
} catch {
|
||||||
|
return await interaction.reply(loc.get("c_lyrics3") + ` \`${request}\``);
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
const queue = client.player.queues.get(interaction.guildId ?? "");
|
const queue = client.player.queues.get(interaction.guildId ?? "");
|
||||||
if (queue) {
|
if (queue) {
|
||||||
data = await client.player.lyrics.search(
|
const title = queue.current?.title;
|
||||||
(queue.current?.author + " " ?? "") + queue.current?.title
|
if (title) {
|
||||||
);
|
try {
|
||||||
|
data = await client.player.lyrics.search(title);
|
||||||
|
} catch {
|
||||||
|
return await interaction.reply(loc.get("c_lyrics3") + ` \`${title}\``);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (data) {
|
if (data) {
|
||||||
|
|
|
@ -114,5 +114,6 @@
|
||||||
"c_lyrics_opt1_name": "chanson",
|
"c_lyrics_opt1_name": "chanson",
|
||||||
"c_lyrics_opt1_desc": "Chanson recherchée",
|
"c_lyrics_opt1_desc": "Chanson recherchée",
|
||||||
"c_lyrics1": "Le bot ne joue rien en ce moment et aucune chanson n'est renseignée.",
|
"c_lyrics1": "Le bot ne joue rien en ce moment et aucune chanson n'est renseignée.",
|
||||||
"c_lyrics2": "Paroles trop longues pour être affichées."
|
"c_lyrics2": "Paroles trop longues pour être affichées.",
|
||||||
|
"c_lyrics3": "Impossible de trouver les paroles pour"
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue