mirror of
https://github.com/darksaid98/cadence-discord-bot.git
synced 2026-12-03 06:28:53 +00:00
fix: solve bug using getNumber after changing to addIntegerOption
This commit is contained in:
1 parent
6ca7ce3e4b
commit
4b630e2512
8 files changed
+8
-8
No files matched your search
@@ -122,7 +122,7 @@ abstract class BaseInteraction {
|
||||
return { text: 'Page 1 of 1 (0 tracks)' };
|
||||
}
|
||||
|
||||
const pageIndex: number = (interaction.options.getNumber('page') || 1) - 1;
|
||||
const pageIndex: number = (interaction.options.getInteger('page') || 1) - 1;
|
||||
const totalPages: number = Math.ceil(queue.tracks.data.length / 10) || 1;
|
||||
return {
|
||||
text: `Page ${pageIndex + 1} of ${totalPages} (${queue.tracks.data.length} tracks)`
|
||||
|
||||
@@ -30,7 +30,7 @@ class BackCommand extends BaseSlashCommandInteraction {
|
||||
checkQueueCurrentTrack
|
||||
]);
|
||||
|
||||
const backToTrackInput: number = interaction.options.getNumber('position')!;
|
||||
const backToTrackInput: number = interaction.options.getInteger('position')!;
|
||||
|
||||
if (backToTrackInput) {
|
||||
return await this.handleBackToTrackPosition(logger, interaction, history, backToTrackInput);
|
||||
|
||||
@@ -182,7 +182,7 @@ class HistoryCommand extends BaseSlashCommandInteraction {
|
||||
}
|
||||
|
||||
private getPageIndex(interaction: ChatInputCommandInteraction): number {
|
||||
return (interaction.options.getNumber('page') || 1) - 1;
|
||||
return (interaction.options.getInteger('page') || 1) - 1;
|
||||
}
|
||||
|
||||
private getTotalPages(history: GuildQueueHistory): number {
|
||||
|
||||
@@ -44,7 +44,7 @@ class LoopCommand extends BaseSlashCommandInteraction {
|
||||
checkQueueExists
|
||||
]);
|
||||
|
||||
const userInputRepeatMode: QueueRepeatMode = interaction.options.getNumber('mode')!;
|
||||
const userInputRepeatMode: QueueRepeatMode = interaction.options.getInteger('mode')!;
|
||||
const currentRepeatMode: QueueRepeatMode = queue.repeatMode;
|
||||
|
||||
if (!userInputRepeatMode && userInputRepeatMode !== 0) {
|
||||
|
||||
@@ -173,7 +173,7 @@ class QueueCommand extends BaseSlashCommandInteraction {
|
||||
}
|
||||
|
||||
private getPageIndex(interaction: ChatInputCommandInteraction): number {
|
||||
return (interaction.options.getNumber('page') || 1) - 1;
|
||||
return (interaction.options.getInteger('page') || 1) - 1;
|
||||
}
|
||||
|
||||
private getTotalPages(queue: GuildQueue): number {
|
||||
|
||||
@@ -30,7 +30,7 @@ class SkipCommand extends BaseSlashCommandInteraction {
|
||||
checkQueueCurrentTrack
|
||||
]);
|
||||
|
||||
const trackPositionInput: number = interaction.options.getNumber('position')!;
|
||||
const trackPositionInput: number = interaction.options.getInteger('position')!;
|
||||
|
||||
if (trackPositionInput) {
|
||||
return await this.handleSkipToTrackPosition(logger, interaction, queue, trackPositionInput);
|
||||
|
||||
@@ -33,7 +33,7 @@ class VolumeCommand extends BaseSlashCommandInteraction {
|
||||
checkQueueExists
|
||||
]);
|
||||
|
||||
const volume: number = interaction.options.getNumber('percentage')!;
|
||||
const volume: number = interaction.options.getInteger('percentage')!;
|
||||
|
||||
if (!volume && volume !== 0) {
|
||||
return await this.handleShowCurrentVolume(queue, logger, interaction);
|
||||
|
||||
@@ -189,7 +189,7 @@ class ShardsCommand extends BaseSlashCommandInteraction {
|
||||
}
|
||||
|
||||
private getPageIndex(interaction: ChatInputCommandInteraction): number {
|
||||
return (interaction.options.getNumber('page') || 1) - 1;
|
||||
return (interaction.options.getInteger('page') || 1) - 1;
|
||||
}
|
||||
|
||||
private getTotalPages(shardCount: number): number {
|
||||
|
||||
Reference in new issue
Block a user