Skip to content

Commit

Permalink
fix: requester embed
Browse files Browse the repository at this point in the history
  • Loading branch information
appujet committed Sep 14, 2024
1 parent af71145 commit be6ec29
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 16 deletions.
2 changes: 1 addition & 1 deletion src/commands/music/Grab.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion src/commands/music/Nowplaying.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
}),
)
Expand Down
4 changes: 2 additions & 2 deletions src/commands/music/Queue.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand All @@ -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),
}),
);
Expand Down
2 changes: 1 addition & 1 deletion src/events/client/SetupButtons.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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" }));

Expand Down
20 changes: 9 additions & 11 deletions src/utils/SetupSystem.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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({
Expand Down Expand Up @@ -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));
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit be6ec29

Please sign in to comment.