diff --git a/src/utils/client.ts b/src/utils/client.ts
index 2e2baa6..2a0702a 100644
--- a/src/utils/client.ts
+++ b/src/utils/client.ts
@@ -1,4 +1,3 @@
-import { ApplicationCommand, ApplicationCommandResolvable, DataManager } from 'discord.js';
 import Discord, { Client, Interaction, AutocompleteInteraction, GatewayIntentBits, Collection } from 'discord.js';
 import { Logger } from "../utils/log.js";
 import Memory from "../utils/memory.js";
@@ -24,16 +23,15 @@
         eventScheduler: EventScheduler;
         performanceTest: PerformanceTest;
     };
-    commandList?: Discord.Collection<string, Discord.ApplicationCommand>;
     preloadPage: Record<string, {command: string, argument: string}> = {};  // e.g. { channelID: { command: privacy, page: 3}}
-    commands: Record<string, {
+    commands: Record<string, [{
         command: Discord.SlashCommandBuilder |
                 ((builder: Discord.SlashCommandBuilder) => Discord.SlashCommandBuilder) |
                 Discord.SlashCommandSubcommandBuilder | ((builder: Discord.SlashCommandSubcommandBuilder) => Discord.SlashCommandSubcommandBuilder) | Discord.SlashCommandSubcommandGroupBuilder | ((builder: Discord.SlashCommandSubcommandGroupBuilder) => Discord.SlashCommandSubcommandGroupBuilder),
         callback: (interaction: Interaction) => Promise<void>,
-        check: (interaction: Interaction) => Promise<boolean> | boolean,
+        check: (interaction: Interaction, partial: boolean) => Promise<boolean> | boolean,
         autocomplete: (interaction: AutocompleteInteraction) => Promise<string[]>
-    }> = {};
+    } | undefined,{name: string, description: string}]> = {};
     fetchedCommands: Collection<string, Discord.ApplicationCommand> = new Collection();
     constructor(database: typeof NucleusClient.prototype.database) {
         super({ intents: [
diff --git a/src/utils/commandRegistration/register.ts b/src/utils/commandRegistration/register.ts
index b4c6e6e..4290064 100644
--- a/src/utils/commandRegistration/register.ts
+++ b/src/utils/commandRegistration/register.ts
@@ -35,9 +35,12 @@
             fetched.command.setDMPermission(fetched.allowedInDMs ?? false)
             fetched.command.setNameLocalizations(fetched.nameLocalizations ?? {})
             fetched.command.setDescriptionLocalizations(fetched.descriptionLocalizations ?? {})
-            if (fetched.nameLocalizations || fetched.descriptionLocalizations) console.log("AAAAA")
+            // if (fetched.nameLocalizations || fetched.descriptionLocalizations)
             commands.push(fetched.command);
-            client.commands["commands/" + fetched.command.name] = fetched;
+            client.commands["commands/" + fetched.command.name] = [
+                fetched,
+                {name: fetched.name ?? fetched.command.name, description: fetched.description ?? fetched.command.description}
+            ];
         }
         i++;
         console.log(`${last.replace("└", " ").replace("├", "│")}  └─ ${colours.green}Loaded ${file.name} [${i} / ${files.length}]${colours.none}`)
@@ -142,11 +145,11 @@
     client.on("interactionCreate", async (interaction: Interaction) => {
         if (interaction.isUserContextMenuCommand()) {;
             const commandName = "contextCommands/user/" + interaction.commandName;
-            execute(client.commands[commandName]?.check, client.commands[commandName]?.callback, interaction)
+            execute(client.commands[commandName]![0]?.check, client.commands[commandName]![0]?.callback, interaction)
             return;
         } else if (interaction.isMessageContextMenuCommand()) {
             const commandName = "contextCommands/message/" + interaction.commandName;
-            execute(client.commands[commandName]?.check, client.commands[commandName]?.callback, interaction)
+            execute(client.commands[commandName]![0]?.check, client.commands[commandName]![0]?.callback, interaction)
             return;
         } else if (interaction.isAutocomplete()) {
             const commandName = interaction.commandName;
@@ -155,7 +158,7 @@
 
             const fullCommandName = "commands/" + commandName + (subcommandGroupName ? `/${subcommandGroupName}` : "") + (subcommandName ? `/${subcommandName}` : "");
 
-            const choices = await client.commands[fullCommandName]?.autocomplete(interaction);
+            const choices = await client.commands[fullCommandName]![0]?.autocomplete(interaction);
 
             const formatted = (choices ?? []).map(choice => {
                 return { name: choice, value: choice }
@@ -168,7 +171,7 @@
 
             const fullCommandName = "commands/" + commandName + (subcommandGroupName ? `/${subcommandGroupName}` : "") + (subcommandName ? `/${subcommandName}` : "");
 
-            const command = client.commands[fullCommandName];
+            const command = client.commands[fullCommandName]![0];
             const callback = command?.callback;
             const check = command?.check;
             execute(check, callback, interaction);
@@ -208,20 +211,11 @@
             const guild = await client.guilds.fetch(config.developmentGuildID);
             console.log(`${colours.purple}Registering commands in ${guild!.name}${colours.none}`)
             await guild.commands.set(commandList);
-            client.commandList = guild.commands.cache;
         } else {
             console.log(`${colours.blue}Registering commands in production mode${colours.none}`)
             await client.application?.commands.set(commandList);
         }
     }
-    if (config.enableDevelopment) {
-        const guild = await client.guilds.fetch(config.developmentGuildID);
-        await guild.commands.fetch();
-        client.commandList = guild.commands.cache;
-    } else {
-        await client.application?.commands.fetch();
-        client.commandList = client.application?.commands.cache!;
-    }
     await registerCommandHandler();
     await registerEvents();
     console.log(`${colours.green}Registered commands, events and context menus${colours.none}`)
diff --git a/src/utils/commandRegistration/slashCommandBuilder.ts b/src/utils/commandRegistration/slashCommandBuilder.ts
index b2927d6..a4474ac 100644
--- a/src/utils/commandRegistration/slashCommandBuilder.ts
+++ b/src/utils/commandRegistration/slashCommandBuilder.ts
@@ -1,4 +1,4 @@
-import type { SlashCommandSubcommandGroupBuilder } from "@discordjs/builders";
+import type { SlashCommandSubcommandGroupBuilder } from "discord.js";
 import type { SlashCommandBuilder } from "discord.js";
 import config from "../../config/main.json" assert { type: "json" };
 import getSubcommandsInFolder from "./getFilesInFolder.js";
@@ -64,6 +64,7 @@
                 bitfield.add(userPermissions)
             command.setDefaultMemberPermissions(bitfield.bitfield)
         }
+        client.commands[commandString!] = [undefined, { name: name, description: description }]
 
         for (const subcommand of fetched.subcommands) {
             let fetchedCommand;
@@ -72,11 +73,12 @@
             } else {
                 fetchedCommand = subcommand.command;
             }
-            client.commands[commandString! + "/" + fetchedCommand.name] = subcommand
+            client.commands[commandString! + "/" + fetchedCommand.name] = [subcommand, { name: fetchedCommand.name, description: fetchedCommand.description }]
             command.addSubcommand(fetchedCommand);
         }
         for (const group of fetched.subcommandGroups) {
             command.addSubcommandGroup(group.command);
+            client.commands[commandString! + "/" + group.command.name] = [undefined, { name: group.command.name, description: group.command.description }]
         };
         return command;
     };
diff --git a/src/utils/confirmationMessage.ts b/src/utils/confirmationMessage.ts
index 6dc424e..18bcd7b 100644
--- a/src/utils/confirmationMessage.ts
+++ b/src/utils/confirmationMessage.ts
@@ -1,4 +1,4 @@
-import { TextInputBuilder } from "@discordjs/builders";
+import { TextInputBuilder } from "discord.js";
 import Discord, {
     CommandInteraction,
     Interaction,
@@ -280,7 +280,7 @@
             await this.timeoutError()
             returnValue.cancelled = true;
         }
-        if (success == false) {
+        if (success === false) {
             await this.interaction.editReply({
                 embeds: [new EmojiEmbed()
                     .setTitle(this.title)
diff --git a/src/utils/generateEmojiEmbed.ts b/src/utils/generateEmojiEmbed.ts
index 2978176..a326fc5 100644
--- a/src/utils/generateEmojiEmbed.ts
+++ b/src/utils/generateEmojiEmbed.ts
@@ -1,4 +1,4 @@
-import { EmbedBuilder } from "@discordjs/builders";
+import { EmbedBuilder } from "discord.js";
 import getEmojiByName from "./getEmojiByName.js";
 
 const colors = {
diff --git a/src/utils/getCommandDataByName.ts b/src/utils/getCommandDataByName.ts
new file mode 100644
index 0000000..0d4ac47
--- /dev/null
+++ b/src/utils/getCommandDataByName.ts
@@ -0,0 +1,27 @@
+import type Discord from "discord.js";
+import client from "./client.js";
+
+
+export const getCommandMentionByName = (name: string): string => {
+    const split = name.replaceAll("/", " ").split(" ")
+    const commandName: string = split[0]!;
+
+    const filterCommand = (command: Discord.ApplicationCommand) => command.name === commandName;
+
+    const command = client.fetchedCommands.filter(c => filterCommand(c))
+    if (command.size === 0) return `\`/${name.replaceAll("/", " ")}\``;
+    const commandID = command.first()!.id;
+    return `</${split.join(" ")}:${commandID}>`;
+}
+
+export const getCommandByName = (name: string): {name: string, description: string, mention: string} => {
+
+    const split = name.replaceAll(" ", "/")
+    const command = client.commands["commands/" + split]!;
+    const mention = getCommandMentionByName(name);
+    return {
+        name: command[1].name,
+        description: command[1].description,
+        mention: mention
+    }
+}
\ No newline at end of file
diff --git a/src/utils/getCommandMentionByName.ts b/src/utils/getCommandMentionByName.ts
deleted file mode 100644
index e5a67c5..0000000
--- a/src/utils/getCommandMentionByName.ts
+++ /dev/null
@@ -1,15 +0,0 @@
-import type Discord from "discord.js";
-import client from "./client.js";
-
-
-export const getCommandMentionByName = async (name: string): Promise<string> => {
-    const split = name.replaceAll("/", " ").split(" ")
-    const commandName: string = split[0]!;
-
-    const filterCommand = (command: Discord.ApplicationCommand) => command.name === commandName;
-
-    const command = client.commandList!.filter(c => filterCommand(c))
-    if (command.size === 0) return `\`/${name.replaceAll("/", " ")}\``;
-    const commandID = command.first()!.id;
-    return `</${split.join(" ")}:${commandID}>`;
-}
