1.0.2 • Published 6 years ago
discord-paging v1.0.2
Light Discord Paging System
Links
Installation
npm install discord-paging
Example for simple guild list
const Discord = require("discord.js")
const Paging = require("discord-paging")
const client = new Discord.Client()
var book;
client.login("token")
client.on("ready", () => {
// Array of embeds (src.map(=>embed))
const embeds = client.guilds.map( (guild, index) => {
const embed = new Discord.RichEmbed()
.setTitle(guild.name)
.setImage(guild.iconURL)
.setFooter(
`Page : ${index} / ${client.guilds.size}`,
client.user.avatarURL
)
return embed
})
// Destination channel (TextChannel)
const channel = client.channels.first()
// Start system
book |= new Paging( embeds, channel)
})