@discordforge/pagination
v1.0.1
Published
An easy to use pagination component for discord.js
Downloads
16
Maintainers
Readme
Discord.js Pagination Component
Usage
import { PaginationBuilder } from "@discordforge/pagination";
new PaginationBuilder(
// Provide actual data
commands.map(({ data: { name, description } }) => ({
name,
description
})),
// Provide a mapper to convert data into embed fields
async ({ name, description }) => ({
name: `/${name}`,
value: description
})
)
.setTitle("Help Menu")
.setColor(Colors.Blurple)
.build((page) => interaction.reply(page), [interaction.user.id]); // Provide a call back which returns the message & an array of userIds for users who should be able to interact with the component