From 6ca7ce3e4be92e9240208c76c6bdf1418193ccef Mon Sep 17 00:00:00 2001 From: Marius Begby Date: Wed, 13 Dec 2023 02:16:50 +0100 Subject: [PATCH] fix: change addNumberOption to addIntegerOption --- src/interactions/commands/player/back.ts | 2 +- src/interactions/commands/player/history.ts | 2 +- src/interactions/commands/player/loop.ts | 6 +++--- src/interactions/commands/player/queue.ts | 2 +- src/interactions/commands/player/remove.ts | 2 ++ src/interactions/commands/player/skip.ts | 2 +- src/interactions/commands/player/volume.ts | 2 +- src/interactions/commands/system/shards.ts | 2 +- 8 files changed, 11 insertions(+), 9 deletions(-) diff --git a/src/interactions/commands/player/back.ts b/src/interactions/commands/player/back.ts index d5b04c6..39135a8 100644 --- a/src/interactions/commands/player/back.ts +++ b/src/interactions/commands/player/back.ts @@ -11,7 +11,7 @@ class BackCommand extends BaseSlashCommandInteraction { const data = new SlashCommandBuilder() .setName('back') .setDescription('Go back to previous track or specified position in history.') - .addNumberOption((option) => + .addIntegerOption((option) => option.setName('position').setDescription('The position in history to go back to.').setMinValue(1) ); super(data); diff --git a/src/interactions/commands/player/history.ts b/src/interactions/commands/player/history.ts index 8e71d2e..9da4003 100644 --- a/src/interactions/commands/player/history.ts +++ b/src/interactions/commands/player/history.ts @@ -22,7 +22,7 @@ class HistoryCommand extends BaseSlashCommandInteraction { const data = new SlashCommandBuilder() .setName('history') .setDescription('Show history of tracks that have been played.') - .addNumberOption((option) => + .addIntegerOption((option) => option.setName('page').setDescription('Page number to display for the history').setMinValue(1) ); super(data); diff --git a/src/interactions/commands/player/loop.ts b/src/interactions/commands/player/loop.ts index 8aee213..8c86b20 100644 --- a/src/interactions/commands/player/loop.ts +++ b/src/interactions/commands/player/loop.ts @@ -4,7 +4,7 @@ import { EmbedBuilder, Message, SlashCommandBuilder, - SlashCommandNumberOption + SlashCommandIntegerOption } from 'discord.js'; import { Logger } from 'pino'; import { BaseSlashCommandInteraction } from '../../../classes/interactions'; @@ -17,8 +17,8 @@ class LoopCommand extends BaseSlashCommandInteraction { const data = new SlashCommandBuilder() .setName('loop') .setDescription('Toggle looping a track, the whole queue or autoplay.') - .addNumberOption(() => - new SlashCommandNumberOption() + .addIntegerOption(() => + new SlashCommandIntegerOption() .setName('mode') .setDescription('Loop mode: Track, queue, autoplay or disabled.') .setRequired(false) diff --git a/src/interactions/commands/player/queue.ts b/src/interactions/commands/player/queue.ts index 8cd1790..bd752ff 100644 --- a/src/interactions/commands/player/queue.ts +++ b/src/interactions/commands/player/queue.ts @@ -23,7 +23,7 @@ class QueueCommand extends BaseSlashCommandInteraction { const data = new SlashCommandBuilder() .setName('queue') .setDescription('Show tracks that have been added to the queue.') - .addNumberOption((option) => + .addIntegerOption((option) => option.setName('page').setDescription('Page number to display for the queue').setMinValue(1) ); super(data); diff --git a/src/interactions/commands/player/remove.ts b/src/interactions/commands/player/remove.ts index ef1d5a4..7e454b7 100644 --- a/src/interactions/commands/player/remove.ts +++ b/src/interactions/commands/player/remove.ts @@ -31,12 +31,14 @@ class RemoveCommand extends BaseSlashCommandInteraction { option .setName('start') .setDescription('The starting position of the range to remove') + .setMinValue(1) .setRequired(true) ) .addIntegerOption((option) => option .setName('end') .setDescription('The ending position of the range to remove') + .setMinValue(1) .setRequired(true) ) ) diff --git a/src/interactions/commands/player/skip.ts b/src/interactions/commands/player/skip.ts index f3c738a..978242a 100644 --- a/src/interactions/commands/player/skip.ts +++ b/src/interactions/commands/player/skip.ts @@ -11,7 +11,7 @@ class SkipCommand extends BaseSlashCommandInteraction { const data = new SlashCommandBuilder() .setName('skip') .setDescription('Skip track to next or specified position in queue.') - .addNumberOption((option) => + .addIntegerOption((option) => option.setName('position').setDescription('The position in queue to skip to.').setMinValue(1) ); super(data); diff --git a/src/interactions/commands/player/volume.ts b/src/interactions/commands/player/volume.ts index 55c4b43..c87ebec 100644 --- a/src/interactions/commands/player/volume.ts +++ b/src/interactions/commands/player/volume.ts @@ -11,7 +11,7 @@ class VolumeCommand extends BaseSlashCommandInteraction { const data = new SlashCommandBuilder() .setName('volume') .setDescription('Show or change the playback volume for tracks.') - .addNumberOption((option) => + .addIntegerOption((option) => option .setName('percentage') .setDescription('Volume percentage: From 1% to 100%.') diff --git a/src/interactions/commands/system/shards.ts b/src/interactions/commands/system/shards.ts index ece9a4e..642118d 100644 --- a/src/interactions/commands/system/shards.ts +++ b/src/interactions/commands/system/shards.ts @@ -31,7 +31,7 @@ class ShardsCommand extends BaseSlashCommandInteraction { { name: 'Members', value: 'members' } ) ) - .addNumberOption((option) => + .addIntegerOption((option) => option.setName('page').setDescription('Page number to display for the shards').setMinValue(1) ); const isSystemCommand: boolean = true;