Fix command not allowing multiple instances of the embeds
This commit is contained in:
parent
d29a81c786
commit
0b6bb9a17d
5 changed files with 22 additions and 98 deletions
|
@ -1,5 +1,4 @@
|
|||
import { ButtonInteraction, CacheType, CommandInteraction, SlashCommandBuilder } from "discord.js";
|
||||
import PaginatedEmbed from "../../helpers/PaginatedEmbed";
|
||||
import { CacheType, CommandInteraction, SlashCommandBuilder } from "discord.js";
|
||||
import TestPage from "../../helpers/Pagination/TestPage";
|
||||
import { PaginatedCommand } from "../../type/paginatedCommand";
|
||||
|
||||
|
@ -15,9 +14,7 @@ export default class Paginationtest extends PaginatedCommand<TestPage> {
|
|||
}
|
||||
|
||||
public override async execute(interaction: CommandInteraction<CacheType>) {
|
||||
const page = this.paginatedEmbed.GetCurrentPage();
|
||||
|
||||
await page!.sendCommandEmbed(interaction);
|
||||
await this.sendCommandEmbed(interaction, 0);
|
||||
}
|
||||
|
||||
private InitialisePages() {
|
||||
|
@ -25,6 +22,6 @@ export default class Paginationtest extends PaginatedCommand<TestPage> {
|
|||
const page1 = new TestPage("paginationtest", 1, 2);
|
||||
const page2 = new TestPage("paginationtest", 2, 2);
|
||||
|
||||
this.paginatedEmbed.AddPages(page0, page1, page2);
|
||||
this.pages = [ page0, page1, page2 ];
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue