How to create an embed with pagination?

I didnt found any tutorial for v14, if someone wants to share one it would be amazing!
11 Replies
Unknown User
Unknown User16mo ago
Message Not Public
Sign In & Join Server To View
Korrumz2
Korrumz216mo ago
I would also like pagination of embeds, but without the use of "collectors", because after restarting the bot the buttons with collectors will not work. Ideally, someone would like to link an open-source bot that uses discord.js and has a handler to paginate embeds e.g. in the interactionCreate.js event, or somewhere else. As long as it doesn't use collectors.
Unknown User
Unknown User16mo ago
Message Not Public
Sign In & Join Server To View
Korrumz2
Korrumz216mo ago
This code uses collectors, and I wrote that there are not supposed to be any I already have a handler for pagination on collectors that works on a similar principle, but it doesn't quite work (Buttons do not work after restarting the bot) without any error Just "interaction failed" message I hope I have explained everything well
Unknown User
Unknown User16mo ago
Message Not Public
Sign In & Join Server To View
Aman
Aman16mo ago
class Menu {
constructor(...args) {
args = [...args].filter(Boolean);
this.left = args.length === 2 ? args.shift() : [];
this.right = args.pop();
}
next() {
this.left.push(this.right.shift());
return this.right[0];
}
previous() {
this.right.unshift(this.left.pop());
return this.right[0];
}
}
class Menu {
constructor(...args) {
args = [...args].filter(Boolean);
this.left = args.length === 2 ? args.shift() : [];
this.right = args.pop();
}
next() {
this.left.push(this.right.shift());
return this.right[0];
}
previous() {
this.right.unshift(this.left.pop());
return this.right[0];
}
}
You can then implement wherever you want.. as per your code logic
alesi
alesi16mo ago
I will test it asap, thx so much it looks so clean
sludge
sludge16mo ago
this wouldn't work on v14, just FYI
Unknown User
Unknown User16mo ago
Message Not Public
Sign In & Join Server To View
sludge
sludge16mo ago
ok? but the OP asked for v14 examples and your code is v13 so I was just letting you know your code won't work on v14
Unknown User
Unknown User16mo ago
Message Not Public
Sign In & Join Server To View