MessageButtonPages

Create pages button with this class.

Constructor

new DBP.MessageButtonPages(data);

Paramenter Type Optional Default Description
data

✔️

{}

Easily making button page embeds use MessageButtonPages.

reset()

Properties

.embeds

The embed of discord.js MessageEmbed

Type: ?Array <MessageEmbed>


.channel

The channel will send message

Type: ?String <MessageChannelType>


.messageDM

This paramenter will send an message/text when the bot success send.

This paramenter will work if the options channel is DM channel

Type: ?String


.duration

The duration of this option functions to stop embed pages according to the time set

Type: ?Number


.countPage

The counting page of this MessageButtonPages

Type: ?Boolean


.label

The label of this MessageButtonPages

Type: ?Array < string >


.emoji

The emoji of this MessageButtonPages

Type: ?Array < string >


.color

The color of this MessageButtonPages

Type: ?Array <MessageButtonColor>


Examples of use Array for label, emoji, color options
["option 1", "option 2", "option 3"]

Description :
option 1 -> For previous button.
option 2 -> For stop button.
option 3 -> For stop button.

reset()

Methods

.setEmbeds([embed])

Set embed discord.js to this MessageButtonPages.

Paramenter Type Description
embed

The embed of discord.js MessageEmbed.

Returns: Array <MessageEmbed>



.setChannel(channel)

Set channel of this MessageButtonPages.

Paramenter Type Default Description
channel CHANNEL

The channel of discord Message Channel.




.setMessageDM(text)

The message dm of this MessageButtonPages.

Paramenter Type Description
text

This paramenter will send an message/text when the bot success send.

This paramenter will work if the options channel is DM channel



.setDuration(time)

Set duration of this MessageButtonPages.

Paramenter Type Default Description
time 30000

The duration when bot will stop the embed pages.

Returns: Number



.setCountPage(count)

Set count pages of this MessageButtonPages.

Paramenter Type Default Description
count true

The count pages of this MessageButtonPages.

Returns: Boolean



.setLabelButton([previous, stop, next])

Set label of this MessageButtonPages.

Paramenter Type Description
previous

The custom Previous label of button.

stop

The custom Stop label of button.

next

The custom Next label of button.

Returns: Array < string >



.setEmojiButton([previous, stop, next])

Set emoji of this MessageButtonPages.

Paramenter Type Default Description
previous ⬅️

The emoji previous of button.

stop

The emoji stop of button.

next ➡️

The emoji next of button.

Returns: Array < string >



.setColorButton([previous, stop, next])

Set color of this MessageButtonPages.

Paramenter Type Default Description
previous PRIMARY

Customing previous color the button.

stop DANGER

Customing stop color the button.

next PRIMARY

Customing next color the button.




.toJSON()

Transforms the MessageButtonPages to a plain object.

Returns: MessageButtonPages

The raw data of this MessageButtonPages