Socket
Book a DemoInstallSign in
Socket

discord-paginator.js

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

discord-paginator.js

A lightweight package to paginate discord message for discord bots

latest
Source
npmnpm
Version
1.0.2
Version published
Maintainers
1
Created
Source

discord-paginator.js

A lightweight package to paginate discord message for discord bots with ease!

How to use? easy!

Install using NPM

npm install discord-paginator.js

Example

const BasePaginator = require('discord-paginator.js')

const pages = ['foo', 'bar'] //return foo at the first page, and bar at the second page

const Paginator = new BasePaginator({
    pages: pages, //the pages
    timeout: 120000, //the timeout for the reaction collector ended (in ms)
    page: 'Page {current}/{total}', //Show the page counter to the message
    filter: (reaction, user) => user.id == message.author.id //to filter the reaction collector
})

Paginator.spawn(message.channel) //to spawn the paginator to specific text channel

Explanation

const Paginator = new BasePaginator({
    pages: Array<String || Discord.MessageEmbed>, //The pages, can contain string or message embed
    remove: String, //The emoji to despawn the paginator
    reset: String, //The emoji to reset the paginator to first page
    reaction: [String, String], //The emoji to move previous or next page
    removeReaction: Boolean, //Remove the user reaction when used
    removeAtEnd: Boolean, //Remove the reactions when the reaction collector is ended
    pageCount: String, //Show the page counter to the message
    timeout: Number, //The timeout for the reaction collector ended (in ms)
    filter: Function //An additional filter for the paginator
})

await Paginator.spawn(Discord.TextChannel) //Spawn the paginator to specific text channel

Keywords

paginate

FAQs

Package last updated on 27 Dec 2020

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