message-buttons-pagination
v1.0.6
Published
A simple but useful module to add paginator buttons to your embeds
Downloads
30
Maintainers
Readme
message-buttons-pagination
How to add the paginator to your command!
const msgPaginator = require("message-buttons-pagination");
//defining Embed and MessageButton
const { MessageEmbed, MessageButton } = require('discord.js');
//sample code
const embed1 = new MessageEmbed()
.setTitle("Page 1")
const embed2 = new MessageEmbed()
.setTitle("Page 2")
//declaring buttons
const btn1 = new MessageButton()
.setLabel("Previous")
.setCustomId("prev")
.setStyle("SUCCESS")
const btn2 = new MessageButton()
.setLabel("Next")
.setCustomId("next")
.setStyle("SUCCESS")
//The pages should be in an array
let pages = [
embed1,
embed2
/*x numbers of embeds*/
]
//putting Buttons in an array
let buttons = [
btn1,
btn2
]
//Defining timeout
//in ms is in default the value of 120000
let timeout = 150000
msgPaginator(message, pages, buttons, timeout)