Skip to content

An Easy and Stylish way of doing Discord Embed Pagination

License

Notifications You must be signed in to change notification settings

chakany/paginationembed

Repository files navigation

paginationembed

An Easy and Stylish way of doing Discord Embed Pagination

CI


Usage

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();

Output

Screenshot_20210917_142849

Installing

With NPM:

npm install @jacany/paginationembed

or Yarn:

yarn add @jacany/paginationembed