Create list effects command #412
2 changed files with 2 additions and 2 deletions
|
@ -33,7 +33,7 @@ export default class Effects extends Command {
|
||||||
private async List(interaction: CommandInteraction) {
|
private async List(interaction: CommandInteraction) {
|
||||||
const pageOption = interaction.options.get("page");
|
const pageOption = interaction.options.get("page");
|
||||||
|
|
||||||
const page = pageOption && Number(pageOption.value) ? Number(pageOption.value) : 1;
|
const page = !isNaN(Number(pageOption?.value)) ? Number(pageOption?.value) : 1;
|
||||||
|
|
||||||
const result = await EffectHelper.GenerateEffectEmbed(interaction.user.id, page);
|
const result = await EffectHelper.GenerateEffectEmbed(interaction.user.id, page);
|
||||||
|
|
||||||
|
|
|
@ -80,7 +80,7 @@ export default class EffectHelper {
|
||||||
.setCustomId(`effects list ${page - 1}`)
|
.setCustomId(`effects list ${page - 1}`)
|
||||||
.setLabel("Previous")
|
.setLabel("Previous")
|
||||||
.setStyle(ButtonStyle.Primary)
|
.setStyle(ButtonStyle.Primary)
|
||||||
.setDisabled(page - 1 == 0),
|
.setDisabled(page == 1),
|
||||||
Vylpes marked this conversation as resolved
Outdated
|
|||||||
new ButtonBuilder()
|
new ButtonBuilder()
|
||||||
.setCustomId(`effects list ${page + 1}`)
|
.setCustomId(`effects list ${page + 1}`)
|
||||||
.setLabel("Next")
|
.setLabel("Next")
|
||||||
|
|
Loading…
Reference in a new issue
The 'Previous' button should be disabled when 'page' is 1, not 0.