1.0.3 • Published 2 years ago

@milanmdev/discordjs-button-pagination v1.0.3

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

@milanmdev/discordjs-button-pagination

A fork of @ryzyx's discordjs-button-pagination package

Usage

const buttonPagination = require("@milanmdev/discordjs-button-pagination");

// Embeds
const embed1 = new Discord.MessageEmbed().setTitle("Embed 1");
const embed2 = new Discord.MessageEmbed().setTitle("Embed 2");

// Buttons
const previousButton = new Discord.MessageButton()
  .setCustomId("previousbtn")
  .setLabel("Previous")
  .setStyle("DANGER");
const nextButton = new Discord.MessageButton()
  .setCustomId("nextbtn")
  .setLabel("Next")
  .setStyle("SUCCESS");

buttonPagination(interaction, [embed1, embed2], [previousButton, nextButton], {
  timeout: Number,
  authorOnly: Boolean,
});
// "timeout" defaults to 120000 (milliseconds)
// "authorOnly" defaults to true

Notice

This will not work with buttons where the style is set as LINK because they do not trigger an interaction event. The buttons will auto disable once the the collector ends after the timeout.

The collector timer resets after receiving a button interaction.

1.0.3

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago