fixed rolemenu/tracks buttons & stats
diff --git a/src/commands/settings/rolemenu.ts b/src/commands/settings/rolemenu.ts
index 11c6b67..154fe71 100644
--- a/src/commands/settings/rolemenu.ts
+++ b/src/commands/settings/rolemenu.ts
@@ -25,9 +25,9 @@
import { configToDropdown } from "../../actions/roleMenu.js";
import { modalInteractionCollector } from "../../utils/dualCollector.js";
import ellipsis from "../../utils/ellipsis.js";
-import lodash from "lodash";
+import _ from "lodash";
-const isEqual = lodash.isEqual;
+const isEqual = _.isEqual;
const command = (builder: SlashCommandSubcommandBuilder) => builder.setName("rolemenu").setDescription("rolemenu");
@@ -357,7 +357,7 @@
let page = 0;
let closed = false;
const config = await client.database.guilds.read(interaction.guild.id);
- let currentObject: ObjectSchema[] = config.roleMenu.options;
+ let currentObject: ObjectSchema[] = _.cloneDeep(config.roleMenu.options);
let modified = false;
do {
const embed = new EmojiEmbed().setTitle("Role Menu").setEmoji("GUILD.GREEN").setStatus("Success");
@@ -392,7 +392,7 @@
.setCustomId("next")
.setEmoji(getEmojiByName("CONTROL.RIGHT", "id") as APIMessageComponentEmoji)
.setStyle(ButtonStyle.Primary)
- .setDisabled(page === Object.keys(currentObject).length - 1),
+ .setDisabled(page === Object.keys(currentObject).length - 1 || noRoleMenus),
new ButtonBuilder()
.setCustomId("add")
.setLabel("New Page")
diff --git a/src/commands/settings/tracks.ts b/src/commands/settings/tracks.ts
index 5215b3f..3914a6c 100644
--- a/src/commands/settings/tracks.ts
+++ b/src/commands/settings/tracks.ts
@@ -382,7 +382,7 @@
.setCustomId("next")
.setEmoji(getEmojiByName("CONTROL.RIGHT", "id") as APIMessageComponentEmoji)
.setStyle(ButtonStyle.Primary)
- .setDisabled(page === tracks.length - 1),
+ .setDisabled(page === tracks.length - 1 || noTracks),
new ButtonBuilder()
.setCustomId("add")
.setLabel("New Track")