1.4.4 • Published 3 years ago
discord.js-pages v1.4.4
📖 Documentation | 🤖 Examples |
---|
Install 📦
npm i discord.js-pages
Usage 📦
import { PagesBuilder, PagesManager } from 'discord.js-pages';
import { Client, EmbedBuilder } from 'discord.js';
const client = new Client({
intents: [
'Guilds'
]
});
const pagesManager = new PagesManager();
// Middleware is useful in bots with modular commands
client.on('interactionCreate', (interaction) => {
if (!interaction.isCommand()) {
return;
}
pagesManager.middleware(interaction);
interaction.pagesBuilder()
.setTitle('Global title')
.setPages([
new EmbedBuilder()
.setDescription('First page'),
new EmbedBuilder()
.setDescription('Second page')
])
.addFields([
{
name: 'Global field',
value: 'discord.js-pages',
inline: true
}
])
.setColor('Green')
.setPaginationFormat()
.build();
});
// Also you can create PagesBuilder instance directly
client.on('interactionCreate', (interaction) => {
if (!interaction.isCommand()) {
return;
}
new PagesBuilder(interaction)
.setTitle('Global title')
.setPages([
new EmbedBuilder()
.setDescription('First page'),
new EmbedBuilder()
.setDescription('Second page')
])
.addFields([
{
name: 'Global field',
value: 'discord.js-pages',
inline: true
}
])
.setColor('Green')
.build();
});
client.login(process.env.TOKEN);
Demo 🎥
1.4.4
3 years ago
1.4.3
3 years ago
1.4.2
3 years ago
1.4.1
3 years ago
1.4.0
3 years ago
1.3.7
3 years ago
1.3.6
4 years ago
1.3.5
4 years ago
1.3.4
4 years ago
1.3.3
4 years ago
1.3.2
4 years ago
1.3.1
4 years ago
1.3.0
4 years ago
1.3.0-rc.4
4 years ago
1.3.0-rc.5
4 years ago
1.3.0-rc.2
4 years ago
1.3.0-rc.3
4 years ago
1.3.0-rc.1
4 years ago
1.2.0
4 years ago
1.2.2
4 years ago
1.2.1
4 years ago
1.1.2
4 years ago
1.1.1
4 years ago
1.1.0
5 years ago
1.0.2
5 years ago
1.0.1
5 years ago
1.0.0
5 years ago