Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/sheweny/discord-paginator
This module is a prototype of discord embeds paginator using discord.js V13.
https://github.com/sheweny/discord-paginator
discord discord-js javascript nodejs pager paginator
Last synced: about 2 months ago
JSON representation
This module is a prototype of discord embeds paginator using discord.js V13.
- Host: GitHub
- URL: https://github.com/sheweny/discord-paginator
- Owner: Sheweny
- Created: 2021-06-18T19:45:22.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2022-03-28T18:33:24.000Z (almost 3 years ago)
- Last Synced: 2024-05-06T06:45:45.263Z (8 months ago)
- Topics: discord, discord-js, javascript, nodejs, pager, paginator
- Language: TypeScript
- Homepage:
- Size: 30.3 KB
- Stars: 3
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Discord embed paginator
This module is a paginator of embeds using discord.js V13 and array-paginator module.
## Getting started
### Prerequisites
- Node.js 16.6.0 or newer is required.
- Discord.js V13.0.0 is required.
### Installation
With npm
```sh-session
npm install @discord-util/paginator
```With yarn
```sh-session
yarn add @discord-util/paginator
```### Usage
Create a new instance of the EmbedPaginator class.
Parameters :
- Channel : The channel of the paginator (type : `TextChannel|ThreadChannel`)
- Data : A list of embeds to display (type : `Array`)
- Options : The options (type : `Options`)Options :
| Name | Type | Description | Default | Required |
| :------: | :----: | :--------------------: | :-----: | :------: |
| summoner | string | The id of the summoner | None | yes |## Example
```js
const { Client, MessageEmbed } = require("discord.js");
const { EmbedPaginator } = require("@discord-util/paginator");
const embed = new MessageEmbed()
.setTitle("Hi")
.setColor("orange")
.setDescription("Hello");
const embed = new MessageEmbed()
.setTitle("Hello world")
.setColor("blue")
.setDescription("Hello world !");
const data = [embed, embed2];const client = new Client({ intents: ["GUILDS", "GUILD_MESSAGES"] });
client.on("messageCreate", async (msg) => {
const args = msg.content.split(" ");
if (args[0] != "!help") return;
new EmbedPaginator(msg.channel, data, {
summoner: msg.member.id,
maxPerPage: 1,
});
});
client.login("");
```