aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/api/Commands/index.ts9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/api/Commands/index.ts b/src/api/Commands/index.ts
index 6f18f10..aaf0a8e 100644
--- a/src/api/Commands/index.ts
+++ b/src/api/Commands/index.ts
@@ -75,6 +75,15 @@ function modifyOpt(opt: Option | Command) {
}
export function registerCommand(command: Command, plugin: string) {
+ if (!BUILT_IN) {
+ console.warn(
+ "[CommandsAPI]",
+ `Not registering ${command.name} as the CommandsAPI hasn't been initialised.`,
+ "Please restart to use commands"
+ );
+ return;
+ }
+
if (BUILT_IN.some(c => c.name === command.name))
throw new Error(`Command '${command.name}' already exists.`);