npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

djs-buttons-pagination

v1.6.2

Published

A simple and easy to use embeds pagination tool that uses only discord.js (no external package) that'll be compatible with upcoming djs v13

Downloads

7

Readme

discord.js v13 Buttons Pagination

This package uses discord.js dev branch which has officially received support for buttons which meand It'll be supported by djs v13.

You can send max 5 buttons in a row and max 5 rows with 1 message but here we're going to implement only 2 buttons for navigating between multiple pages (array of message emebds)

You can pass you own EmojiIdentifierResolvable array (2 emojis) that will be added in each button. 1st emoji - Previous Button 2nd emoji - Next Button


Installation

  • npm install djs-buttons-pagination
  • 🔗https://www.npmjs.com/package/djs-buttons-pagination

Usage

// Import the  package djs-buttons-pagination
const buttonsPagination = require("djs-buttons-pagination");
// If default import does not work, try destructuring the package
const { buttonsPagination } = require("djs-buttons-pagination");

// Make your embeds.
const { MessageEmbed } = require("discord.js");
const embed1 = new MessageEmbed();

// Create an array of embeds
const pages = [embed1, embed2 /* soo on.. however embeds you want*/, , embedx];

// Emojis for buttons -> defaults to ["", ""] i.e no emojis
// You can only use emojiID like ["860348644707794966>", "860348672730464256>"] OR :
const emojiList = ["<a:left_arrow:860348644707794966>", "<a:right_arrow:860348672730464256>"];

// Timeout is the time till the reaction collectors are active, after this buttons will be disabled (in ms), defaults to 60000 (1 min)
const timeout = 30000; // 30 seconds

// Call the paginationEmbed method, first two arguments (message and pages) are required
buttonsPagination(message, pages, emojiList, timeout);

And there you have your latest djs v13 buttons pagination


Preview

Preview


Need Help?

  • Join my discord server: https://discord.gg/8kdx63YsDf