Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mrzillagold/discord.js-pages
📦 Dynamic pages pagination module for discord.js
https://github.com/mrzillagold/discord.js-pages
discord discordjs pages pagination
Last synced: 3 months ago
JSON representation
📦 Dynamic pages pagination module for discord.js
- Host: GitHub
- URL: https://github.com/mrzillagold/discord.js-pages
- Owner: MrZillaGold
- License: gpl-3.0
- Created: 2020-12-15T15:35:05.000Z (about 4 years ago)
- Default Branch: master
- Last Pushed: 2023-03-06T23:01:01.000Z (almost 2 years ago)
- Last Synced: 2024-10-17T14:13:12.992Z (4 months ago)
- Topics: discord, discordjs, pages, pagination
- Language: TypeScript
- Homepage: https://npmjs.com/package/discord.js-pages
- Size: 3.79 MB
- Stars: 12
- Watchers: 1
- Forks: 0
- Open Issues: 11
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
discord.js-pages
📦 Dynamic pages pagination module for discord.js
| 📖 [Documentation](https://mrzillagold.github.io/discord.js-pages/index.html) | [🤖 Examples](https://github.com/MrZillaGold/discord.js-pages/tree/master/examples) |
|-------------------------------------------------------------------------------|-------------------------------------------------------------------------------------|### Install 📦
`npm i discord.js-pages`### Usage 📦
```js
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 🎥