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

Function sanitizeCommandName

src/utils/logger.js:12–22  ·  view source on GitHub ↗
(interaction)

Source from the content-addressed store, hash-verified

10const traceStorage = new AsyncLocalStorage();
11
12function sanitizeCommandName(interaction) {
13 if (interaction?.isChatInputCommand?.() && interaction.commandName) {
14 return interaction.commandName;
15 }
16
17 if (interaction?.isButton?.() || interaction?.isModalSubmit?.() || interaction?.isStringSelectMenu?.()) {
18 return interaction.customId || null;
19 }
20
21 return null;
22}
23
24export function createTraceId(prefix = 'trc') {
25 return `${prefix}_${crypto.randomUUID().replace(/-/g, '')}`;

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected