the previous one didnt work

This commit is contained in:
derpystuff 2023-03-03 19:50:15 +01:00
parent ccc8fb0a9f
commit 8f8d3db252

View file

@ -159,11 +159,6 @@ module.exports = class Paginator {
}
if(listener) await listener.stop()
// No need for a paginator if we only have one page.
if(data.pages.length == 1){
data.buttons = data.buttons.filter((i)=>!["next","previous"].includes(i))
}
const instance = new InteractionPaginator(this, data);
this.activeListeners.push(instance);
@ -174,6 +169,12 @@ module.exports = class Paginator {
// Edit below to change default button set
this.buttons = typeof data.buttons !== "object" ? ["previous", "next"] : data.buttons;
// No need for a paginator if we only have one page.
if(data.pages.length == 1){
if(this.buttons) this.buttons = this.buttons.filter((i)=>!["next","previous"].includes(i))
}
if (instance.commandMessage === null && data.pages) {
await instance.init();
}