Giter VIP home page Giter VIP logo

djs-buttons-pagination's Introduction

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


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?

djs-buttons-pagination's People

Contributors

ankit-applore avatar diabolusgx avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar

djs-buttons-pagination's Issues

Dude u nailed it ๐Ÿ‘

i was looking for that thing as discord.js-pagination is not updating so i am gonna use it in my project now. I will close this when u reply to this issue.

Cannot read property of 'id' undefined again

Note

Screenshot 2021-08-25 214048

please check the recent reply on my last same issue. it's not a scam link it's ShareX image Uploading server where it stores the image in the server and gives a domain link.

Also the error says itself that id is undefined in index.js in your package, if u dont believe i am attaching a screen shot this time.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.