- This documentation will be changed without prior notice for any changes in v1's source code. In some cases, commit messages will notify everyone that this documentation has been changed.
- If you are from stable branch (v11), then look here.
New way to install the utility is from NPM: npm install discord-paginationembed@beta
Since v2.0.0:
I
prefix from interfaces has been removed.
For importing types to your TypeScript project:
import { Embeds, FieldsEmbed, IClientAssets } from 'discord-paginationembed';
Typings also provide type parameter for FieldsEmbed
mode to help you identify your element's properties:
interface LegendaryInterface {
pakaluPapito: string;
hotel?: 'Trivago';
}
const fieldsEmbed = new FieldsEmbed<LegendaryInterface>();
Since v1.0.0-beta.2
Since v1.0.0-beta.4
Before, it's either clientAssets.message
or channel
is set, but this makes an unnecessary API call (could lead to ratelimit) via sending/editing a dummy message with clientAssets.prepare
's content. By removing clientAssets.prepare
, setting the channel is now a must while clientAssets.message
is still optional.
Method object as constructor
no longer exists, instead use the methods provided such as setArray()
.
new FieldsEmbed({ array: [ { name: 'yes' } ] })
.setAuthorizedUsers([ message.author.id, ...mentionedUsers ]);
new FieldsEmbed()
.setArray([ { name: 'yes' } ])
.setAuthorizedUsers([ message.author.id, ...mentionedUsers ]);
clientMessage
has been replaced with clientAssets
: similar API but the latter takes an object as the only parameter. Option prompt
was added for customising the content for message to send when prompted to jump to a page.
- [since v1.0.0-beta.4]
prepare
option has been removed due to unnecessary API call.
new FieldsEmbed()
.setClientMessage(clientMessage, 'yo!');
Note: {{user}}
is the placeholder for a user mention.
new FieldsEmbed()
.setClientAssets({
message: clientMessage,
prompt: 'Yo {{user}} what page?' // Option for message content when prompted to jump to a page.
});
All MessageEmbed
methods for FieldsEmbed
mode has been moved to FieldsEmbed#embed
.
new FieldsEmbed()
.setColor('RANDOM');
new FieldsEmbed().embed
.setColor('RANDOM');