InteractionButtonPages

Create interaction/application command button pages with this class.

Constructor

new DBP.InteractionButtonPages(data);

Paramenter Type Optional Default Description
data

✔️

{}

Easily making interaction/application button page embeds with InteractionButtonPages.

reset()

Properties

.embeds

The embed of discord.js MessageEmbed

Type: ?Array <MessageEmbed>


.ephemeral

The ephemeral where the message only the user can see

Type: ?Boolean


.duration

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

Type: ?Number


.countPage

The counting page of this interaction button pages

Type: ?Boolean


.label

The label of this interaction button pages

Type: ?Array < string >


.emoji

The emoji of this interaction button pages

Type: ?Array < string >


.color

The color of this interaction button pages

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 interaction button pages.

Paramenter Type Description
embed

The embed of discord.js MessageEmbed.

Returns: Array <MessageEmbed>



.setEphemeral(ephemeral)

Set ephemeral of this interaction button pages.

Paramenter Type Default Description
ephemeral false

If you set it to true, Only the user command can see it!

Returns: Boolean



.setDuration(time)

Set duration of this interaction button pages.

Paramenter Type Default Description
time 30000

The duration when bot will stop the embed pages / interaction.

Returns: Number



.setCountPage(count)

Set count pages of this interaction button pages.

Paramenter Type Default Description
count true

The count pages of this InteractionButtonPages.

Returns: Boolean



.setLabelButton([previous, stop, next])

Set label of this interaction button pages.

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 interaction button pages.

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 interaction button pages.

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 InteractionButtonPages to a plain object.

Returns: InteractionButtonPages

The raw data of this InteractionButtonPages