const paginator = new PaginatedMessage({
template: new FlanticEmbed().setFooter({
text: `${this.client.user!.username}`,
iconURL: this.client.user!.displayAvatarURL(),
}),
})
.addPageEmbeds(embeds)
.setIndex(0)
.setActions([
{
customId: "first",
emoji: "⏪",
type: ComponentType.Button,
style: ButtonStyle.Secondary,
run: (context) => context.handler.setIndex(0),
},
{
customId: "previous",
emoji: "◀️",
type: ComponentType.Button,
style: ButtonStyle.Secondary,
run: (context) => context.handler.setIndex(context.handler.index - 1),
},
{
customId: "next",
emoji: "▶️",
type: ComponentType.Button,
style: ButtonStyle.Secondary,
run: (context) => context.handler.setIndex(context.handler.index + 1),
},
{
customId: "last",
emoji: "⏩",
type: ComponentType.Button,
style: ButtonStyle.Secondary,
run: (context) =>
context.handler.setIndex(context.handler.pages.length - 1),
},
], true);
return await paginator.run(message, message.author);
const paginator = new PaginatedMessage({
template: new FlanticEmbed().setFooter({
text: `${this.client.user!.username}`,
iconURL: this.client.user!.displayAvatarURL(),
}),
})
.addPageEmbeds(embeds)
.setIndex(0)
.setActions([
{
customId: "first",
emoji: "⏪",
type: ComponentType.Button,
style: ButtonStyle.Secondary,
run: (context) => context.handler.setIndex(0),
},
{
customId: "previous",
emoji: "◀️",
type: ComponentType.Button,
style: ButtonStyle.Secondary,
run: (context) => context.handler.setIndex(context.handler.index - 1),
},
{
customId: "next",
emoji: "▶️",
type: ComponentType.Button,
style: ButtonStyle.Secondary,
run: (context) => context.handler.setIndex(context.handler.index + 1),
},
{
customId: "last",
emoji: "⏩",
type: ComponentType.Button,
style: ButtonStyle.Secondary,
run: (context) =>
context.handler.setIndex(context.handler.pages.length - 1),
},
], true);
return await paginator.run(message, message.author);