Nonchalantly Performs Magic

    @milanmdev/discordjs-button-pagination

    1.0.3 • Public • Published

    @milanmdev/discordjs-button-pagination


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



    NPM version NPM downloads


    npm installnfo

    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.

    Install

    npm i @milanmdev/discordjs-button-pagination

    DownloadsWeekly Downloads

    1

    Version

    1.0.3

    License

    MIT

    Unpacked Size

    6.2 kB

    Total Files

    5

    Last publish

    Collaborators

    • milanmdev