aboutsummaryrefslogtreecommitdiff
path: root/src/commands/queue.ts
diff options
context:
space:
mode:
authorTiago Grosso <[email protected]>2024-08-23 21:18:08 +0100
committerTiago Grosso <[email protected]>2024-08-23 21:22:34 +0100
commit6e39c8d09ed8f7460f54fb766efddd507f368523 (patch)
tree46d0c8c4eb3a2aee1bdcef18fec6285db732801a /src/commands/queue.ts
parent1e17b94321744ffbe4a6176a900286a834c952d1 (diff)
downloadmuse-6e39c8d09ed8f7460f54fb766efddd507f368523.tar.xz
muse-6e39c8d09ed8f7460f54fb766efddd507f368523.zip
feat: add optional pageSize to /queue command
Diffstat (limited to 'src/commands/queue.ts')
-rw-r--r--src/commands/queue.ts10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/commands/queue.ts b/src/commands/queue.ts
index 5196ca9..dcc674a 100644
--- a/src/commands/queue.ts
+++ b/src/commands/queue.ts
@@ -14,6 +14,10 @@ export default class implements Command {
.addIntegerOption(option => option
.setName('page')
.setDescription('page of queue to show [default: 1]')
+ .setRequired(false))
+ .addIntegerOption(option => option
+ .setName('pageSize')
+ .setDescription('how many items to display per page [default: 10]')
.setRequired(false));
private readonly playerManager: PlayerManager;
@@ -25,7 +29,11 @@ export default class implements Command {
public async execute(interaction: ChatInputCommandInteraction) {
const player = this.playerManager.get(interaction.guild!.id);
- const embed = buildQueueEmbed(player, interaction.options.getInteger('page') ?? 1);
+ const embed = buildQueueEmbed(
+ player,
+ interaction.options.getInteger('page') ?? 1,
+ interaction.options.getInteger('pageSize') ?? 10,
+ );
await interaction.reply({embeds: [embed]});
}