diff --git a/src/buttonEvents/View.ts b/src/buttonEvents/View.ts index b59f426..f79a1af 100644 --- a/src/buttonEvents/View.ts +++ b/src/buttonEvents/View.ts @@ -5,7 +5,7 @@ import CardSearchHelper from "../helpers/CardSearchHelper.js"; export default class View extends ButtonEvent { public override async execute(interaction: ButtonInteraction) { const page = interaction.customId.split(" ")[1]; - const results = interaction.customId.split(" ").splice(1); + const results = interaction.customId.split(" ").splice(2); await interaction.deferUpdate(); diff --git a/src/commands/view.ts b/src/commands/view.ts index 86b90aa..6268577 100644 --- a/src/commands/view.ts +++ b/src/commands/view.ts @@ -24,7 +24,7 @@ export default class View extends Command { await interaction.deferReply(); - const searchResult = await CardSearchHelper.GenerateSearchQuery(name.value!.toString(), interaction.user.id, 0); + const searchResult = await CardSearchHelper.GenerateSearchQuery(name.value!.toString(), interaction.user.id, 5); if (!searchResult) { await interaction.editReply("No results found"); diff --git a/src/helpers/CardSearchHelper.ts b/src/helpers/CardSearchHelper.ts index 1c68c44..29014f7 100644 --- a/src/helpers/CardSearchHelper.ts +++ b/src/helpers/CardSearchHelper.ts @@ -110,7 +110,7 @@ export default class CardSearchHelper { .setCustomId(`view ${page + 1} ${results.join(" ")}`) .setLabel("Next") .setStyle(ButtonStyle.Primary) - .setDisabled(page + 1 == results.length)); + .setDisabled(page == results.length)); return { embed, row, attachment, results }; }