This commit is contained in:
parent
767616b617
commit
4c5704531e
3 changed files with 3 additions and 3 deletions
|
@ -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();
|
||||
|
||||
|
|
|
@ -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");
|
||||
|
|
|
@ -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 };
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue