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

Function resolvePrefixAccessKey

src/utils/messageAdapter.js:31–50  ·  view source on GitHub ↗
(commandData, args)

Source from the content-addressed store, hash-verified

29}
30
31export function resolvePrefixAccessKey(commandData, args) {
32 const options = mapArgumentsToOptions(args, commandData);
33 const subcommand = options.getSubcommand();
34 const subcommandGroup = options.getSubcommandGroup();
35 const commandName = getCommandJson(commandData)?.name;
36
37 if (!commandName) {
38 return null;
39 }
40
41 if (subcommandGroup && subcommand) {
42 return `${commandName} ${subcommandGroup} ${subcommand}`;
43 }
44
45 if (subcommand) {
46 return `${commandName} ${subcommand}`;
47 }
48
49 return commandName;
50}
51
52export function createMockInteraction(message, commandData, args) {
53 const options = mapArgumentsToOptions(args, commandData);

Callers 1

handlePrefixCommandFunction · 0.90

Calls 2

mapArgumentsToOptionsFunction · 0.90
getCommandJsonFunction · 0.70

Tested by

no test coverage detected