leaderboard.setActions([
{
emoji: Emoji.LeftChevron,
customId: "x-previous",
type: ComponentType.Button,
style: ButtonStyle.Secondary,
run: ({ handler }) => {
if (handler.index === 0) {
handler.index = handler.pages.length - 1;
} else {
--handler.index;
}
},
},
{
emoji: Emoji.RightChevron,
customId: "x-next",
type: ComponentType.Button,
style: ButtonStyle.Secondary,
run: ({ handler }) => {
if (handler.index === handler.pages.length - 1) {
handler.index = 0;
} else {
++handler.index;
}
},
},
{
emoji: Emoji.Cross,
customId: "x-stop",
type: ComponentType.Button,
style: ButtonStyle.Secondary,
run: ({ collector }) => {
collector.stop("stopped");
},
},
]);
leaderboard.setActions([
{
emoji: Emoji.LeftChevron,
customId: "x-previous",
type: ComponentType.Button,
style: ButtonStyle.Secondary,
run: ({ handler }) => {
if (handler.index === 0) {
handler.index = handler.pages.length - 1;
} else {
--handler.index;
}
},
},
{
emoji: Emoji.RightChevron,
customId: "x-next",
type: ComponentType.Button,
style: ButtonStyle.Secondary,
run: ({ handler }) => {
if (handler.index === handler.pages.length - 1) {
handler.index = 0;
} else {
++handler.index;
}
},
},
{
emoji: Emoji.Cross,
customId: "x-stop",
type: ComponentType.Button,
style: ButtonStyle.Secondary,
run: ({ collector }) => {
collector.stop("stopped");
},
},
]);