Fix unable to find cards issue
All checks were successful
Test / build (push) Successful in 8s

This commit is contained in:
Ethan Lane 2024-08-23 18:00:15 +01:00
parent 767616b617
commit 4c5704531e
3 changed files with 3 additions and 3 deletions

View file

@ -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();

View file

@ -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");

View file

@ -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 };
}