# discord-paginator.js

> A lightweight package to paginate discord message for discord bots

Latest version **1.0.2** (published 2020-12-27) · MIT license · 0 weekly downloads

## Install

```sh
npm install discord-paginator.js
pnpm add discord-paginator.js
yarn add discord-paginator.js
bun add discord-paginator.js
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.2 |
| Published | 2020-12-27 |
| First published | 2020-12-27 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 7.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Azusfin#9887 |
| Maintainers | xzusfin |
| Keywords | paginate, discord, discord.js, menus, discord-menu, discord-pagination, menus, pagination |

## Links

- npm: https://www.npmjs.com/package/discord-paginator.js
- Repository: https://github.com/XzFirzal/discord-paginator.js
- Issues: https://github.com/XzFirzal/discord-paginator.js/issues
- npm.io page: https://npm.io/package/discord-paginator.js

## Recent versions

- 1.0.2 (latest) — 2020-12-27
- 1.0.1 — 2020-12-27
- 1.0.0 — 2020-12-27

## README

# discord-paginator.js
A lightweight package to paginate discord message for discord bots with ease!

# How to use? easy!
# Install using NPM
```properties
npm install discord-paginator.js
```

# Example
```js
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
```js
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
```

---
_Source: https://npm.io/package/discord-paginator.js · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
