New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

djs-pagination

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

djs-pagination

Utility to paginate Discord embeds with Discord.js.

  • 1.0.2
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1
decreased by-88.89%
Maintainers
1
Weekly downloads
 
Created
Source

djs-pagination

This is a utility to paginate discord embeds. It's meant for discord.js master (12.0.0) but it should also work for older versions.

Installation

npm install djs-pagination

Usage

Usage

// Import the package
const Paginator = require('djs-pagination');
// Import MessageEmbed (or RichEmbed on stable)
const { MessageEmbed } = require('discord.js');

// First parameter is an array of MessageEmbeds (optional) to be set as the starting pages (you can add to them further with the add method). 
// Second is the filter and the timeout.
// The filter is the same as the Discord.js ReactionCollector filters with ignoring bots & limited to the emojis built-in. 
// The timeout is the time the paginator is active (default 5 minutes).

new Paginator([], { filter: (reaction, user) => user.id === '123', timeout: 60000 }) 
	.add(new MessageEmbed().setTitle('Page 1').setDescription('Description')) // These all need to be MessageEmbeds or RichEmbeds.
	.add(new MessageEmbed().setTitle('Page 2').setDescription('Description'))
	.setEndPage(new MessageEmbed().setTitle('Done')) // This is optional, when the paginator is finished after timeout it will edit itself to become this if provided.
	// Optional, this will be run for every page currently. Put this after you've added all your pages (first parameter current embed, second index, third amount of pages)
	.setTransform((embed, index, total) => embed.setFooter(`Page ${index + 1} / ${total}`)) 
	.start(message.channel); // ID is currently not supported, only a valid text-based channel will work.

Keywords

FAQs

Package last updated on 17 Nov 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc