Skip to content

Commit

Permalink
fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Blocksnmore committed Nov 10, 2024
1 parent 32f2316 commit b981a03
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 9 deletions.
5 changes: 4 additions & 1 deletion commands/music/queue.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,10 @@ export default class Queue extends Command {
emoji("eight"),
emoji("nine"),
];
const queueEntries = queue.player.queue.tracks;
const queueEntries = [
queue.player.current,
...queue.player.queue.tracks,
];

await ctx.message.reply(undefined, {
embeds: [
Expand Down
6 changes: 3 additions & 3 deletions commands/music/remove.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ export default class Remove extends Command {
ctx.argString == "" ||
isNaN(parseInt(ctx.argString)) ||
parseInt(ctx.argString) < 1 ||
parseInt(ctx.argString) > queue.player.queue.size
parseInt(ctx.argString) > queue.player.queue.size + 1
) {
await ctx.message.reply({
embeds: [
Expand All @@ -80,8 +80,8 @@ export default class Remove extends Command {
});
} else {
const position = parseInt(ctx.argString);
const track = queue.player.queue.get(position);
const _remove = queue.player.queue.remove(position);
const track = queue.player.queue.get(position - 1);
const _remove = queue.player.queue.remove(position - 1);

await ctx.message.reply({
embeds: [
Expand Down
11 changes: 6 additions & 5 deletions interactions/music/queue.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import {
MessageComponentInteraction,
} from "harmony";
import { emoji } from "emoji";
import { queues } from "queue";
import { playerEventHandlers, queues } from "queue";
import { formatMs } from "tools";

export async function button(i: MessageComponentInteraction) {
Expand Down Expand Up @@ -66,7 +66,10 @@ export async function button(i: MessageComponentInteraction) {
icon_url: i.client.user!.avatarURL(),
},
title: "Server queue",
description: queue.player.queue.tracks
description: [
queue.player.current,
...queue.player.queue.tracks,
]
.slice(startingValue, startingValue + 10)
.map(
({ title, url }, index) =>
Expand All @@ -83,9 +86,7 @@ export async function button(i: MessageComponentInteraction) {
icon_url: i.user.avatarURL(),
text:
`Songs in queue: ${queue.player.queue.size} | Length: ${
formatMs(
queue.queueLength,
)
formatMs(queue.queueLength)
}`,
},
}).setColor("random"),
Expand Down

0 comments on commit b981a03

Please sign in to comment.