Maximum number of elements to be displayed per page.
The MessageEmbed being used for this mode.
To customise the MessageEmbed for this mode, please access this property. Example:
<FieldsEmbed>.embed.setColor('red')
Elements in the current page.
Build the Pagination Fields Embed.
const { FieldsEmbed } = require('discord-paginationembed');
// Under message event.
new FieldsEmbed()
.setAuthorizedUsers([message.author.id])
.setChannel(message.channel)
.setClientAssets({ prompt: 'Yo {{user}} wat peige?!?!?' })
.setArray([{ name: 'John Doe' }, { name: 'Jane Doe' }])
.setElementsPerPage(1)
.setPageIndicator(false)
.formatField('Name', el => el.name)
.setPage(1)
.setTimeout(69000)
.setNavigationEmojis({
back: '◀',
jump: '↗',
forward: '▶',
delete: '🗑'
})
.setFunctionEmojis({
'🔄': (user, instance) => {
const field = instance.embed.fields[0];
if (field.name === 'Name')
field.name = user.tag;
else
field.name = 'Name';
}
})
.build();```
Adds a field to the embed. Same as MessageEmbed.addField, but value takes a function instead.
Name of the field.
Value of the field. Function for Array.prototype.map().join('\n')
.
Whether the field is inline with other field. Default: true
Sets the maximum number of elements to be displayed per page.
Maximum number of elements to be displayed per page.
Generated using TypeDoc
A pagination mode that uses a MessageEmbed with a field(s) containing the elements to paginate.
PaginationEmbed