You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// —— This corresponds to the message that was sent by the user to trigger the command
async run(message) {
// —— At the beginning, we are on the first page
let position = 0;
// —— Array of all our pages, a page is an object (an embed)
const pages = [{
title: "This is page 1",
description: "This is an example of a pagination system",
color: "#fcba03"
}, {
title: "Wow, a second page?",
description: "Hi, imagine, all you can do with as many pages as you want ?",
color: "#6f18f2"
}, {
title: "And one more for the road ^^",
description: "There is no page limit, and each page is an object, corresponding to the content of an [embed](https://discord.js.org/#/docs/main/stable/class/MessageEmbed), ",
color: "#f2184b"
}];
// —— Creation of a grey botton, without text, just an emoji, with the ID "previous"
const previous = new MessageButton().setLabel("").setStyle("gray").setEmoji("◀️").setID("previous");
// —— Creation of a grey botton, without text, just an emoji, with the ID "next"
const next = new MessageButton().setLabel("").setStyle("gray").setEmoji("▶️").setID("next");
// —— Checks according to the position if one (or more) buttons should be disabled
Nice