MCPcopy Create free account
hub / github.com/codebymitch/TitanBot / getSubcommandInfo

Function getSubcommandInfo

src/handlers/commandLoader.js:12–32  ·  view source on GitHub ↗
(commandData)

Source from the content-addressed store, hash-verified

10const COMMAND_COUNT_WARN_THRESHOLD = 90;
11
12function getSubcommandInfo(commandData) {
13 const subcommands = [];
14
15 if (commandData.options) {
16 for (const option of commandData.options) {
17if (option.type === 1) {
18 subcommands.push(option.name);
19} else if (option.type === 2) {
20 if (option.options) {
21 for (const subOption of option.options) {
22if (subOption.type === 1) {
23 subcommands.push(`${option.name}/${subOption.name}`);
24 }
25 }
26 }
27 }
28 }
29 }
30
31 return subcommands;
32}
33
34async function getAllFiles(directory, fileList = []) {
35 const files = await fs.readdir(directory, { withFileTypes: true });

Callers 2

loadCommandsFunction · 0.85
collectCommandPayloadsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected