discord-slider
Version:
Allow you to easily create beautiful page slider for your discord.js bot
47 lines (36 loc) • 1.47 kB
Markdown
<div align="center">
<p>
<img src="https://gist.githubusercontent.com/gaetan20/1bebbfc6893e602c0a4bf114b75b50ae/raw/046282162ad7d47f222a7419960705817bb68c2a/logo-discord-slider.svg" alt="discord-slider" />
<a href="url"><img src="https://s3.gifyu.com/images/ezgif-4-2cbac007a4ac.gif" style="border-radius: 10px 10px 10px 10px;" alt="Gif example"></a>
</p>
<br>
</div>
discord-slider is a package that allow you to easily create multipage help commands (for example) with buttons.
## Install
```sh
npm install discord-slider
```
## Setup
```js
const discord = require('discord.js');
const client = new discord.Client();
require("discord-buttons")(client); // must be below your discord.Client()
require('discord-slider')(client); // must be below your discord.Client()
```
### You absolutly need to require both discord-buttons and discord-slider !
<br />
## Method
```js
channel.createSlider(userID, embedsArray, emojiNext, emojiBack)
```
- If you don't precise any emojiNext and emojiBack, they will be ">>" and "<<".
## Example
```js
message.channel.createSlider(message.author.id, [embed0, embed1, embed2, embed3], "➡", "⬅")
```
- The order of the embeds in the array will be the order of the pages.
- userID is needed to restrict buttons usage to the user who requested the command.
> After 5 minutes, the buttons will become disabled.
<br />
## Contact
[Discord](https://discord.gg/f7FdjUnvFX)