From d521a2fe8cc81efeea044f0859246401190dbbbc Mon Sep 17 00:00:00 2001 From: Anri Kennel Date: Mon, 20 Feb 2023 18:43:41 +0100 Subject: [PATCH] Feat: Author in music stuff (#75) Add author in lyrics auto search Add Authors in nowplaying, queue, trackstart event Co-authored-by: Mylloon Reviewed-on: https://git.mylloon.fr/ConfrerieDuKassoulait/Botanique/pulls/75 --- src/commands/music/lyrics.ts | 2 +- src/commands/music/play.ts | 2 +- src/events/player/trackStart.ts | 2 +- src/utils/music.ts | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/commands/music/lyrics.ts b/src/commands/music/lyrics.ts index b0f81da..aa98c2a 100644 --- a/src/commands/music/lyrics.ts +++ b/src/commands/music/lyrics.ts @@ -56,7 +56,7 @@ export default { const title = queue.current?.title; if (title) { try { - data = await client.player.lyrics.search(title); + data = await client.player.lyrics.search(title + " " + queue.current.author); } catch { return await interaction.followUp(`❌ | ${loc.get("c_lyrics2")} \`${title}\``); } diff --git a/src/commands/music/play.ts b/src/commands/music/play.ts index 5499761..5026ed5 100644 --- a/src/commands/music/play.ts +++ b/src/commands/music/play.ts @@ -80,7 +80,7 @@ export default { .setDescription( `${queue.createProgressBar()}\n\n${loc.get("c_play8")} ${track.requestedBy}` ) - .setTitle(track.title) + .setTitle(track.title + " • " + track.author) .setURL(track.url) .setThumbnail(track.thumbnail) .setFooter({ text: loc.get("c_play7") }) diff --git a/src/events/player/trackStart.ts b/src/events/player/trackStart.ts index d733690..599b3d5 100644 --- a/src/events/player/trackStart.ts +++ b/src/events/player/trackStart.ts @@ -10,7 +10,7 @@ export default (queue: Queue, track: Track, client: Client) => { const embed = new EmbedBuilder() .setDescription(`${loc_default?.get("e_trackstart1")} ${track.requestedBy}`) - .setTitle(track.title) + .setTitle(track.title + " • " + track.author) .setURL(track.url) .setThumbnail(track.thumbnail) .setFooter({ diff --git a/src/utils/music.ts b/src/utils/music.ts index 21bf43d..29e8037 100644 --- a/src/utils/music.ts +++ b/src/utils/music.ts @@ -29,7 +29,7 @@ export const embedListQueue = ( const idx_track = idx == 0 ? "" : `${idx * page}. `; embed.addFields({ name, - value: `${idx_track}[${t.title}](${t.url}) (${t.duration})`, + value: `${idx_track}[${t.title} • ${t.author}](${t.url}) (${t.duration})`, }); }); };