From be6ec29a03288a0533e25c142f1c5c06022eb611 Mon Sep 17 00:00:00 2001 From: appujet Date: Sat, 14 Sep 2024 22:55:27 +0530 Subject: [PATCH] fix: requester embed --- src/commands/music/Grab.ts | 2 +- src/commands/music/Nowplaying.ts | 2 +- src/commands/music/Queue.ts | 4 ++-- src/events/client/SetupButtons.ts | 2 +- src/utils/SetupSystem.ts | 20 +++++++++----------- 5 files changed, 14 insertions(+), 16 deletions(-) diff --git a/src/commands/music/Grab.ts b/src/commands/music/Grab.ts index cb421a390..7d0bf1f5d 100644 --- a/src/commands/music/Grab.ts +++ b/src/commands/music/Grab.ts @@ -49,7 +49,7 @@ export default class Grab extends Command { uri: song.info.uri, artworkUrl: song.info.artworkUrl, length: song.info.isStream ? "LIVE" : client.utils.formatTime(song.info.duration), - requester: `<@${(song.requester as Requester).id}>`, + requester: (song.requester as Requester).id, }); try { diff --git a/src/commands/music/Nowplaying.ts b/src/commands/music/Nowplaying.ts index f9ba021c5..196705310 100644 --- a/src/commands/music/Nowplaying.ts +++ b/src/commands/music/Nowplaying.ts @@ -49,7 +49,7 @@ export default class Nowplaying extends Command { ctx.locale("cmd.nowplaying.track_info", { title: track.info.title, uri: track.info.uri, - requester: `<@${(track.requester as any).id}>`, + requester: (track.requester as any).id, bar: bar, }), ) diff --git a/src/commands/music/Queue.ts b/src/commands/music/Queue.ts index 968fdba6f..b3fd7180e 100644 --- a/src/commands/music/Queue.ts +++ b/src/commands/music/Queue.ts @@ -40,7 +40,7 @@ export default class Queue extends Command { ctx.locale("cmd.queue.now_playing", { title: player.queue.current.info.title, uri: player.queue.current.info.uri, - requester: `<@${(player.queue.current.requester as any).id}>`, + requester: (player.queue.current.requester as any).id, duration: player.queue.current.info.isStream ? ctx.locale("cmd.queue.live") : client.utils.formatTime(player.queue.current.info.duration), @@ -57,7 +57,7 @@ export default class Queue extends Command { index: i + 1, title: track.info.title, uri: track.info.uri, - requester: `<@${(track.requester as any).id}>`, + requester: (track.requester as any).id, duration: track.info.isStream ? ctx.locale("cmd.queue.live") : client.utils.formatTime(track.info.duration), }), ); diff --git a/src/events/client/SetupButtons.ts b/src/events/client/SetupButtons.ts index 9a04a4d4d..3b7d6429e 100644 --- a/src/events/client/SetupButtons.ts +++ b/src/events/client/SetupButtons.ts @@ -55,7 +55,7 @@ export default class SetupButtons extends Event { }) .setColor(this.client.color.main) .setDescription( - `[${title}](${uri}) - ${isStream ? T(locale, "event.setupButton.live") : this.client.utils.formatTime(duration)} - ${T(locale, "event.setupButton.requested_by", { requester: `<@${(player.queue.current.requester as Requester).id}>` })}`, + `[${title}](${uri}) - ${isStream ? T(locale, "event.setupButton.live") : this.client.utils.formatTime(duration)} - ${T(locale, "event.setupButton.requested_by", { requester: (player.queue.current.requester as Requester).id })}`, ) .setImage(artworkUrl || this.client.user.displayAvatarURL({ extension: "png" })); diff --git a/src/utils/SetupSystem.ts b/src/utils/SetupSystem.ts index 6eb3b23be..993ff10e5 100644 --- a/src/utils/SetupSystem.ts +++ b/src/utils/SetupSystem.ts @@ -24,7 +24,7 @@ function neb(embed: EmbedBuilder, player: Player, client: Lavamusic, locale: str uri: player.queue.current.info.uri, author: player.queue.current.info.author, length: client.utils.formatTime(player.queue.current.info.duration), - requester: `<@${(player.queue.current.requester as Requester).id}>`, + requester: (player.queue.current.requester as Requester).id, }); return embed .setAuthor({ @@ -80,14 +80,12 @@ async function setupStart(client: Lavamusic, query: string, player: Player, mess await message.channel .send({ embeds: [ - embed - .setColor(client.color.main) - .setDescription( - T(locale, "player.setupStart.added_to_queue", { - title: res.tracks[0].info.title, - uri: res.tracks[0].info.uri, - }), - ), + embed.setColor(client.color.main).setDescription( + T(locale, "player.setupStart.added_to_queue", { + title: res.tracks[0].info.title, + uri: res.tracks[0].info.uri, + }), + ), ], }) .then((msg) => setTimeout(() => msg.delete(), 5000)); @@ -152,7 +150,7 @@ async function trackStart( uri: track.info.uri, author: track.info.author, length: client.utils.formatTime(track.info.duration), - requester: `<@${(track.requester as Requester).id}>`, + requester: (player.queue.current.requester as Requester).id, }); const embed = client @@ -215,7 +213,7 @@ async function updateSetup(client: Lavamusic, guild: any, locale: string): Promi uri: player.queue.current.info.uri, author: player.queue.current.info.author, length: client.utils.formatTime(player.queue.current.info.duration), - requester: `<@${(player.queue.current.requester as Requester).id}>`, + requester: (player.queue.current.requester as Requester).id, }); const embed = client