Emitted after the initial embed has been sent (technically, after the client finished reacting with enabled navigation and function emojis).
Emitted when the instance is finished by a user reacting with delete
navigation emoji
or a function emoji that throws non-Error type.
Emitted after the page number is updated and before the client sends the embed.
Emitted upon a user reacting on the instance.
Emitted when the awaiting timeout is reached.
Emitted upon an occurance of error.
An array of elements to paginate.
The author of all embeds.
The authorized users to navigate the pages. Default: everyone
The channel where to send the embed.
Settings for assets for the client.
The color of all embeds.
The client's message content options.
Whether the client's message will be deleted upon timeout. Default: false
The description of all embeds.
The disabled navigation emojis. Available navigation emojis to disable:
Whether to set function emojis after navigation emojis. Default: false
The fields of all embeds.
The footer of all embeds.
The emojis used for function emojis. Function emojis are user-customised message reactions for modifying the current instance of the pagination such as modifying embed texts, stopping the pagination, etc.
The image of all embeds.
The emojis used for navigation emojis. Navigation emojis are the default message reactions for navigating through the pagination.
The current page. Default: 1
The thumbnail of all embeds.
The time for awaiting a user action before timeout in ms. Default: 30000
The timestamp of all embeds.
The title of all embeds.
The URL of all embeds.
Whether to show page indicator, or put it in embed's footer text (replaces the existing text) instead.
Default: false
Embed in the current page.
The formatted page indicator. Default format: text
Number of pages for this instance.
Adds a field to the fields of all embeds.
The name of the field.
The value of the field.
Whether the field is inline to the other fields.
Adds a function emoji to the embed.
<PaginationEmbed>.addFunctionEmoji('π
±', (_, instance) => {
const field = instance.embed.fields[0];
if (field.name.includes('π
±'))
field.name = 'Name';
else
field.name = 'Naπ
±e';
});
The emoji to use as the function's emoji.
The function to call upon pressing the function emoji.
Files to attach to all embeds.
Files to attach.
Build the Pagination Embeds.
const { Embeds } = require('discord-paginationembed');
const { MessageEmbed } = require('discord.js');
// Under message event.
const embeds = [];
for (let i = 0; i < 5; ++i)
embeds.push(new MessageEmbed().addField('Page', i + 1));
new Embeds()
.setAuthorizedUsers([message.author.id])
.setChannel(message.channel)
.setClientAssets({ prompt: 'Yo {{user}} wat peige?!?!?' })
.setArray(embeds)
.setPageIndicator(false)
.setPage(1)
.setTimeout(69000)
.setNavigationEmojis({
back: 'β',
jump: 'β',
forward: 'βΆ',
delete: 'π'
})
.setFunctionEmojis({
'β¬': (_, instance) => {
for (const embed of instance.array)
embed.fields[0].value++;
},
'β¬': (_, instance) => {
for (const embed of instance.array)
embed.fields[0].value--;
}
})
.setDescription('This is one of my embeds with this message!')
.setColor(0xFF00AE)
.setTimestamp()
.build();```
Deletes a function emoji.
The emoji key to delete.
Deletes all function emojis, and then re-enables all navigation emojis.
Sets the array of MessageEmbed to paginate.
An array of MessageEmbed to paginate.
Set the author of all embeds.
The name of the author.
The icon URL of the author.
The URL of the author.
Set the authorized users to navigate the pages.
A user ID or an array of user IDs.
The channel where to send the embed.
The channel object.
Sets the settings for assets for the client.
The assets for the client.
Sets the color of all embeds.
The color of all embeds.
Sets the client's message content.
The message content.
The string to separate the content from the page indicator.
Sets whether the client's message will be deleted upon timeout.
Sets the description of all embeds.
The description of all embeds.
Sets the disabled navigation emojis.
// Disable specific navigation emojis
<PaginationEmbed>.setDisabledNavigationEmojis(['delete', 'jump']);
// Disable all navigation emojis
<PaginationEmbed>.setDisabledNavigationEmojis(['all']);
An array of navigation emojis to disable.
Sets whether to set function emojis after navigation emojis.
Set function emojis after navigation emojis?
Sets the footer of all embeds.
The footer text.
URL for the footer's icon.
Sets the emojis used for function emojis.
<PaginationEmbed>.setFunctionEmojis({
'π': (user, instance) => {
const field = instance.embed.fields[0];
if (field.name === 'Name')
field.name = user.tag;
else
field.name = 'Name';
}
});
An object containing customised emojis to use as function emojis.
Sets the image of all embeds.
The image of all embeds.
Sets the emojis used for navigation emojis.
An object containing customised emojis to use as navigation emojis.
Sets to jump to a certain page upon calling PaginationEmbed.build().
The page number to jump to.
Sets the page indicator formatting function and placement.
Whether to show page indicator.
Pass footer
to display the indicator in embed's footer text (replaces existing text) instead.
Function for indicator formatting.
Sets the thumbnail of all embeds.
The thumbnail of all embeds.
Sets the time for awaiting a user action before timeout in ms.
Timeout value in ms.
Sets the timestamp of all embeds.
The timestamp or date.
Sets the title of all embeds.
The title of all embeds.
Sets the URL of all embeds.
The URL of all embeds.
Removes, replaces, and inserts fields in all embeds (max 25).
The index to start at.
The number of fields to remove.
The name of the field.
The value of the field.
Set the field to display inline.
Transforms all embeds to plain objects.
Generated using TypeDoc
A pagination mode that uses an array of MessageEmbed to paginate.