MCPcopy Create free account
hub / github.com/Botloader/botloader / addCommand

Method addCommand

components/runtime/src/ts/commands.ts:36–42  ·  view source on GitHub ↗
(cmd: Command)

Source from the content-addressed store, hash-verified

34 commands: Command[] = [];
35
36 addCommand(cmd: Command) {
37 if (this.commands.find(v => matchesCommand(cmd, v.name, v.group?.name, v.group?.parent?.name))) {
38 throw new Error(`Duplicate commands registered! Cmd: ${cmd.name}, parent: ${cmd.group?.name}, parent of parent: ${cmd.group?.parent?.name}`);
39 }
40
41 this.commands.push(cmd);
42 }
43
44 /**
45 * @internal

Callers 1

createCommandMethod · 0.80

Calls 1

matchesCommandFunction · 0.85

Tested by

no test coverage detected