Emitted when the builder is finished creating the first page.
Emitted when the page for the builder has updated.
Emitted before the first embed has been sent.
Emitted when the builder has stopped
The channel being used with the EmbedBuilder.
All embeds in the builder.
The embed to push to the array of embeds.
Add an emoji which will perform it's own action when pressed.
builder.addEmojis({
'❗': (sent, page, emoji) => {
builder.cancel();
sent.delete();
sent.channel.send(`A new message ${emoji}\nThe page you were on before was ${page}`);
}
});
The emojis to push.
Adds a single field to all embeds.
Name of the field
Value of the field
Inline?
Adds multiple fields to all embeds.
An array of APIEmbedField
Use after embed has already been built to add time to the current collector.
Time to add to current amount of time. (ms)
Whenever the builder changes it's page, it will add specified amount of time (ms) to the current running timer.
Time to add to current amount of time. (ms)
Create an updater to await responses from a user, then set the builders current page to the page given.
The user to accept a page update from.
Builds the embed.
This calculates pages for the builder to work with.
// This will generate a builder with a data length set to an array
// It will have 10 fields per page, which will all be inline, containing username and points data.
embedBuilder.calculatePages(users.length, 10, (embed, i) => {
embed.addFields({name: users[i].username, value: users[i].points, inline: true});
});
This is the amount of data to process.
This is how much data you want displayed per page.
Gives you an embed and the current index.
Async version of calculatePages
Makes the page calculator wait for operations to finish.
await embedBuilder.calculatePagesAsync(users.length, 10, async (embed, i) => {
const user = await getSomeUser(users[i]);
embed.addFields({name: users.username, value: users.points, inline: true});
});
This is the amount of data to process.
This is how much data you want displayed per page.
Gives you an embed and the current index.
Cancels the builder
Warning: This should not be used to set the channel. You can set that in the constructor
The channel to switch the current one to.
Adds the embeds given to the end of the current embeds array.
The embeds given here will be put at the end of the current embed array.
The reactions the bot will use. If this method is not used in the builder, the bot will automatically add all reactions. Any reactions left out will not be used.
Deletes an emoji from the emoji list
Resets the timer to either the time already set, or a new time given.
New time to set (ms)
Whenever the builder changes it's page, it will reset the timer to the current set time.
The array of embeds to use.
When the collection has ended, and no other custom color is being used, this will be the color the embed is set to. Default is 0xE21717
Any color resolvable
Replaces current type of emoji given with the new emoji provided.
The type of page emoji to replace. Types: back, first, stop, last, next.
This emoji will replace the current page emoji for the given type.
The format that the footer will use to display page number (if enabled).
// %p = current page
// %m = the amount of pages there are
embedBuilder.setPageFormat('Page (%p/%m)');
// -> Page (1/3)
The amount of time the bot will allow reactions for. (ms)
Sets the current embeds page to the one provided. Do not use this unless the first page has initialized already.
The page to update the embed to.
Use the page system for the embed.
Generated using TypeDoc
Builds an embed with a number of pages based on how many are in the EmbedBuilder array given.