From d61107aedd5a7108cd3dc1eb6a542ed38f551e00 Mon Sep 17 00:00:00 2001 From: Max Isom Date: Fri, 30 Apr 2021 12:05:45 -0400 Subject: Add play immediate feature --- src/commands/queue.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/commands/queue.ts') diff --git a/src/commands/queue.ts b/src/commands/queue.ts index 8bfe155..0abc63c 100644 --- a/src/commands/queue.ts +++ b/src/commands/queue.ts @@ -35,7 +35,9 @@ export default class implements Command { const queueSize = player.queueSize(); const queuePage = args[0] ? parseInt(args[0], 10) : 1; - if (queuePage * PAGE_SIZE > queueSize && queuePage > Math.ceil((queueSize + 1) / PAGE_SIZE)) { + const maxQueuePage = Math.ceil((queueSize + 1) / PAGE_SIZE); + + if (queuePage > maxQueuePage) { await msg.channel.send(errorMsg('the queue isn\'t that big')); return; } @@ -70,6 +72,8 @@ export default class implements Command { embed.addField(`${(i + 1 + queuePageBegin).toString()}/${queueSize.toString()}`, song.title, false); }); + embed.addField('Page', `${queuePage} out of ${maxQueuePage}`, false); + await msg.channel.send(embed); } else { await msg.channel.send('queue empty'); -- cgit v1.2.3