Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- let ViewingContentType:"Guide"|"Command"|undefined = undefined;
- let ViewingContentIndex:number|undefined = undefined;
- const HelpPagination = new Pagination<typeof Contents>()
- .setItems(Contents)
- .setDisplayItemsPerPage(25)
- .setUser(User)
- .setMapItemsFn(function (FilteredContent, Page) {
- const Embeds = [];
- if ((ViewingContentType !== undefined) && (ViewingContentIndex !== undefined)) {
- switch (ViewingContentType) {
- case "Command": {
- const Command = FilteredCommands[ViewingContentIndex];
- Embeds.push(...)
- } break;
- case "Guide": {
- const Guide = FilteredGuides[ViewingContentIndex];
- Embeds.push(...)
- } break;
- }
- }
- return {
- content : `${User}`,
- embeds : [
- ...Embeds,
- new EmbedBuilder()
- .setTitle("Results matching query")
- .setDescription(...)
- .setColor(...)
- ],
- components : [
- new ActionRowBuilder<StringSelectMenuBuilder>()
- .addComponents(...)
- ]
- }
- })
- .setCustomFunctions(async function (CustomId, Interaction) {
- if (...) {
- ViewingContentIndex = Number((Interaction as StringSelectMenuInteraction).values[0].split(";")[1]);
- ViewingContentType = (Interaction as StringSelectMenuInteraction).values[0].split(";")[0] as "Guide"|"Command";
- return { ContinueRunning : true, ReplyWithDefaultContent : true };
- } else return { UnknownCustomId : true };
- });
- await HelpPagination.Start(Origin);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement