diff --git a/src/commands/settings/filters/_meta.ts b/src/commands/settings/filters/_meta.ts
new file mode 100644
index 0000000..d2aff53
--- /dev/null
+++ b/src/commands/settings/filters/_meta.ts
@@ -0,0 +1,8 @@
+import { group } from "../../../utils/commandRegistration/slashCommandBuilder.js";
+
+const name = "filters";
+const description = "Settings for filters";
+
+const subcommand = await group(name, description, `settings/filters`)
+
+export { name, description, subcommand as command};
diff --git a/src/commands/settings/rolemenu.ts b/src/commands/settings/rolemenu.ts
index 1591273..8796892 100644
--- a/src/commands/settings/rolemenu.ts
+++ b/src/commands/settings/rolemenu.ts
@@ -9,7 +9,9 @@
 import { configToDropdown } from "../../actions/roleMenu.js";
 import { modalInteractionCollector } from "../../utils/dualCollector.js";
 import lodash from 'lodash';
+
 const isEqual = lodash.isEqual;
+
 const command = (builder: SlashCommandSubcommandBuilder) =>
     builder
         .setName("rolemenu")
@@ -37,6 +39,60 @@
     ]
 }
 
+const reorderRoleMenuPages = async (interaction: CommandInteraction, m: Message, currentObj: ObjectSchema[]) => {
+    let reorderRow = new ActionRowBuilder<StringSelectMenuBuilder>()
+        .addComponents(
+            new StringSelectMenuBuilder()
+                .setCustomId("reorder")
+                .setPlaceholder("Select a page to move...")
+                .setMinValues(1)
+                .addOptions(
+                    currentObj.map((o, i) => new StringSelectMenuOptionBuilder()
+                        .setLabel(o.name)
+                        .setValue(i.toString())
+                    )
+                )
+        );
+    let buttonRow = new ActionRowBuilder<ButtonBuilder>()
+        .addComponents(
+            new ButtonBuilder()
+                .setCustomId("back")
+                .setLabel("Back")
+                .setStyle(ButtonStyle.Secondary)
+                .setEmoji(getEmojiByName("CONTROL.LEFT", "id") as APIMessageComponentEmoji)
+        )
+    await interaction.editReply({
+        embeds: [
+            new EmojiEmbed()
+                .setTitle("Role Menu")
+                .setDescription("Select pages in the order you want them to appear.")
+                .setStatus("Success")
+        ],
+        components: [reorderRow, buttonRow]
+    });
+    let out: StringSelectMenuInteraction | ButtonInteraction | null;
+    try {
+        out = await m.awaitMessageComponent({
+            filter: (i) => i.channel!.id === interaction.channel!.id,
+            time: 300000
+        }) as StringSelectMenuInteraction | ButtonInteraction | null;
+    } catch (e) {
+        console.error(e);
+        out = null;
+    }
+    if(!out) return;
+    if (out.isButton()) return;
+    if(!out.values) return;
+    const values = out.values;
+
+    const newOrder: ObjectSchema[] = currentObj.map((_, i) => {
+        const index = values.findIndex(v => v === i.toString());
+        return currentObj[index];
+    }) as ObjectSchema[];
+
+    return newOrder;
+}
+
 const editNameDescription = async (i: ButtonInteraction, interaction: StringSelectMenuInteraction | ButtonInteraction, m: Message, data: {name?: string, description?: string}) => {
 
     let {name, description} = data;
@@ -374,6 +430,9 @@
                     page = currentObject.length - 1;
                     break;
                 case "reorder":
+                    let reordered = await reorderRoleMenuPages(interaction, m, currentObject);
+                    if(!reordered) break;
+                    currentObject = reordered;
                     break;
                 case "save":
                     client.database.guilds.write(interaction.guild.id, {"roleMenu.options": currentObject});
diff --git a/src/commands/settings/tracks.ts b/src/commands/settings/tracks.ts
new file mode 100644
index 0000000..0cad55c
--- /dev/null
+++ b/src/commands/settings/tracks.ts
@@ -0,0 +1,26 @@
+import type { CommandInteraction, GuildMember, SlashCommandSubcommandBuilder } from "discord.js";
+import client from "../../utils/client.js";
+
+
+const command = (builder: SlashCommandSubcommandBuilder) =>
+    builder
+        .setName("tracks")
+        .setDescription("Manage the tracks for the server")
+
+
+const callback = async (interaction: CommandInteraction) => {
+
+    
+
+}
+
+const check = (interaction: CommandInteraction, _partial: boolean = false) => {
+    const member = interaction.member as GuildMember;
+    if (!member.permissions.has("ManageRoles"))
+        return "You must have the *Manage Server* permission to use this command";
+    return true;
+};
+
+export { command };
+export { callback };
+export { check };
