discord-js-button-pagination-ts
TypeScript icon, indicating that this package has built-in type declarations

4.2.0 • Public • Published

discord-js-button-pagination-ts

npm version

Heavily modified jellz' discord.js-pagination, changed to use buttons.

  • Buttons, with custom emoji
  • Select start page
  • Allow a specific member, or everyone to use buttons
  • Paginate Embeds and or messageOptions, or mix both!

This allows unique pagination of messages with only text on one page and multiple embeds on next page!

Requirements

discord.js ^14.14.1 - Or newer

Quick overview

General Usage

import { sendPaginatedMessage } from "discord-js-button-pagination-ts";
import { Message, EmbedBuilder } from "discord.js";

new command("Example command", async (message: Message) => {
    const pages = [new EmbedBuilder()
        .setDescription("Page 1"),
        // Pages can be the BaseMessageOptions object
        {
            content: "Page 2",
            embeds: [
                new EmbedBuilder()
                    .setDescription("Embed on page 2"),
                new EmbedBuilder()
                    .setDescription("Another embed on page 2")],
        }];
    
    await sendPaginatedMessage(message, pages, { owner: message.author, timeout: 30000 });
});

Setting custom emojis and allowing everyone

await sendPaginatedMessage(message, pages, { allowEveryone: true, emojiList: ['👈', '👉'] });

ko-fi

Package Sidebar

Install

npm i discord-js-button-pagination-ts

Weekly Downloads

30

Version

4.2.0

License

MIT

Unpacked Size

14.3 kB

Total Files

11

Last publish

Collaborators

  • cataclym