diff --git a/src/api/Commands/index.ts b/src/api/Commands/index.ts index 6f18f10d..aaf0a8ea 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.`);