MCPcopy Index your code
hub / github.com/codebymitch/TitanBot / resolveCategoryChoice

Function resolveCategoryChoice

src/services/commandAccessService.js:308–327  ·  view source on GitHub ↗
(client, input)

Source from the content-addressed store, hash-verified

306}
307
308export function resolveCategoryChoice(client, input) {
309 if (!input) {
310 return null;
311 }
312
313 const registry = buildCommandRegistry(client);
314 const normalizedInput = normalizeCategoryKey(input);
315
316 for (const [key, category] of registry.entries()) {
317 if (
318 key === normalizedInput ||
319 normalizeCategoryKey(category.folder) === normalizedInput ||
320 normalizeCategoryKey(category.displayName) === normalizedInput
321 ) {
322 return category;
323 }
324 }
325
326 return null;
327}

Callers 2

autocompleteFunction · 0.90
executeFunction · 0.90

Calls 2

normalizeCategoryKeyFunction · 0.90
buildCommandRegistryFunction · 0.85

Tested by

no test coverage detected