This commit is contained in:
parent
3fc8ea3e28
commit
d29a81c786
3 changed files with 21 additions and 23 deletions
|
@ -3,9 +3,7 @@ import PaginatedEmbed from "../../helpers/PaginatedEmbed";
|
|||
import TestPage from "../../helpers/Pagination/TestPage";
|
||||
import { PaginatedCommand } from "../../type/paginatedCommand";
|
||||
|
||||
export default class Paginationtest extends PaginatedCommand {
|
||||
public paginatedEmbed: PaginatedEmbed<TestPage>;
|
||||
|
||||
export default class Paginationtest extends PaginatedCommand<TestPage> {
|
||||
constructor() {
|
||||
super();
|
||||
|
||||
|
@ -13,8 +11,6 @@ export default class Paginationtest extends PaginatedCommand {
|
|||
.setName('paginationtest')
|
||||
.setDescription('Test the pagination functionality');
|
||||
|
||||
this.paginatedEmbed = new PaginatedEmbed<TestPage>("paginationtest");
|
||||
|
||||
this.InitialisePages();
|
||||
}
|
||||
|
||||
|
@ -24,18 +20,6 @@ export default class Paginationtest extends PaginatedCommand {
|
|||
await page!.sendCommandEmbed(interaction);
|
||||
}
|
||||
|
||||
public override async nextPage(interaction: ButtonInteraction<CacheType>) {
|
||||
const page = this.paginatedEmbed.NextPage();
|
||||
|
||||
await page!.sendButtonEmbed(interaction);
|
||||
}
|
||||
|
||||
public override async previousPage(interaction: ButtonInteraction<CacheType>) {
|
||||
const page = this.paginatedEmbed.PreviousPage();
|
||||
|
||||
await page!.sendButtonEmbed(interaction);
|
||||
}
|
||||
|
||||
private InitialisePages() {
|
||||
const page0 = new TestPage("paginationtest", 0, 2);
|
||||
const page1 = new TestPage("paginationtest", 1, 2);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue