feat: Music support #62

Merged
Anri merged 43 commits from feat/music into main 2023-02-12 01:11:10 +01:00
2 changed files with 20 additions and 10 deletions
Showing only changes of commit 5ac1d5f7f1 - Show all commits

View file

@ -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) {
data = await client.player.lyrics.search(request); try {
} data = await client.player.lyrics.search(request);
} catch {
const queue = client.player.queues.get(interaction.guildId ?? ""); return await interaction.reply(loc.get("c_lyrics3") + ` \`${request}\``);
if (queue) { }
data = await client.player.lyrics.search( } else {
(queue.current?.author + " " ?? "") + queue.current?.title const queue = client.player.queues.get(interaction.guildId ?? "");
); if (queue) {
const title = 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) {

View file

@ -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"
} }