worked on scanners, database, tracks, some moving around and cleaning up files.
diff --git a/src/commands/settings/rolemenu.ts b/src/commands/settings/rolemenu.ts
index 8796892..9528183 100644
--- a/src/commands/settings/rolemenu.ts
+++ b/src/commands/settings/rolemenu.ts
@@ -8,6 +8,7 @@
import createPageIndicator from "../../utils/createPageIndicator.js";
import { configToDropdown } from "../../actions/roleMenu.js";
import { modalInteractionCollector } from "../../utils/dualCollector.js";
+import ellipsis from "../../utils/ellipsis.js";
import lodash from 'lodash';
const isEqual = lodash.isEqual;
@@ -44,8 +45,9 @@
.addComponents(
new StringSelectMenuBuilder()
.setCustomId("reorder")
- .setPlaceholder("Select a page to move...")
- .setMinValues(1)
+ .setPlaceholder("Select all pages in the order you want them to appear.")
+ .setMinValues(currentObj.length)
+ .setMaxValues(currentObj.length)
.addOptions(
currentObj.map((o, i) => new StringSelectMenuOptionBuilder()
.setLabel(o.name)
@@ -81,6 +83,7 @@
out = null;
}
if(!out) return;
+ out.deferUpdate();
if (out.isButton()) return;
if(!out.values) return;
const values = out.values;
@@ -160,12 +163,7 @@
}
-const ellipsis = (str: string, max: number): string => {
- if (str.length <= max) return str;
- return str.slice(0, max - 3) + "...";
-}
-
-const createRoleMenuPage = async (interaction: StringSelectMenuInteraction | ButtonInteraction, m: Message, data?: ObjectSchema): Promise<ObjectSchema | null> => {
+const editRoleMenuPage = async (interaction: StringSelectMenuInteraction | ButtonInteraction, m: Message, data?: ObjectSchema): Promise<ObjectSchema | null> => {
if (!data) data = {
name: "Role Menu Page",
description: "A new role menu page",
@@ -321,7 +319,7 @@
let modified = false;
do {
const embed = new EmojiEmbed()
- .setTitle("Role Menu Settings")
+ .setTitle("Role Menu")
.setEmoji("GUILD.GREEN")
.setStatus("Success");
const noRoleMenus = currentObject.length === 0;
@@ -377,7 +375,7 @@
.setDisabled(!modified),
);
if(noRoleMenus) {
- embed.setDescription("No role menu page have been set up yet. Use the button below to add one.\n\n" +
+ embed.setDescription("No role menu pages have been set up yet. Use the button below to add one.\n\n" +
createPageIndicator(1, 1, undefined, true)
);
pageSelect.setDisabled(true);
@@ -390,7 +388,7 @@
page = Math.min(page, Object.keys(currentObject).length - 1);
current = currentObject[page]!;
embed.setDescription(`**Currently Editing:** ${current.name}\n\n` +
- `**Description:** \`${current.description}\`\n` +
+ `**Description:**\n> ${current.description}\n` +
`\n\n${createPageIndicator(Object.keys(config.roleMenu.options).length, page)}`
);
@@ -424,7 +422,7 @@
page++;
break;
case "add":
- let newPage = await createRoleMenuPage(i, m)
+ let newPage = await editRoleMenuPage(i, m)
if(!newPage) break;
currentObject.push();
page = currentObject.length - 1;
@@ -444,7 +442,7 @@
case "action":
switch(i.values[0]) {
case "edit":
- let edited = await createRoleMenuPage(i, m, current!);
+ let edited = await editRoleMenuPage(i, m, current!);
if(!edited) break;
currentObject[page] = edited;
modified = true;