1.5.1 • Published 2 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-epagination
To install a specific version :
npm i discord-epagination@version
Function
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
2 years ago
1.5.0
2 years ago
1.4.5
3 years ago
1.4.4
3 years ago
1.4.3-2
3 years ago
1.4.3
3 years ago
1.4.2
3 years ago
1.4.1
3 years ago
1.4.0
3 years ago
1.3.1
3 years ago
1.3.0
3 years ago
1.4.3-1
3 years ago
1.4.2-2
3 years ago
1.4.2-1
3 years ago
1.4.1-2
3 years ago
1.4.2-0
3 years ago
1.4.1-1
3 years ago
1.2.6
3 years ago
1.2.5
3 years ago
1.2.6-1
3 years ago
1.2.4
3 years ago
1.2.3
3 years ago
1.2.21
3 years ago
1.2.22
3 years ago
1.2.0
3 years ago
1.1.1
3 years ago
1.1.0
3 years ago
1.2.2
3 years ago
1.2.1
3 years ago
1.0.0
3 years ago