1.5.1 • Published 4 years ago
discord-epagination v1.5.1
discord-epagination
A package to paginate embeds. Compatible with discord.js v13+. Note, it's a package that was make to fix the discord-slider package.
Installation
To install the latest version :
npm i discord-epaginationTo install a specific version :
npm i discord-epagination@versionFunction
createSlider(options);- options (SliderOptions)
Example
// Import the function from the package
const { createSlider } = require("discord-epagination");
// Import MessageEmbed from discord.js
const { MessageEmbed } = require("discord.js");
// Creates very basic embeds
const embeds = [];
for (let i = 0; i < 10; i++) {
const embed = new MessageEmbed().setDescription(`Page ${i + 1}`);
embeds.push(embed);
}
// Call the function
createSlider({
// Command interaction object from discord.js
interaction,
// Array of embeds that will be paginated
embeds: embeds,
// Other buttons
otherButtons: {
// First page button
firstButton: {
enabled: true,
// Make the button behind the back and foward buttons. [..., "previous", "next"]
position: 0,
},
// Last page button
lastButton: {
enabled: true,
// Make the button in front of the back and foward buttons. ["first", "previous", "next", ...]
position: 3,
},
// Delete button
deleteButton: {
enabled: true,
// Make the button in the middle of all the buttons. ["first", "previous", ... , "next", "last"]
position: 2,
},
},
// Button customization
buttons: [
// Customization for the back button
{ name: "back", emoji: "◀", style: "PRIMARY" },
// Customization for the foward button
{ name: "foward", emoji: "▶", style: "PRIMARY" },
// Customization for the first page button
{ name: "first", emoji: "⏪", style: "PRIMARY" },
// Customization for the last page button
{ name: "last", emoji: "⏩", style: "PRIMARY" },
// Customization for the delete button
{ name: "delete", emoji: "❌", style: "DANGER" },
],
// Duration wich will define how much time the buttons will be interactable.
time: 60000,
});1.5.1
4 years ago
1.5.0
4 years ago
1.4.5
5 years ago
1.4.4
5 years ago
1.4.3-2
5 years ago
1.4.3
5 years ago
1.4.2
5 years ago
1.4.1
5 years ago
1.4.0
5 years ago
1.3.1
5 years ago
1.3.0
5 years ago
1.4.3-1
5 years ago
1.4.2-2
5 years ago
1.4.2-1
5 years ago
1.4.1-2
5 years ago
1.4.2-0
5 years ago
1.4.1-1
5 years ago
1.2.6
5 years ago
1.2.5
5 years ago
1.2.6-1
5 years ago
1.2.4
5 years ago
1.2.3
5 years ago
1.2.21
5 years ago
1.2.22
5 years ago
1.2.0
5 years ago
1.1.1
5 years ago
1.1.0
5 years ago
1.2.2
5 years ago
1.2.1
5 years ago
1.0.0
5 years ago