An Easy and Stylish way of doing Discord Embed Pagination
const { EmbedBuilder } = require("discord.js");
const { MessagePagination } = require("@jacany/paginationembed");
const array = ["Element 1", "Element 2", "Element 3"];
const embed = new MessagePagination({
embed: new EmbedBuilder(),
itemsPerPage: 2,
startPage: 1,
title: "Values",
timeout: 300000, // Milliseconds before expiry
message: Message, // Pass your Message Object
array,
callbackfn: (value, index) => `**${index + 1}.** ${value}`,
});
embed.build();
With NPM:
npm install @jacany/paginationembed
or Yarn:
yarn add @jacany/paginationembed