import { PaginatedMessage } from "@sapphire/discord.js-utilities";
import { Command } from "@sapphire/framework";
import { inlineCodeBlock } from "@sapphire/utilities";
const commandsPerCategories = new Map<string, Command[]>();
const paginatedMessage = new PaginatedMessage();
paginatedMessage.setSelectMenuOptions((pageIndex) => {
const category = Array.from(commandsPerCategories.keys())[pageIndex];
return {
label: category,
description: `View the commands in the ${category} category`,
};
});
for (const [category, commands] of commandsPerCategories.entries()) {
paginatedMessage //
.addPageEmbed((embed) =>
embed //
.setTitle(category)
.setDescription(
commands
.map(
(command) =>
`• ${inlineCodeBlock(command.name)} → ${command.description}`
)
.join("\n")
)
);
}
import { PaginatedMessage } from "@sapphire/discord.js-utilities";
import { Command } from "@sapphire/framework";
import { inlineCodeBlock } from "@sapphire/utilities";
const commandsPerCategories = new Map<string, Command[]>();
const paginatedMessage = new PaginatedMessage();
paginatedMessage.setSelectMenuOptions((pageIndex) => {
const category = Array.from(commandsPerCategories.keys())[pageIndex];
return {
label: category,
description: `View the commands in the ${category} category`,
};
});
for (const [category, commands] of commandsPerCategories.entries()) {
paginatedMessage //
.addPageEmbed((embed) =>
embed //
.setTitle(category)
.setDescription(
commands
.map(
(command) =>
`• ${inlineCodeBlock(command.name)} → ${command.description}`
)
.join("\n")
)
);
}